Shop System + APIShop System + API Version 0.0.8 by Exolent

Post Reply
greenie
Full Member
Full Member
Posts: 1815
Joined: Sun Nov 21, 2021 4:55 pm
Jucator SA:MP ?: Nu
Nick:: greenie
Jucator CS ?: Nu

Shop System + APIShop System + API Version 0.0.8 by Exolent

Post by greenie »

Shop System + API
Version 0.0.8
by Exolent


Introduction
This is an advanced management plugin for a Shop menu that is highly extensive.
It allows coders to build a quick and easy shop menu that is customized to their needs.
Cvars
shop_menu_title <title>
- The title of the shop menu that is displayed to players
- Use "{$money}" to be replaced with the player's actual money
- Color codes and new lines are supported
- The default color for the title is yellow
- Default: "Shop Menu^n\wYou have \y{$money}"
shop_chat_tag <tag>
- The prefix before any message in the chat shown from the Shop plugin
- Do not include the space in the tag
- Default: "[SHOP]"
shop_spawn_menu <0|1>
- Shows the shop menu every time you spawn
- 0 = Disabled
- 1 = Enabled
- Default: 0

Client Commands
say /shop
- Opens up the shop menu

Requirements
AMX Mod X version 1.8.1 or higher

Installation
You will need to compile this plugin locally with the shop.inc include file.

Once compiled, install the .amxx file like any other plugin.

If you have any chat plugins (color chat, chat tag, etc.) make sure
they are below this plugin in the plugins.ini, or else "/shop" command will not work.

When installing sub-plugins, they must be AFTER shop_api.amxx in the plugins.ini to work!
Shop items appear in the menu in the order of the plugins in the plugins.ini.

Plugin API
See the shop.inc file for all API documentation.
See attached plugins for examples on using the API.

What you can do:
Easily add items to the menu, all you have to do is make the items work!
Force players to open the menu
Override the shop plugin from using CS money to use your own system (point system plugin, unlimited money, etc.)

Generated Cvars
There are cvars generated for every item in the menu.
To see these cvars, run the plugin and sub-plugins on your server once so a config file is generated.
Then, you can go to addons/amxmodx/configs/shop.cfg.
Be sure to read the comments in the file!

Changelog
0.0.1
Initial release
0.0.2
Fixed multiple pages bug in menu
Added shop_print() native
Improved efficiency in showing the shop menu
0.0.3
Fixed params bug for shop_add_item()
0.0.4
Fixed error from last use data
0.0.5
Fixed error with item callbacks
0.0.6
Added support for handling reset timers and events
0.0.7
Added support for handling reset on disconnect
Changed shop_item_register_cvar() from stock to native and to use item id instead of short name, and allowed "flags" and "fvalue" parameters.
Added generated config file for server owners to see the full cvar list from these plugins.]
0.0.8
Fixed bug with new cvar register method
Fixed bug with reset data not being prepared on items added
Added support for return in shop_item_selected() to be able to disable the purchase
Notes
All example plugins are not going to be updated and are only there for examples.
Any features you may want added (do not ask for items to be made) will be considered and, if reasonable, will be made.
This is not the place to ask for items to be made. Make a topic in Suggestions/Requests.

plugin
Post Reply

Return to “Fun Stuff”