PHP Code:
// Last terrorist Check
new players[32], pnum;
get_players(players, pnum,"ae", "TERRORIST");
if(pnum == 1)
{
// 1 terrorist alive
}
// If you want it automaticly
register_event("DeathMsg", "DeathMsg", "a"); // add to plugins init
public DeathMsg()
{
new Victim = read_data(2)
if(get_user_team(Victim) == 1)
{
new players[32], pnum;
get_players(players, pnum,"ae", "TERRORIST");
if(pnum == 1)
{
// 1 terrorist alive
}
}
}
// add only cts in your menu
new players[32], pnum, player, szplayer[10];
get_players(players, pnum);
name[32]
for( new i; i<pnum; i++ )
{
player = players[i]
get_user_name(player,name,31)
num_to_str(player, szplayer, 9);
menu_additem(menu, name, szplayer, 0);
}
// to handle it
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new player = str_to_num(data);
__________________