i have add to this shop more items
(ex: health , double damage, speed , unlimited ammo, all grenades pack, chameleon, no recoil, gravity)
note:- this shop items unlock bye level
ex:- 1.health [unlock to level 1]
2.double damage [unlock to level 2]
this type
Code:
#include <amxmodx>
#include <fun>
new purchasedFlashiCount[33];
new bool:purchasedFlash[33];
public plugin_init()
{
register_logevent( "logevent_RoundStart", 2, "1=Round_Start" );
register_clcmd("say /flash", "ShowMenu");
}
public logevent_RoundStart()
{
new iPlayers[32], iCount
get_players(iPlayers, iCount, "ch")
if( !iCount ) return
new id
for(--iCount; iCount>=0; iCount--)
{
id = iPlayers[iCount]
if(purchasedFlash[id]) purchasedFlashiCount[id]++;
}
}
public ShowMenu(id) {
if(is_user_alive(id)){
if(purchasedFlashiCount[id] == 0){
new menu = menu_create("Grenade_Menu", "mh_MyMenu");
menu_additem(menu, "flashbang", "", 0); // case 0
menu_display(id, menu, 0);
}
else{
client_print(id, 3, "You need to wait for 1 more round to use Grenade_Menu.")
}
}
else{
client_print(id, 3, "You need to be alive to use Grenade_Menu.")
}
return PLUGIN_HANDLED;
}
public mh_MyMenu(id, menu, item)
{
switch(item)
{
case 0:
{
give_item(id, "weapon_flashbang");
client_print(id, print_chat, "You have purchased flashbang");
purchasedFlash[id] = true;
purchasedFlashiCount[id]--;
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
sorry for my bad english
__________________