Posts: 1,079
Threads: 199
Joined: Jun 2013
Reputation:
0
What I mean is, say I wan't to set every player's interior in the server to the same interior at the same time using a for loop. Would this loop also effect anyone in class selection?
Posts: 843
Threads: 61
Joined: Feb 2013
Reputation:
0
It could do that, yeah. I'm not quite sure.
You could create variable bool:Alive[MAX_PLAYERS] and set it to true each time player spawns. When they die, set it to false and so on. In the loop, just check if the player is alive and set their interior.
Posts: 1,801
Threads: 21
Joined: Mar 2008
Reputation:
0
Simply get the player's states within the loop, if it's on foot/driver/passenger you can set the interior. Otherwise they are dead, not spawned, spectating, etc..
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Don't even need a variable. Use GetPlayerState instead and ignore anyone with PLAYER_STATE_NONE and PLAYER_STATE_WASTED.
Edit: ^