A little tip, properly structure you statements and functions. It makes finding errors quicker and updating your script in the future.
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
//#include <cstrike>
new armament = 0
public plugin_init()
{
register_plugin("Menu Demo", "1.0", "BAILOPAN")
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
register_menucmd(register_menuid("Ce putere alegi?"), keys, "giveWeapon")
register_concmd("amx_arma","cmd_arma",ADMIN_LEVEL_A)
register_clcmd("arma", "showWeaponMenu")
register_clcmd("say giveme", "showWeaponMenu")
register_clcmd("giveme", "showWeaponMenu")
register_cvar("min_reclama", "240")
set_task(20.0,"reclama")
}
public cmd_arma(id)
{
new arg[2]
read_argv(1,arg,1)
if(equal(arg,"1"))
{
armament = 1
set_hudmessage(200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2)
showWeaponMenu(id)
show_hudmessage(0,"Arma mod turned on")
}
else if(equal(arg,"0"))
{
armament = 0
show_hudmessage(0,"Arma mod turned off.")
}
else
{
if(armament==0)
{
console_print(id,"Usage: amx_arma 1 = 0n 0 = now it's OFF")
}
if(armament==1)
{
console_print(id,"Usage: amx_arma 1 = 0n 0 = now it's ON")
}
}
return PLUGIN_CONTINUE
}
public showWeaponMenu(id)
{
new menu[192]
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
format(menu, 191, "Ce putere alegi?^n^n0. Exit\n^n1. Ak power^n2. M4a1 power^n3. Vip power")
show_menu(id, keys, menu)
return PLUGIN_HANDLED
}
public giveWeapon(id, key)
{
//Menu keys
if(key == 4)
{
}
else if(key == 0)
{
give_item(id, "weapon_ak47")
engclient_cmd(id, "drop", "weapon_awp")
engclient_cmd(id, "drop", "weapon_m4a1")
client_print(id, print_chat, "Am ales 1 optiune")
}
else if(key == 1)
{
give_item(id, "weapon_m4a1")
engclient_cmd(id, "drop", "weapon_awp")
engclient_cmd(id, "drop", "weapon_ak47")
client_print(id, print_chat, "Am ales a 2 optiune")
}
else if(key == 2)
{
client_print(id, print_chat, "Am ales a 3 optiune")
set_user_armor(id, 200)
//new armele = CSW_AK47|CSW_AUG|CSW_AWP|CSW_G3SG1|CSW_GALI|CSW_GALIL|CSW_M249|CSW_M4A1|CSW_MP5NAVY|CSW_P228|CSW_P90|CSW_SCOUT|CSW_SG550|CSW_SG552|CSW_TMP|CSW_XM1014|CSW_USP|CSW_ELITE|CSW_MAC10|CSW_FIVESEVEN|CSW_GLOCK18
give_item(id, "weapon_deagle")
}
else if(key == 3)
{
//nimic
}
show_menu(id, 0, " ", 0)
}
public reclama()
{
client_print(0,print_chat,"press y and wrote: giveme")
set_task(get_cvar_float("min_reclama"),"reclama")
return PLUGIN_HANDLED
}