Action for all players.
#1

How do I set an action for all players?
I want to make a race and use SetPlayerRaceCheckpoint, but for all players.
Reply
#2

Use a loop that goes through all players
pawn Code:
for( new i = 0; i < MAX_PLAYERS; i++ ) // Loop through all players
{
   if( !IsPlayerConnected( i ) ) continue; // They're not connected, goto the next player slot (iteration)
   SetPlayerRaceCheckpoint( i, ... ); // Set the checkpoint
}
Reply
#3

https://sampwiki.blast.hk/wiki/Control_Structures#Loops
https://sampwiki.blast.hk/wiki/Loops
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)