I want to dont allow player to select same case in round like , If user select deagle , he won't be able to select it again in the same round. Thanks.
PS: This is a test menu.
Sorry for my english
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>
#define PLUGIN "Simple Menu"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"
new iPoints[33]
new pCvarPreco1
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /points", "DisplayMenu")
register_event("DeathMsg", "eDeath", "a", "1>0")
pCvarPreco1 = register_cvar("preco1", "5")
}
public DisplayMenu(id) {
new menu = menu_create("\w[\r AMXX \w]^n\yBuy", "menu_handler")
menu_additem(menu, "\ybuy 1", "1")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu)
}
public menu_handler(id, menu, item) {
new price = get_pcvar_num(pCvarPreco1)
switch(item) {
case 0: {
if(iPoints[id] >= price && is_user_alive(id)) {
give_item(id, "weapon_deagle")
}
else {
ColorChat(id, GREEN, "[AMXX]^1 You don't have enough points.")
}
}
}
menu_destroy(menu)
}
public eDeath() {
new killer = read_data(1)
new victim = read_data(2)
if(killer != victim) {
iPoints[killer]++
}
}