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]
Quote:
Originally Posted by AkkYrOcK
Quote:
Originally Posted by pupdebox
Edited: Try again
PHP Code:
#include <amxmodx>
#include <fun>
new flashok[33]
new bool:wait[33]
public plugin_init()
{
register_clcmd("say /flash", "ShowMenu");
register_logevent("startroundx", 2, "1=Round_Start");
}
public client_putinserver(id)
{
flashok[id] = 0
wait[id] = false
}
public client_disconnect(id)
{
flashok[id] = 0
wait[id] = false
}
public ShowMenu(id)
{
if(flashok[id] == 0){
new menu = menu_create("Grenade_Menu", "mh_MyMenu");
menu_additem(menu, "flashbang", "", 0); // case 0
menu_display(id, menu, 0);
}
else if(flashok[id] == 1 && !wait[id])
client_print(id, print_chat, "You have to wait 1 round in order to open this menu.")
else if(flashok[id] == 1 && wait[id])
client_print(id, print_chat, "You have already used the menu in this round.")
return PLUGIN_HANDLED;
}
public mh_MyMenu(id, menu, item)
{
switch(item)
{
case 0 .. 7:
{
if(item == 0){
give_item(id, "weapon_flashbang");
client_print(id, print_chat, "You have purhcased flashbang");
}
flashok[id]++
wait[id] = true
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public startroundx()
{
for(new i = 1;i<=get_maxplayers();i++){
if(wait[i] && is_user_connected(i) && !is_user_bot(i))
wait[i] = false
else if(is_user_connected(i) && !(is_user_bot(i)) && !wait[i])
flashok[i] = 0
}
}
|
|