GetMTAVersion: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Client function}} This function returns a string which tell you which MTA version player uses. ==Syntax== <syntaxhighlight lang="lua"> string getMTAVersion( ) </syntaxhighlight> ===Required Arguments=== ...)
 
m (Changed "DeprecatedWithAlt" template to "Deprecated" and removed an unnecessary section)
 
(7 intermediate revisions by 6 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 17: Line 19:
function checkVersion( )
function checkVersion( )
     if getMTAVersion( ) ~= "1.0 dp2.1" then
     if getMTAVersion( ) ~= "1.0 dp2.1" then
         outputChatBox( "Download the least MTA:SA DM and come back!" )
         outputChatBox( "Download the latest MTA:SA DM and come back!" )
     end
     end
end
end
addEventHandler( "onClientPlayerJoin", getRootElement(), checkVersion )
addEventHandler( "onClientResourceStart", getResourceRootElement(), checkVersion )
</syntaxhighlight>
</syntaxhighlight>
==See Also==
{{Server functions}}

Latest revision as of 16:36, 13 February 2015

Emblem-important.png 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