Quote:
Originally Posted by drekes
about the for loops. It's actually quite simple.
PHP Code:
new players[32]; // To hold the players id. new pnum; // The amount of players. new tempid; // To store the temporary player ids
get_players(players, pnum); // Counts the players
for(i = 0; i < pnum; i++) { // i < pnum means as long as i smaller then the amount of players, it continues to loop tempid = players[i] // store the temporary id in a var
if(!is_user_alive(tempid))// If he is dead, skip him continue;
set_user_health(tempid, 100); // Just an example }
|
The variable named "i" is never created. Also your way of using continue is horrible. I believe flagging alive players doesn't give you that much false positives.
.
PHP Code:
for( new player; player < pnum; player++ )
if( is_user_alive( ( tempid = players[ player ] ) ) )
set_user_health( tempid, 100 );