I have this very weird problem, my loop wont run for more than 4 times. Sometimes it runs just once and other times it runs 4 times. Completely random how it runs.
PHP Code:
public zp_round_started(gamemode, id)
{
client_print(0, print_chat, "[Debug] round started")
new players[32], playerCount, i, player
get_players(players, playerCount, "ah")
for ( i = 0; i < 32; i++ )
{
player = players[i]
client_print(0, print_chat, "[Debug] loop is running %d", player)
if ( zp_get_user_zombie(player) || zp_get_user_nemesis(player) ) return
client_print(player, print_chat, "[Debug] You are human")
if ( gHasSuperman[player] )
{
client_print(player, print_chat, "[Debug] Giving powers...")
sh_set_bonus_hp(player, get_pcvar_num(pcvarHealth))
sh_set_bonus_ap(player, get_pcvar_num(pcvarArmor))
set_user_gravity(player, get_pcvar_float(pcvarGravity))
}
}
}
As you can see I have tried various debugs in my code, and it never gets any longer than to "loop running 4", so I'm guessing that the loop is done wrong?
I have replaced 32 with "playerCount" to try and force it to run 32 times, but no luck there either.
How can this be happening?
EDIT:
Oh, now it just ran 6 times and apparently I did have one of those id's, and the only thing I got was bonus HP and AP, no gravity for me, nor did I get any debug message.
__________________