Player
This page describes the player API
Last updated
This page describes the player API
Last updated
playerList()
Retrieves all online player IDs.
playerSpawn(player)
Spawns the player.
playerDespawn(player)
Removes the player from the map.
playerInvalid(player)
Checks whether the player ID is invalid.
playerKick(player, string)
Kicks the player from the game.
playerKill(player)
Force kills the player.
playerDespawn(player, string)
Removes the player from the map.
playerModelSet(player, string)
Changes the player model.
playerHealthSet(player, float)
Sets the player health.
At the moment, this method expects a raw value the game uses to specify health. Maximum health is based off of the mission data, so some maps use value 200, while others can be over 600.
We will make sure health is uniform on the server-side, but right now, you need to set health to 200 if you want full health on freeride map.
0 if successful, -1 if failed
playerPositionSet(player, vec3)
Sets the player position.
playerDirectionSet(player, vec3)
Sets the player's forward direction vector.
playerHeadingSet(player, float)
Sets the player heading angle.
playerNameGet(player)
Retrieves the player name.
playerModelGet(player)
Retrieves the player's model.
playerHealthGet(player)
Retrieves the current player's health.
At the moment, this method returns a raw value the game uses to specify health. Maximum health is based off of the mission data, so some maps use value 200, while others can be over 600.
We will make sure health is uniform on the server-side, but right now, you need to be aware that full health differs per mission and freeride uses value of 200.
float
player health
playerHeadingGet(player)
Retrieves the player's heading angle.
playerPositionGet(player)
Retrieves the player position.
playerDirectionGet(player)
Retrieves the player direction.
There are several visibility options you can set for the player:
playerVisibilityGet(player, visibility_type)
Retrieves the current player's visibility.
playerVisibilitySet(player, visibility_type, int)
Sets the current player's visibility setting.
Type
Description
Type
Description
player
Player ID
Type
Description
player
Player ID
Type
Description
player
Player ID
Type
Description
player
Player ID
string
Reason
Type
Description
player
Player ID
Type
Description
player
Player ID
string
Animation file name
Type
Description
player
Player ID
string
Model name
Type
Description
player
Player ID
float
Health value
Type
Description
player
Player ID
vec3
Array of 3 float values
Type
Description
player
Player ID
vec3
Array of 3 float values
Type
Description
player
Player ID
float
±180 degree angle
Type
Description
player
Player ID
Type
Description
player
Player ID
Type
Description
player
Player ID
Type
Description
player
Player ID
Type
Description
player
Player ID
Type
Description
player
Player ID
Name
Description
VISIBILITY_NAME
Player nameplate visibility
VISIBILITY_ICON
Player's blip visibility on the map
Type
Description
player
Player ID
visibility_type
Visibility option
Type
Description
player
Player ID
visibility_type
Visibility option
int
Visibility state