GetPlayerVersion: Difference between revisions
Jump to navigation
Jump to search
(Created page with '{{Server function}} __NOTOC__ This function gets the client version of the specified player as a sortable string. The string is always 15 characters long and is formatted as…') |
m (→See Also) |
||
(7 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | |||
{{Server function}} | {{Server function}} | ||
{{Note|You can also compare if a version is higher than another using the ''<'' or ''>'' operators.}} | |||
This function gets the client version of the specified [[player]] as a sortable string. The string is always 15 characters long and is formatted as follows: | This function gets the client version of the specified [[player]] as a sortable string. The string is always 15 characters long and is formatted as follows: | ||
* 1 | * 1 character representing the major version | ||
* 1 dot character | * 1 dot character | ||
* 1 | * 1 character representing the minor version | ||
* 1 dot character | * 1 dot character | ||
* 1 | * 1 character representing the maintenance version | ||
* 1 dash character | * 1 dash character | ||
* 1 | * 1 character representing the build type | ||
* 1 dot character | * 1 dot character | ||
* 5 | * 5 characters representing the build number | ||
* 1 dot character | * 1 dot character | ||
* 1 | * 1 character representing the build revision | ||
An example of a version string would be: 1.0.4-9.01746.0 | An example of a version string would be: 1.0.4-9.01746.0 | ||
Line 19: | Line 21: | ||
Where the first three numbers represent the major/minor/maintenance version, i.e. 1.0.4<br> | Where the first three numbers represent the major/minor/maintenance version, i.e. 1.0.4<br> | ||
The fourth number is 9, which means it's a release build, (Development and beta builds have lower numbers here)<br> | The fourth number is 9, which means it's a release build, (Development and beta builds have lower numbers here)<br> | ||
And the fifth and sixth numbers represent the build number. | And the fifth and sixth numbers represent the build number. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string getPlayerVersion ( | string getPlayerVersion ( player thePlayer ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[player]]:getVersion|version|}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''thePlayer:''' The [[player]] whose client version you wish to get. | *'''thePlayer:''' The [[player]] whose client version you wish to get. | ||
Line 46: | Line 48: | ||
==See Also== | ==See Also== | ||
{{ | {{Player functions|server}} |
Latest revision as of 22:42, 6 September 2024
This function gets the client version of the specified player as a sortable string. The string is always 15 characters long and is formatted as follows:
- 1 character representing the major version
- 1 dot character
- 1 character representing the minor version
- 1 dot character
- 1 character representing the maintenance version
- 1 dash character
- 1 character representing the build type
- 1 dot character
- 5 characters representing the build number
- 1 dot character
- 1 character representing the build revision
An example of a version string would be: 1.0.4-9.01746.0
Where the first three numbers represent the major/minor/maintenance version, i.e. 1.0.4
The fourth number is 9, which means it's a release build, (Development and beta builds have lower numbers here)
And the fifth and sixth numbers represent the build number.
Syntax
string getPlayerVersion ( player thePlayer )
OOP Syntax Help! I don't understand this!
- Method: player:getVersion(...)
- Variable: .version
Required Arguments
- thePlayer: The player whose client version you wish to get.
Returns
Returns a string containing the client version, or false if the player is invalid.
Example
Click to collapse [-]
ServerThis example adds a command that allows players to see their own client version.
function showMeMyVersion( playerSource ) local version = getPlayerVersion ( playerSource ) outputChatBox ( "Your client version is: " .. version, playerSource ) end addCommandHandler ( "myversion", showMeMyVersion )
See Also
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerCount
- getPlayerIdleTime
- getPlayerIP
- getPlayerVersion
- getRandomPlayer
- isPlayerMuted
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerMuted
- setPlayerScriptDebugLevel
- setPlayerTeam
- setPlayerVoiceBroadcastTo
- setPlayerVoiceIgnoreFrom
- setPlayerWantedLevel
- spawnPlayer
- takePlayerScreenShot
- Shared
- 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