GetMTAVersion: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function checkVersion( ) | function checkVersion( ) | ||
Line 23: | Line 24: | ||
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), checkVersion ) | addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), checkVersion ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Server functions}} | {{Server functions}} |
Revision as of 12:51, 13 April 2009
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be a more generic way to perform what it does. | |
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
Click to collapse [-]
Clientfunction checkVersion( ) if getMTAVersion( ) ~= "1.0 dp2.1" then outputChatBox( "Download the latest MTA:SA DM and come back!" ) end end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), checkVersion )
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown