getVersion | Multi Theft Auto: Wiki Skip to content

getVersion

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function gives you various version information about MTA and the operating system.

Note

Clientside will return the version from the player, and the server-sided will return version from the server.

Note

Current MTA version: mta -> 1.6 netcode -> 474 number -> 352 sortable -> 1.6.0-9.22279.0 tag -> 1.6-release-22279 type -> Release

Syntax

getVersion ( )

Code Examples

server

This piece of code shows how you can use a simple command and a for loop to dump the output into chatbox, whilst capitalizing 1st character for extra bonus.

function showVersion(player)
-- We use a for loop to dump the output into player chatbox
outputChatBox("Version information (Server):", player, 0, 255, 0)
for ind, dat in pairs(getVersion()) do
-- Uppercasing first letter too
outputChatBox(string.upper(string.sub(ind, 1, 1))..string.sub(ind, 2)..": "..dat, player, 0, 255, 0)
end
end
addCommandHandler("version", showVersion) -- Define our command handler