GetMTAVersion: Difference between revisions
Jump to navigation
Jump to search
m (Changed "DeprecatedWithAlt" template to "Deprecated" and removed an unnecessary section) |
|||
(6 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
This function returns a string which tell you which MTA version player uses. | {{Deprecated|getVersion|}} | ||
This function returns a string which tell you which MTA version player uses. From DP2.1 onwards. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 20: | Line 22: | ||
end | end | ||
end | end | ||
addEventHandler( "onClientResourceStart", getResourceRootElement( | addEventHandler( "onClientResourceStart", getResourceRootElement(), checkVersion ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | |||
{{Server functions}} |
Latest revision as of 16:36, 13 February 2015
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use getVersion instead. |
This function returns a string which tell you which MTA version player uses. From DP2.1 onwards.
Syntax
string getMTAVersion( )
Required Arguments
None
Returns
A string - currently: "1.0 dp2.1"
Example
function checkVersion( ) if getMTAVersion( ) ~= "1.0 dp2.1" then outputChatBox( "Download the latest MTA:SA DM and come back!" ) end end addEventHandler( "onClientResourceStart", getResourceRootElement(), checkVersion )
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown