GetPlayerVersion

From Multi Theft Auto: Wiki
Revision as of 22:51, 6 June 2010 by Ccw (talk | contribs) (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…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 digit character representing the major version number
  • 1 dot character
  • 1 digit character representing the minor version number
  • 1 dot character
  • 1 digit character representing the maintenance version number
  • 1 dash character
  • 1 digit character representing the build type
  • 1 dot character
  • 5 digit characters representing the build number
  • 1 dot character
  • 1 digit character representing the build revision number

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 ( element thePlayer )

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 [-]
Server

This 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