here is a basic example with use of pcvars to make item costs...
then just add the cvars to amxx.cfg or another cfg file...
Example
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "example pcvar item costs"
#define VERSION "1.0"
#define AUTHOR "Blizzard"
new COST1, COST2, COST3, COST4;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
COST1 = register_cvar("amx_cost1", "100");
COST2 = register_cvar("amx_cost2", "100");
COST3 = register_cvar("amx_cost3", "100");
COST4 = register_cvar("amx_cost4", "100");
}
public shop(id)
{
// then use this method to us it as money
new money = cs_get_user_money(id)
if( money < get_pcvar_num(COST1) )
{
client_print(id, print_chat, "You Dont Have Enough Funds" );
return PLUGIN_HANDLED;
}
// and if they have enough money and after you give them the item
cs_set_user_money(id, money - get_pcvar_num(COST1) );
}
__________________