What's wrong with this code i'm trying to loop through all alive terrorist player and add them on menu then adding gOn[tempid] = true; on that particular terrorist selected in menu
PHP Code:
public hu()
{
new menu = menu_create("Menu","h_handler");
new name[32],text[32]
new Players[32]
new playerCount, i, szTempid,player
get_players(Players, playerCount, "che","TERRORIST" )
for (i=0; i<playerCount; i++)
{
player = Players[i]
get_user_name(player, name, 31)
num_to_str( player, szTempid, 9 )
format(text, 31, "%s - %s", name)
menu_additem( menu, name, szTempid, 0 );
};
menu_display(hu, menu, 0)
return PLUGIN_HANDLED;
}
public h_handler(id,menu,item)
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new data[ 6 ], iName[ 64 ];
new access, callback;
menu_item_getinfo( menu, item, access, data,5, iName, 63, callback );
new tempid = str_to_num( data );
if( !is_user_bot( tempid ) )
gOn[tempid] = true;
menu_destroy( menu );
return PLUGIN_HANDLED;
}