PHP Code:
#include <amxmodx>
#include <fun>
new bool:g_bUsed[33]
public plugin_init()
{
register_plugin("My Retarted Menu", "1.0", "Not Me")
register_logevent("OnRoundStart", 2, "1=Round_Start")
register_clcmd("say /mymenu", "ShowMenu")
}
public OnRoundStart()
arrayset(g_bUsed, false, sizeof(g_bUsed))
public client_putinserver(id)
g_bUsed[id] = false
public ShowMenu(id)
{
new iMenu = menu_create("MyMenu", "MenuHandler")
menu_additem(iMenu, "Server Owner") // Case 0
menu_additem(iMenu, "Smoke") // Case 1
menu_display(id, iMenu, 0)
return PLUGIN_HANDLED
}
public MenuHandler(id, iMenu, iItem)
{
switch(iItem)
{
case 0: client_print(id, print_chat, "Serve owner: Testing")
case 1:
{
if(!is_user_alive(id))
client_print(id, print_chat, "sorry u need to alive!!")
else if(get_user_team(id) != 1)
client_print(id, print_chat, "u can't buy this this is only for Ts u are ct please.. help me")
else if(g_bUsed[id])
client_print(id, print_chat, "sorry u can't buy this nade u already purchase 1 nade in this round try next round to buy")
else if(user_has_weapon(id, CSW_SMOKEGRENADE))
client_print(id, print_chat, "u already have 1 smoke u can't buy")
else
{
g_bUsed[id] = true
give_item(id, "weapon_smokegrenade")
}
}
}
menu_destroy(iMenu)
return PLUGIN_HANDLED
}
__________________