-
Notifications
You must be signed in to change notification settings - Fork 3
Functions
Here you can find a list of functions that you can use, note that if an error occurs each function will return a fitting error message describing the problem.
This function is used to load the server data for the specified serverAddress.
ServerAddress syntax is: "ip:port", example:
LoadServerData("149.210.238.117:30120")
Returns a String containing a full html tag including the server-icon img src data.
Example: <img src='data:image/png;base64,(base64-encoded-image-string)' id='server-icon'>
Returns a String containing the raw server hostname.
Returns a String containing the serverAddress.
Example: "149.210.238.117:30120"
Returns an Array of type String containing all loaded server resources.
Returns a String containing the name of the specified resourceId
. ResourceId should be an Int between 1 and the total amount of loaded resources (which can be acquired using: GetResourceCount()
).
Returns an int representing the amount of resources, currently loaded on the server.
Returns an Array of type Player (object) containing all players currently online.
Returns the Player object for the specified PlayerId. PlayerId is a number between 0 - 31 (IT'S NOT THE SAME AS THE FIVEM SERVER PLAYER ID!)
If you want to GET the ServerID of a player, use GetPlayerServerId(PlayerId)
. If you want to GET the PlayerID using a ServerID use GetPlayerIdFromServerId(PlayerServerID)
.
Returns an int representing the PlayerID (0-31) for the specified PlayerServerId.
Example: (PlayerId = 10, ServerId = 69)
GetPlayerIdFromServerId(69)
// Returns: 10
Returns an int representing the PlayerServerId for the specified PlayerId (0-31).
Example: (PlayerId = 10, ServerId = 69):
GetPlayerServerId(10)
// Returns: 69
Returns a string containing one of the following things:
"<External IPv6>:<port>"
"<External IPv4>:<port>"
"private"
"private"
is shown when the server owner used the sv_endpointprivacy true
setting in their server.cfg file, or if the player is using localhost/127.0.0.1
to connect to their server.
Returns an int representing the ping in ms between the player's client and the server.
Returns a String containing the player's username.
Returns an Array of type String containing the playerIdentifiers for the specified PlayerID.
Returns a String containing the player identifier specified by the IdentifierIndex (0-something) for the specified PlayerID (0-31).
Returns an int representing the amount of players currently online.
Returns an int representing the max amount of players allowed online. (Set by the sv_maxclients
setting in the server.cfg file)
Returns a String containing the current GameType.
Returns a String containing the currrent MapName.
Returns a Boolean; true means ScriptHook is enabled, false means ScriptHook is disabled.
Returns a String containing the server version. Looks something like this:
"FXServer-master SERVER v1.0.0.346 win32"
- LoadServerData
- GetServerIcon
- GetServerHostname
- GetServerAddress
- GetResources
- GetResource
- GetResourceCount
- GetPlayers
- GetPlayer
- GetPlayerIdFromServerId
- GetPlayerServerId
- GetPlayerIP
- GetPlayerPing
- GetPlayerName
- GetPlayerIdentifiers
- GetPlayerIdentifierFromIndex
- GetPlayerCount
- GetMaxPlayerCount
- GetGameType
- GetMapName
- IsScriptHookEnalbed
- GetServerVersion