Member
|
08-02-2015
, 15:16
Re: [Fix My Sma Plss]
|
#4
|
Oke , i think i fixed it , u just have tu try it
PHP Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun>
#define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author"
public plugin_init() { register_clcmd("say /shop", "cmdShop", 0) }
public plugin_config(){ server_cmd("sv_maxspeed 1000") ; }
public cmdShop(id) { new menu = menu_create("\rShop Menu", "cmdShop_handler"); menu_additem(menu, "\wFire Grenade \y[\r300$\y]", "1" , 0); menu_additem(menu, "\wFrost Grenade \y[\r300$\y]", "2" , 0); menu_additem(menu, "\wSpeed Boost \y[\r1500$\y]", "3" , 0); menu_additem(menu, "\wMachinGun \y[\r2000$\y]", "4" , 0); menu_additem(menu, "\wG3SG1 Auto-Sniper \y[\r2500$\y]", "5" , 0); menu_additem(menu, "\wLaserMine \y[\r2500$\y]", "6" , 0); menu_additem(menu, "\wMiniGun \y[\r6000$\y]", "7" , 0); menu_additem(menu, "\wGolden Ak47 \y[\r8000$\y]", "8" , 0); menu_setprop(menu, MPROP_EXITNAME, "close") menu_display(id, menu, 0) }
public cmdShop_handler(id, menu, item) { if( item == MPROP_EXITNAME ) { return PLUGIN_HANDLED; } new data[6], szName[64], cash[33]; new access, callback; menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback); cash[id] = cs_get_user_money(id); new key = str_to_num(data); switch(key) { case 1: { if(cash[id] > 300) { client_print(id, print_chat, "You Have Bought Fire Grenade"); cs_set_user_money(id, cash[id] - 300); give_item(id, "weapon_hegrenade"); } else { client_print(id, print_chat, "You Dont Have Enough Money"); } } case 2: { if(cash[id] > 300) { client_print(id, print_chat, "You Have Bought Frost Grenade"); cs_set_user_money(id, cash[id] - 300); give_item(id, "weapon_hegrenade"); } else { client_print(id, print_chat, "You Don't Have Enough Money"); } } case 3: { set_user_maxspeed(id, get_user_maxspeed(id) +250.0) } case 4: { if(cash[id] > 2000) { client_print(id, print_chat, "You Have Bought MachinGun"); cs_set_user_money(id, cash[id] - 2000); give_item(id, "weapon_m249"); } else { client_print(id, print_chat, "You Don't Have Enough Money"); } } case 5: { if(cash[id] > 2500) { client_print(id, print_chat, "You Have Bought G3SG1 Auto-Sniper"); cs_set_user_money(id,cash[id] - 2500) give_item(id, "weapon_g3sg1"); } else { client_print(id, print_chat, "You Don't Have Enough Money"); } } case 6: client_cmd (id, "say /lm") case 7: client_cmd (id, "say /minigun") case 8: client_cmd (id, "say /goldenak47") } return PLUGIN_HANDLED; }
Last edited by Loupu.; 08-02-2015 at 15:23.
|
|