Is class select ignored by for loops?
#1

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?
Reply
#2

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.
Reply
#3

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..
Reply
#4

Don't even need a variable. Use GetPlayerState instead and ignore anyone with PLAYER_STATE_NONE and PLAYER_STATE_WASTED.

Edit: ^
Reply
#5

Quote:
Originally Posted by Vince
Посмотреть сообщение
Don't even need a variable. Use GetPlayerState instead and ignore anyone with PLAYER_STATE_NONE and PLAYER_STATE_WASTED.

Edit: ^
Thanks Vince!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)