getLocalization | Multi Theft Auto: Wiki Skip to content

getLocalization

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 gets the player's localization setting as set in the MTA client.

Syntax

getLocalization ( )

Code Examples

client

This example outputs simpleWelcomemessage at the resource start (also when player joins the game if the resource is already running).

local msg = {cs = "Vítejte", fr = "Accueil", de = "Willkommen", pl = "Powitanie", hu = "Üdv"}
addEventHandler("onClientResourceStart", resourceRoot,
function ()
local languageCode = getLocalization()["code"]
if msg[languageCode] then --Check if the message is avaible in client's language
outputChatBox(msg[languageCode] .. "!") --Output it
else
outputChatBox("Welcome!") --Output English for any other language
end
end)