Aller au contenu principal

Player States

This page compiles the list of all the player states used by GetPlayerState function or OnPlayerStateChange callback. Both pages contain examples on how to use the values below.

From a server developer standpoint having both "player states" and "special actions" may seem confusing. The main difference between the two is that the former is used for synchronization purposes (and there are packets associated with some of them), and is used for more "generic" actions. The "special actions" don't have any packets associated with them and cover more "specific" actions, and obviously have little to do with the current state of a player.

States

IDMacroDescription
0PLAYER_STATE_NONEThe default player state which is used while initializing
1PLAYER_STATE_ONFOOTThe player is on foot
2PLAYER_STATE_DRIVERThe player is driving a vehicle
3PLAYER_STATE_PASSENGERThe player is in a vehicle as a passenger
4PLAYER_STATE_EXIT_VEHICLEThe player is exiting a vehicle. It is primarily used internally
5PLAYER_STATE_ENTER_VEHICLE_DRIVERThe player is entering a vehicle as the driver. It is primarily used internally
6PLAYER_STATE_ENTER_VEHICLE_PASSENGERThe player is entering a vehicle as the passenger. It is primarily used internally
7PLAYER_STATE_WASTEDThe player is either dead or in class selection
8PLAYER_STATE_SPAWNEDThe player is just spawned
9PLAYER_STATE_SPECTATINGThe player is in spectator mode