Hi guys. I have this and works
PHP Code:
//#includes...
new g_Weapon[33]
enum
{
NO_WEAPON = 0,
AK,
M4
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "fwd_Spawn", 1)
register_clcmd("say /test", "test")
}
public client_putinserver(id)
{
g_Weapon[id] = NO_WEAPON
}
public fwd_Spawn(id)
{
if (g_Weapon[id] == NO_WEAPON) return;
if (g_Weapon[id] == AK)
{
give_item(id, "weapon_ak47")
}
else if (g_Weapon[id] == M4)
{
give_item(id, "weapon_m4a1")
}
}
public test(id)
{
new menu = menu_create("Choose a weapon", "items")
menu_additem(menu, "AK47", "0")
menu_additem(menu, "M4A1", "1")
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
public items(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
switch (item)
{
case 0:
{
g_Weapon[id] = AK //Next round you'll get an AK47
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 1:
{
g_Weapon[id] = M4A1 //Next round you'll get a M4A1
menu_destroy(menu)
return PLUGIN_HANDLED
}
}
return PLUGIN_HANDLED
}
but I only can choose one of them, what I should do to choose 2, 3 or more arrays?
Ty for help^^
__________________