PHP Code:
new counted_spawns
public event_deathmsg5()
{
new victim = read_data(2)
if(get_user_team(victim) == 1 && g_Tickets[victim] > 1)
{
g_Tickets[victim]--
set_task(get_pcvar_float(cvar_respawndelay), "respawn_player", victim)
client_print(victim, print_chat, "Tickets left: %d", g_Tickets[victim])
}
new Players[32], iNum = 0, i;
get_players(Players, iNum, "ae", "TERRORIST")
if(iNum > 0)
{
for(i = 0; i < iNum; ++i)
counted_spawns = g_Tickets[Players[i]]
}
set_hudmessage(0, 255, 50, 0.02, 0.27, 1, 3.0, 3.0)
ShowSyncHudMsg(0, g_msgHudSyncX, "Preds Remaining : %i", counted_spawns)
}
Why it gets only the victim g_Tickets? I've loop it through all players and get all tickets in terrorist team.
It prints always : Preds Remaining : 2 or 1 (it's only victim) . I need to get all terrorist team g_Tickets, so why it won't?