GetMTAVersion: Difference between revisions
Jump to navigation
Jump to search
m (Visual improvement) |
m (Changed "DeprecatedWithAlt" template to "Deprecated" and removed an unnecessary section) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{ | {{Deprecated|getVersion|}} | ||
This function returns a string which tell you which MTA version player uses. From DP2.1 onwards. | This function returns a string which tell you which MTA version player uses. From DP2.1 onwards. | ||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function checkVersion( ) | function checkVersion( ) | ||
Line 23: | Line 22: | ||
end | end | ||
end | end | ||
addEventHandler( "onClientResourceStart", getResourceRootElement( | addEventHandler( "onClientResourceStart", getResourceRootElement(), checkVersion ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Server functions}} | {{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