GetMTAVersion: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Changed "DeprecatedWithAlt" template to "Deprecated" and removed an unnecessary section)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client function}}
{{Client function}}
{{Deprecated}}
{{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.
==Syntax==
==Syntax==
Line 15: Line 16:


==Example==
==Example==
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function checkVersion( )
function checkVersion( )
Line 22: Line 22:
     end
     end
end
end
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), checkVersion )
addEventHandler( "onClientResourceStart", getResourceRootElement(), checkVersion )
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Server functions}}
{{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