Code:
#include <amxmodx>
#include <cstrike>
#include <colorchat>
#include <fun>
#define PLUGIN "Fun Buy"
#define VERSION "1.0"
#define AUTHOR "ZiruAl"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd( "say /funbuy", "FunBuy" );
register_clcmd( "say_team /funbuy", "FunBuy" );
}
public FunBuy(id)
{
new menu = menu_create("\gFun Buy Menu:", "menu_handler");
menu_additem(menu, "\w Low Gravity - \r4000", "1", 0);
menu_additem(menu, "\w Buy C4 - \r16000", "2", 0);
menu_additem(menu, "\w CT skin - \r14500", "3", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0);
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new acess, callback;
menu_item_getinfo(menu, item, acess, data,6, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1 : //gravity
{
new name[32];
if (cs_get_user_money(id) < 4000)
{
get_user_name(id, name, 31)
ColorChat(id, GREEN, "%s ^x03-Don't have enought money", name)
return PLUGIN_HANDLED;
}
if (!is_user_alive(id))
{
ColorChat(id, GREEN, "%s ^x03-need to be alive", name)
return PLUGIN_HANDLED;
}
if (cs_get_user_money(id) >= 4000 )
{
get_user_name(id, name, 31)
ColorChat(0, GREEN, "%s ^x03-Buy a gravitation", name)
set_user_gravity(id, 0.87)
cs_set_user_money(id , cs_get_user_money(id) - 4000, 0)
}
}
case 2 :
{
new name[32];
if (cs_get_user_money(id) < 16000)
{
get_user_name(id, name, 31)
ColorChat(id, GREEN, "%s ^x03-Don't have enought money", name)
return PLUGIN_HANDLED;
}
if (!is_user_alive(id))
{
ColorChat(id, GREEN, "%s ^x03-need to be alive", name)
return PLUGIN_HANDLED;
}
if (cs_get_user_money(id) >= 16000 )
{
get_user_name(id, name, 31)
ColorChat(0, GREEN, "%s ^x03-Buy a C4", name)
give_item(id, "weapon_c4")
cs_set_user_plant(id, 1, 1)
cs_set_user_money(id , cs_get_user_money(id) - 16000, 0)
}
}
case 3 :
{
new name[32];
if (cs_get_user_money(id) < 14500)
{
get_user_name(id, name, 31)
ColorChat(id, GREEN, "%s ^x03-Don't have enought money", name)
return PLUGIN_HANDLED;
}
if (!is_user_alive(id))
{
ColorChat(id, GREEN, "%s ^x03-need to be alive", name)
return PLUGIN_HANDLED;
}
if (cs_get_user_money(id) >= 14500 )
{
get_user_name(id, name, 31)
ColorChat(0, GREEN, "%s ^x03-Buy a CT skin", name)
precache_model("models\player\pipec\pipec.mdl")
cs_set_user_money(id , cs_get_user_money(id) - 14500, 0)
}
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}