GetPlayerStat
Jump to navigation
Jump to search
Description
This function returns a float that contains the value of the specified statistic, for a specific player.
Syntax
float getPlayerStat ( player thePlayer, int stat )
Required Arguments
- thePlayer: The player whose stat you want to retrieve.
- stat: A whole number determining the stat ID.
Returns
Returns a float indicating the statistic value.
Example
Click to collapse [-]
ServerThis example outputs a player's stat in the chat box.
function onPlayerSpawn ( spawnedPlayer ) local stat = getPlayerStat ( spawnedPlayer, 102 ) -- Check that getPlayerStat returned a value if ( stat ) then -- Output the stat in the chat box outputChatBox ( "The value for " .. getClientName ( spawnedPlayer ) .. "'s 102 stat is " .. stat ) end end
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState