Player
This page describes the player API
Get players
playerList()
Retrieves all online player IDs.
Spawn
playerSpawn(player)
Spawns the player.
Despawn
playerDespawn(player)
Removes the player from the map.
Invalid
playerInvalid(player)
Checks whether the player ID is invalid.
Kick
playerKick(player, string)
Kicks the player from the game.
Kill
playerKill(player)
Force kills the player.
Play anim
playerDespawn(player, string)
Removes the player from the map.
Set model
playerModelSet(player, string)
Changes the player model.
Remarks
You can use models from the following listing.
Arguments
Type | Description |
player | Player ID |
string | Model name |
Returns
0 if successful, -1 if failed
Set health
playerHealthSet(player, float)
Sets the player health.
Remarks
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.
Arguments
Type | Description |
player | Player ID |
float | Health value |
Returns
0 if successful, -1 if failed
Set position
playerPositionSet(player, vec3)
Sets the player position.
Set direction
playerDirectionSet(player, vec3)
Sets the player's forward direction vector.
Set heading
playerHeadingSet(player, float)
Sets the player heading angle.
Get name
playerNameGet(player)
Retrieves the player name.
Get model
playerModelGet(player)
Retrieves the player's model.
Get health
playerHealthGet(player)
Retrieves the current player's health.
Remarks
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.
Arguments
Type | Description |
player | Player ID |
Returns
float
player health
Get heading
playerHeadingGet(player)
Retrieves the player's heading angle.
Get position
playerPositionGet(player)
Retrieves the player position.
Get direction
playerDirectionGet(player)
Retrieves the player direction.
Visibility
There are several visibility options you can set for the player:
Name | Description |
VISIBILITY_NAME | Player nameplate visibility |
VISIBILITY_ICON | Player's blip visibility on the map |
Get visibility
playerVisibilityGet(player, visibility_type)
Retrieves the current player's visibility.
Set visibility
playerVisibilitySet(player, visibility_type, int)
Sets the current player's visibility setting.
Last updated