https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=Remi-X&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-29T01:42:45ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=User:Jusonex&diff=39299User:Jusonex2014-04-09T14:24:23Z<p>Remi-X: English URL for MSVCR 13</p>
<hr />
<div>==Features==<br />
===Awesomium API===<br />
====How to test====<br />
1.) Install the 1.4 r6293 nightly build. Link: http://nightly.mtasa.com/mtasa-1.4-full_unstable-6293-20140409.exe<br />
<br />
2.) Replace the files you've got from http://www.jusonex.net/public/mta/Awesomium_MTA.zip<br />
<br />
If it doesn't work, you'll have to install the x86 VC++ Redist 2013 (http://www.microsoft.com/en-us/download/details.aspx?id=40784).<br />
<br />
====Functions====<br />
<syntaxhighlight lang="lua"><br />
browser createBrowser(int width, int height)<br />
</syntaxhighlight><br />
<syntaxhighlight lang="lua"><br />
bool updateBrowser(browser webBrowser)<br />
</syntaxhighlight><br />
<syntaxhighlight lang="lua"><br />
bool requestBrowserPages(table pages)<br />
</syntaxhighlight><br />
<syntaxhighlight lang="lua"><br />
bool loadBrowserURL(browser webBrowser, string url)<br />
</syntaxhighlight><br />
<syntaxhighlight lang="lua"><br />
bool isBrowserLoading(browser webBrowser)<br />
</syntaxhighlight><br />
<syntaxhighlight lang="lua"><br />
bool injectBrowserMouseMove(browser webBrowser, int x, int y)<br />
</syntaxhighlight><br />
<syntaxhighlight lang="lua"><br />
bool injectBrowserMouseDown(browser webBrowser, int mouseButton) -- mouseButton: 0 = left, 1 = middle, 2 = right<br />
</syntaxhighlight><br />
<syntaxhighlight lang="lua"><br />
bool injectBrowserMouseUp(browser webBrowser, int mouseButton) -- mouseButton: 0 = left, 1 = middle, 2 = right<br />
</syntaxhighlight><br />
<br />
====Events====<br />
Todo<br />
<br />
====Examples====<br />
=====Example 1: A 2D browser with mouse input (keyboard input is missing yet)=====<br />
<syntaxhighlight lang="lua">local webBrowser = createBrowser(1024, 768)<br />
requestBrowserPages({"youtube.com"})<br />
<br />
addCommandHandler("load",<br />
function()<br />
-- Load the url<br />
loadBrowserURL(webBrowser, "http://youtube.com")<br />
end<br />
)<br />
<br />
addEventHandler("onClientRender", root,<br />
function()<br />
-- Update the browser<br />
updateBrowser(webBrowser)<br />
<br />
-- Draw a nice border<br />
dxDrawRectangle(195, 95, 1024+10, 768+10, tocolor(255, 255, 0))<br />
<br />
-- Draw the browser<br />
dxDrawImage(200, 100, 1024, 768, webBrowser)<br />
end<br />
)<br />
<br />
addEventHandler("onClientCursorMove", root,<br />
function(relativeX, relativeY, absoluteX, absoluteY)<br />
injectBrowserMouseMove(webBrowser, absoluteX - 200, absoluteY - 100)<br />
end<br />
)<br />
<br />
local buttons = {left = 0, middle = 1, right = 2}<br />
addEventHandler("onClientClick", root,<br />
function(button, state)<br />
if state == "down" then<br />
injectBrowserMouseDown(webBrowser, buttons[button])<br />
else<br />
injectBrowserMouseUp(webBrowser, buttons[button])<br />
end<br />
end<br />
)<br />
<br />
showCursor(true)</syntaxhighlight><br />
<br />
=====A 3D browser at the car cinema in Fort Carson (Demo: https://www.youtube.com/watch?v=9w2qU6mZDh8)=====<br />
<syntaxhighlight lang="lua"><br />
local width, height = 1600, 900<br />
<br />
-- Create the browser<br />
local webBrowser = createBrowser(width, height)<br />
<br />
-- There is an issue with alpha at the moment --> render everything into a renderTarget first<br />
local renderTarget = dxCreateRenderTarget(width, height, true)<br />
<br />
-- Request the pages<br />
requestBrowserPages({"www.youtube.com", "nyan.cat"})<br />
<br />
addEventHandler("onClientRender", root,<br />
function()<br />
-- Update pixel data<br />
updateBrowser(webBrowser)<br />
<br />
-- Switch to the rendertarget (@issue above)<br />
dxSetRenderTarget(renderTarget)<br />
dxDrawImage(0, 0, width, height, webBrowser)<br />
dxSetRenderTarget()<br />
<br />
-- Draw the line<br />
local x, y = 110.7, 1024.15<br />
dxDrawMaterialLine3D(x, y, 23.25, x, y, 14.75, renderTarget, 18.2, tocolor(255, 255, 255, 255), x, y+1, 19)<br />
end<br />
)<br />
<br />
addCommandHandler("youtube",<br />
function()<br />
outputChatBox("YouTube?")<br />
loadBrowserURL(webBrowser, "http://www.youtube.com/watch?v=kdemFfbS5H0")<br />
end<br />
)<br />
<br />
addCommandHandler("nyan",<br />
function()<br />
outputChatBox("Nyan!")<br />
loadBrowserURL(webBrowser, "http://nyan.cat")<br />
end<br />
)<br />
<br />
addCommandHandler("url",<br />
function(cmd, url)<br />
if not url then return end<br />
<br />
outputChatBox("Opening: "..url)<br />
loadBrowserURL(webBrowser, url)<br />
end<br />
)</syntaxhighlight><br />
<br />
==Notes==<br />
* Crosshair position (weapons that use the "normal" crosshair texture "siteM16"): ''X = screenWidth * 0.5299999714f; Y = screenHeight * 0.4f''<br />
<br />
==Useful stuff==<br />
===Resources===<br />
*[http://www.jusonex.net/public/mta/tools/trackdrawer.zip Train track drawer]<br />
===Tools===<br />
*[http://www.jusonex.net/public/mta/tools/LuaStringEditor.exe Lua bytecode (luac) string editor] ([http://www.jusonex.net/public/mta/tools/LuaStringEditor_MainWindow.cs Source])<br />
===SA Reversing===<br />
*[http://www.jusonex.net/public/mta/loaders/index.php SA loader routines (contribution towards MTA:Eir)]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=IsElementMoving&diff=38492IsElementMoving2014-01-18T13:49:48Z<p>Remi-X: </p>
<hr />
<div>{{Useful Function}}<br />
<lowercasetitle/><br />
__NOTOC__<br />
<br />
This function checks if an element is moving.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"> bool isElementMoving ( element theElement ) </syntaxhighlight><br />
<br />
===Returns===<br />
Returns true if the element is moving, false otherwise.<br />
<br />
===Code===<br />
<syntaxhighlight lang="lua">function isElementMoving ( theElement )<br />
if isElement ( theElement ) then -- First check if the given argument is an element<br />
local x, y, z = getElementVelocity( theElement ) -- Get the velocity of the element given as argument<br />
return x ~= 0 or y ~= 0 or z ~= 0 -- When there is a movement on X, Y or Z return true because our element is moving<br />
end<br />
<br />
return false<br />
end</syntaxhighlight><br />
<br />
===Example===<br />
<section name="Client" class="client" show="true"><br />
This script tells the moving state to the client on the bottom left of their screen.<br />
<syntaxhighlight lang="lua"><br />
local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height)<br />
<br />
function idleCheck ()<br />
local state = "Unknown"<br />
local element = getPedOccupiedVehicle ( localPlayer ) or localPlayer<br />
<br />
-- Check whether the player is moving or not.<br />
if isElementMoving ( element ) then<br />
state = "moving"<br />
else<br />
state = "idling"<br />
end<br />
<br />
-- Write our state string to the lower left corner of the screen<br />
dxDrawText ( "You are " .. state .. "!", 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "default" )<br />
end<br />
<br />
-- Keep the text visible with onClientRender.<br />
addEventHandler ( "onClientRender", root, idleCheck )<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=IsElementMoving&diff=38491IsElementMoving2014-01-18T13:49:02Z<p>Remi-X: </p>
<hr />
<div>{{Useful Function}}<br />
<lowercasetitle/><br />
__NOTOC__<br />
<br />
This function checks if an element is moving.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"> bool isElementMoving ( element theElement ) </syntaxhighlight><br />
<br />
===Returns===<br />
Returns true if the element is moving, false otherwise.<br />
<br />
===Code===<br />
<syntaxhighlight lang="lua">function isElementMoving ( theElement )<br />
if isElement ( theElement ) then -- First check if the given argument is an element<br />
local x, y, z = getElementVelocity( theElement ) -- Get the velocity of the element given in our argument<br />
return x ~= 0 or y ~= 0 or z ~= 0 -- When there is a movement on X, Y or Z return true because our element is moving<br />
end<br />
<br />
return false<br />
end</syntaxhighlight><br />
<br />
===Example===<br />
<section name="Client" class="client" show="true"><br />
This script tells the moving state to the client on the bottom left of their screen.<br />
<syntaxhighlight lang="lua"><br />
local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height)<br />
<br />
function idleCheck ()<br />
local state = "Unknown"<br />
local element = getPedOccupiedVehicle ( localPlayer ) or localPlayer<br />
<br />
-- Check whether the player is moving or not.<br />
if isElementMoving ( element ) then<br />
state = "moving"<br />
else<br />
state = "idling"<br />
end<br />
<br />
-- Write our state string to the lower left corner of the screen<br />
dxDrawText ( "You are " .. state .. "!", 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "default" )<br />
end<br />
<br />
-- Keep the text visible with onClientRender.<br />
addEventHandler ( "onClientRender", root, idleCheck )<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=IsElementMoving&diff=38490IsElementMoving2014-01-18T13:47:20Z<p>Remi-X: </p>
<hr />
<div>{{Useful Function}}<br />
<lowercasetitle/><br />
__NOTOC__<br />
<br />
This function checks if an element is moving.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"> bool isElementMoving ( element theElement ) </syntaxhighlight><br />
<br />
===Returns===<br />
Returns true if the element is moving, false otherwise.<br />
<br />
===Code===<br />
<syntaxhighlight lang="lua">function isElementMoving ( theElement )<br />
if isElement ( theElement ) then -- First check if the given argument is an element<br />
local x, y, z = getElementVelocity( theElement ) -- Get the velocity of the element given in our argument<br />
return x ~= 0 or y ~= 0 or z ~= 0 -- When there is a movement on X, Y or Z return true because our element is moving<br />
end<br />
<br />
return false<br />
end</syntaxhighlight><br />
<br />
===Example===<br />
<section name="Client" class="client" show="true"><br />
This script tells the moving state to the client on the bottom left of their screen.<br />
<syntaxhighlight lang="lua"><br />
local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height)<br />
<br />
function idleCheck ()<br />
local state = "Unknown"<br />
local element = getPedOccupiedVehicle ( localPlayer ) or localPlayer<br />
<br />
-- Check whether the player is moving or not.<br />
if isElementMoving ( element ) then<br />
state = "Moving"<br />
else<br />
state = "Idling"<br />
end<br />
<br />
-- Write our state string to the lower left corner of the screen<br />
dxDrawText ( state, 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "default" )<br />
end<br />
<br />
-- Keep the text visible with onClientRender.<br />
addEventHandler ( "onClientRender", root, idleCheck )<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=IsElementMoving&diff=38489IsElementMoving2014-01-18T13:46:08Z<p>Remi-X: </p>
<hr />
<div>{{Useful Function}}<br />
<lowercasetitle/><br />
__NOTOC__<br />
<br />
This function checks if an element is moving.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"> bool isElementMoving ( element theElement ) </syntaxhighlight><br />
<br />
===Returns===<br />
Returns true if the element is moving, false otherwise.<br />
<br />
===Code===<br />
<syntaxhighlight lang="lua">function isElementMoving ( theElement )<br />
if isElement ( theElement ) then -- First check if the given argument is an element<br />
local x, y, z = getElementVelocity( theElement ) -- Get the velocity of the element given in our argument<br />
return x ~= 0 or y ~= 0 or z ~= 0 -- When there is a movement on X, Y or Z return true because our element is moving<br />
end<br />
<br />
return false<br />
end</syntaxhighlight><br />
<br />
===Example===<br />
<section name="Client" class="client" show="true"><br />
This script tells the moving state to the client on the bottom left of their screen.<br />
<syntaxhighlight lang="lua"><br />
local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height)<br />
<br />
function idleCheck ()<br />
local state = "Unknown"<br />
local element = getPedOccupiedVehicle ( localPlayer ) or localPlayer<br />
<br />
if isElementMoving( element ) then<br />
state = "Moving"<br />
else<br />
state = "Idling"<br />
end<br />
<br />
--Write our state string to the lower left corner of the screen<br />
dxDrawText ( state, 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "default" )<br />
end<br />
<br />
addEventHandler ( "onClientRender", root, idleCheck ) -- keep the text visible with onClientRender.<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=IsElementMoving&diff=38488IsElementMoving2014-01-18T13:34:34Z<p>Remi-X: </p>
<hr />
<div>{{Useful Function}}<br />
<lowercasetitle/><br />
__NOTOC__<br />
<br />
This function checks if an element is moving.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"> bool isElementMoving ( element theElement ) </syntaxhighlight><br />
<br />
===Returns===<br />
Returns true if the element is moving, otherwise false.<br />
<br />
===Code===<br />
<syntaxhighlight lang="lua">function isElementMoving ( theElement )<br />
if isElement ( theElement ) then --First check if the given argument is an element<br />
local x, y, z = getElementVelocity( theElement ) --Get the velocity of the element given in our argument<br />
return x ~= 0 or y ~= 0 or z ~= 0 --When there is a movement on X, Y or Z return true because our element is moving<br />
end<br />
<br />
return false<br />
end</syntaxhighlight><br />
<br />
===Example===<br />
<section name="Client" class="client" show="true"><br />
This script tells the moving state to the client on the bottom left of their screen<br />
<syntaxhighlight lang="lua"><br />
local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height)<br />
<br />
function idleCheck ()<br />
local state<br />
if isElementMoving( getLocalPlayer() ) then --Check if it is the player "strolling"<br />
state = "Moving"<br />
elseif isElementMoving( getPedOccupiedVehicle ( getLocalPlayer() ) ) then --Player is not "Strolling" maybe the player is in a vehicle<br />
state = "Moving"<br />
else --The player not moving on feet or in a vehicle<br />
state = "Idling"<br />
end<br />
--Write our state string to the lower left corner of the screen<br />
dxDrawText ( state, 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "default" )<br />
end<br />
<br />
addEventHandler ( "onClientRender", getRootElement(), idleCheck ) -- keep the text visible with onClientRender.<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=OnPlayerWasted&diff=38220OnPlayerWasted2014-01-09T20:23:34Z<p>Remi-X: Parameters from an event are always optional, no need to mark the stealth param to be optional.</p>
<hr />
<div>__NOTOC__ <br />
{{Server event}}<br />
This event is triggered when a player is killed or dies.<br />
<br />
==Parameters==<br />
{{New feature/item|3|1.0||<syntaxhighlight lang="lua"><br />
int totalAmmo, element killer, int killerWeapon, int bodypart, bool stealth<br />
</syntaxhighlight>}}<br />
<br />
{{Deprecated_feature|3|1.0|<syntaxhighlight lang="lua"><br />
int totalAmmo, element killer, int killerWeapon, int bodypart<br />
</syntaxhighlight>}}<br />
<br />
*'''totalAmmo''': an integer representing the total ammo the victim had when he died.<br />
*'''killer''': an [[element]] representing the player or vehicle who was the killer. If there was no killer this is ''false''.<br />
*'''killerWeapon''': an integer representing the [[Weapons|killer weapon]] or the [[Death Reasons|death reason]].<br />
*'''bodypart''': an integer representing the bodypart ID the victim was hit on when he died.<br />
{{BodyParts}}<br />
*{{New feature/item|3|1.0||'''stealth''': boolean value representing whether or not this was a stealth kill}}<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[player]] that died or got killed.<br />
<br />
==Example== <br />
This example prints the killer and bodypart to the chat when a player dies.<br />
<syntaxhighlight lang="lua"><br />
-- register player_Wasted as a handler for onPlayerWasted<br />
function player_Wasted ( ammo, attacker, weapon, bodypart )<br />
-- if there was an attacker<br />
if ( attacker ) then<br />
-- we declare our variable outside the following checks<br />
local tempString<br />
-- if the element that killed him was a player,<br />
if ( getElementType ( attacker ) == "player" ) then<br />
-- put the attacker, victim and weapon info in the string<br />
tempString = getPlayerName ( attacker ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")"<br />
-- else, if it was a vehicle,<br />
elseif ( getElementType ( attacker ) == "vehicle" ) then<br />
-- we'll get the name from the attacker vehicle's driver<br />
local tempString = getPlayerName ( getVehicleController ( attacker ) ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")"<br />
end<br />
-- if the victim was shot in the head, append a special message<br />
if ( bodypart == 9 ) then<br />
tempString = tempString.." (HEADSHOT!)"<br />
-- else, just append the bodypart name<br />
else<br />
tempString = tempString.." ("..getBodyPartName ( bodypart )..")"<br />
end<br />
-- display the message<br />
outputChatBox ( tempString )<br />
-- if there was no attacker,<br />
else<br />
-- output a death message without attacker info<br />
outputChatBox ( getPlayerName ( source ).." died. ("..getWeaponNameFromID ( weapon )..") ("..getBodyPartName ( bodypart )..")" )<br />
end<br />
end<br />
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )<br />
</syntaxhighlight><br />
<br />
<br />
And another example, this will spawn you in the middle of GTA SA world (x=0, y=0, z=3) after 2 seconds of your death<br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "onPlayerWasted", getRootElement( ),<br />
function()<br />
setTimer( spawnPlayer, 2000, 1, source, 0, 0, 3 )<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
{{See also/Server event|Player events}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:World_functions&diff=38218Template:World functions2014-01-09T16:47:14Z<p>Remi-X: Added getMinuteDuration.</p>
<hr />
<div>*[[areTrafficLightsLocked]]<br />
*[[getCloudsEnabled]]<br />
*[[getGameSpeed]]<br />
*[[getGravity]]<br />
*[[getHeatHaze]]<br />
*[[getJetpackMaxHeight]]<br />
*[[getMinuteDuration]]<br />
*[[getSkyGradient]]<br />
*[[getTime]]<br />
*[[getTrafficLightState]]<br />
*[[getWeather]]<br />
*[[getZoneName]]<br />
*[[isGarageOpen]]<br />
*[[resetSkyGradient]]<br />
*[[resetHeatHaze]]<br />
*[[setCloudsEnabled]]<br />
*[[setGameSpeed]]<br />
*[[setGarageOpen]]<br />
*[[setGravity]]<br />
*[[setHeatHaze]]<br />
*[[setMinuteDuration]]<br />
*[[setSkyGradient]]<br />
*[[setTime]]<br />
*[[setTrafficLightState]]<br />
*[[setTrafficLightsLocked]]<br />
*[[setWeather]]<br />
*[[setWeatherBlended]]<br />
*[[setInteriorSoundsEnabled]]<br />
*[[getInteriorSoundsEnabled]]<br />
*[[setRainLevel]]<br />
*[[getRainLevel]]<br />
*[[resetRainLevel]]<br />
*[[setSunSize]]<br />
*[[getSunSize]]<br />
*[[resetSunSize]]<br />
*[[setSunColor]]<br />
*[[getSunColor]]<br />
*[[resetSunColor]]<br />
*[[setWindVelocity]]<br />
*[[getWindVelocity]]<br />
*[[resetWindVelocity]]<br />
*[[setFarClipDistance]]<br />
*[[getFarClipDistance]]<br />
*[[resetFarClipDistance]]<br />
*[[setFogDistance]]<br />
*[[getFogDistance]]<br />
*[[resetFogDistance]]<br />
*[[removeWorldModel]]<br />
*[[restoreWorldModel]]<br />
*[[restoreAllWorldModels]]<br />
*[[setOcclusionsEnabled]]<br />
*[[getOcclusionsEnabled]]<br />
{{New feature/item|3.0132|1.3.1|4352|<br />
*[[setJetpackWeaponEnabled]]<br />
*[[getJetpackWeaponEnabled]]<br />
}}<br />
{{New feature/item|3.0132|1.3.1|5000|<br />
*[[setAircraftMaxVelocity]]<br />
*[[getAircraftMaxVelocity]]<br />
}}<br />
{{New feature/item|3.0132|1.3.1|5063|<br />
* [[setMoonSize]]<br />
* [[getMoonSize]]<br />
* [[resetMoonSize]]<br />
}}<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=GetMinuteDuration&diff=38217GetMinuteDuration2014-01-09T16:44:31Z<p>Remi-X: wups</p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
Tells you how long an ingame minute takes in real-world milliseconds. The default GTA value is 1000.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int getMinuteDuration ( )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
''None''<br />
<br />
===Returns===<br />
Returns the number of real-world milliseconds that go in an ingame minute.<br />
<br />
==See Also==<br />
{{World functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=GetMinuteDuration&diff=38216GetMinuteDuration2014-01-09T16:43:10Z<p>Remi-X: This function is also available serverside.</p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
Tells you how long an ingame minute takes in real-world milliseconds. The default GTA value is 1000.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int getMinuteDuration ( )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
''None''<br />
<br />
===Returns===<br />
Returns the number of real-world milliseconds that go in an ingame minute.<br />
<br />
==See Also==<br />
{{Client_world_functions}}<br />
{{Server_world_functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&diff=38215Scripting Introduction2014-01-09T16:39:56Z<p>Remi-X: Sublime Text ftw</p>
<hr />
<div>Resources are a key part of MTA. A resource is essentially a folder or zip file that contains a collection of files, plus a meta file that describes to the server how the resource should be loaded and what files it does contain. A resource can be seen as being partly equivalent to a program running in an operating system - it can be started and stopped, and multiple resources can run at once.<br />
<br />
Everything that has to do with scripting happens in resources, what a resource does defines if it is a gamemode, a map or anything else. MTA comes with resources that you can optionally use in your gamemodes, such as maplimits to keep playings within a playing area or deathpickups to create weapon pickups.<br />
{{tip|Your first step to begin Lua scripting should be using an Lua editor. This makes scripting much easier. We recommend [http://www.sublimetext.com/ Sublime Text], [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] or [http://luaedit.sourceforge.net/ LuaEdit]. There is also an unofficial [[MTASE|MTA Script Editor]] (in work-in-progress state) that you can test out.}}<br />
<br />
==Creating a working script==<br />
We will first learn how to make a basic script that lets the player walk around in the city, step by step.<br />
===Where are all the scripts?===<br />
Let's take a look at the script's file structure. Go to your MTA Server folder, and follow the path below:<br />
<br />
server/mods/deathmatch/resources/<br />
<br />
You will see a lot of .zip files, which are the packaged sample scripts shipped with MTA. Each file is a "resource", and they will all be unzipped and loaded by the server when it starts. To create your own resource, simply make a folder with your preferred name. We'll use "myserver" for this tutorial.<br />
<br />
Now you should be under this directory: <br />
<br />
server/mods/deathmatch/resources/myserver/<br />
<br />
===Identifying your resource===<br />
In order to let the server know what's in the resource, a ''meta.xml'' file must be created to list the resource's content. It must be located in the resource's root directory, which is the "myserver" folder in our case. So create a text file and name it "meta.xml", and open it with notepad.<br />
<br />
Enter the following codes in the ''meta.xml'' file:<br />
<syntaxhighlight lang="xml"><br />
<meta><br />
<info author="YourName" type="gamemode" name="My Server" description="My first MTA server" /><br />
<script src="script.lua" /><br />
</meta><br />
</syntaxhighlight><br />
In the ''<info />'' tag, there's a "type" field which indicates that the resource is a ''gamemode'' instead of a regular include or a ''map'', which will be explained later. A gamemode is what you need to make a stand-alone server. <br />
<br />
The ''<script />'' tag indicates the script files contained in the resource, which we will create next.<br />
===Creating a simple script===<br />
Note that in the ''<script />'' tag above, the .lua file is not under another directory. Therefore we'll create the file in the same folder as meta.xml. Now you can copy and paste the following code into script.lua:<br />
<syntaxhighlight lang="lua"><br />
local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10<br />
function joinHandler()<br />
spawnPlayer(source, spawnX, spawnY, spawnZ)<br />
fadeCamera(source, true)<br />
setCameraTarget(source, source)<br />
outputChatBox("Welcome to My Server", source)<br />
end<br />
addEventHandler("onPlayerJoin", getRootElement(), joinHandler)<br />
</syntaxhighlight><br />
The script will spawn you at the coordinate (x, y, z) specified above, when you join the game. Note that the ''fadeCamera'' function must be used or the screen will be black. Also, in releases after DP2, you need to set the camera target (otherwise all the player will see is blue sky).<br />
<br />
The '''source''' variable indicates who triggered the event. Since a player has joined when the code is triggered, you use this variable to look which has joined. So it'll spawn that player instead of everyone or a random person.<br />
<br />
If we have a closer look on [[addEventHandler]], you can see 3 things: 'onPlayerJoin', which indicates when it's triggered. getRootElement(), which shows by what/who it can be triggered. (getRootElement() is everything/everyone) And joinHandler, which indicates the function that has to be triggered after the event is triggered. Other details will be explained later in another example, now let's just run the server and try it out!<br />
<br />
===Running the script===<br />
To get the server started, simply run the executable under the server/ directory. A list of server stats will be shown first; note the port number, which you'll need when joining the game. Then the server loads all the resources under the mods/deathmatch/resources/ directory, and then "ready to accept connections!"<br />
<br />
Before you connect to the server, you must run the gamemode. Type "start myserver" and press Enter. The server will start the gamemode you just created, and will also show any errors and warnings from this point on. Now you can start the MTA client, and "Quick Connect" using the IP address of your server and the port number you saw earlier. If all goes well, after a few seconds your character will be walking on the streets of Los Santos.<br />
<br />
Next we'll add a command to your script that players can use to spawn a vehicle beside their position. You may skip it and check out more advanced scripting with the [[Map manager|Map Manager]], which continues this tutorial. Another branch from this tutorial is [[Introduction to Scripting GUI]], you may follow it to see how Graphical User Interface in MTA is drawn and scripted.<br />
<br />
==Creating a simple command==<br />
Let's go back to the content of the ''script.lua'' file. As mentioned above, we want to provide a command to create a vehicle beside your current position in the game. Firstly we need to create a function we want to call and a command handler that creates the command the player will be able to enter in the console.<br />
<br />
<syntaxhighlight lang="lua"><br />
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel<br />
function createVehicleForPlayer(thePlayer, command, vehicleModel)<br />
-- create a vehicle and stuff<br />
end<br />
<br />
-- create a command handler<br />
addCommandHandler("createvehicle", createVehicleForPlayer)<br />
</syntaxhighlight><br />
''Note: Function names are clickable in code examples on the wiki and linked to the functions' documentation.''<br />
<br />
====About command handlers====<br />
The first argument of [[addCommandHandler]] is the name of the command the player will be able to enter, the second argument is the function this will call, in this case ''createVehicleForPlayer''.<br />
<br />
If you have already experience in scripting, you will know that you call a function like this:<br />
<syntaxhighlight lang="lua"><br />
functionName(argument1, argument2, argument3, ..)<br />
</syntaxhighlight><br />
<syntaxhighlight lang="lua"><br />
functionName(thePlayer, commandName, argument3, ..)<br />
</syntaxhighlight><br />
If we have a closer look on the lower example above, we can see argument1 is thePlayer and argument2 the commandName. thePlayer is simply the one who typed the command, so whatever you call it, the variable will contain the player who activated the command. commandName is simply the command they typed. So if they typed "/greet", this argument will contain "greet". Argument 3 is something extra the player typed, you'll learn it a little bit further in the tutorial. Never forget that the first 2 arguments are standard arguments, but you can name them to anything you want.<br />
<br />
We called the [[addCommandHandler]] function this way already and since ''createVehicleForPlayer'' is a function too, it can be called that way as well. But we are using a command handler for that, which calls it in a similiar manner, internally.<br />
<br />
For example: Someone types "createvehicle 468" ingame in the console to spawn a Sanchez, the command handler calls the createVehicleForPlayer function, as '''if''' we would have this line of code in the script:<br />
<syntaxhighlight lang="lua"><br />
createVehicleForPlayer(thePlayer,"createvehicle","468") -- thePlayer is the player element of the player who entered the command<br />
</syntaxhighlight><br />
As we can see, it provides several parameters: the player who called the command, the command he entered and whatever text he had after that, in this case "468" as vehicle id for the Sanchez. The first two parameters are the same with all command handlers, which you can read on the [[addEventHandler]] page. For this fact, you always have to define at least those two parameters to use any after that (for example to process text that was entered after the command, like in our example the vehicle model id).<br />
<br />
''Note: You have to add the command handler AFTER you defined the handler function, else it can't find it. The order of execution matters.''<br />
<br />
====Writing the function====<br />
In order to fill the function we created, we need to think about what we have to do:<br />
* Get the players position, so we know where to spawn the vehicle (we want it to appear right beside the player)<br />
* Calculate the position we want to spawn the vehicle at (we don't want it to appear in the player)<br />
* Spawn the vehicle<br />
* Check if it has been spawned successfully, or output a message<br />
<br />
In order to achieve our goals, we have to use several functions. To find function we need to use, we should visit the [[Scripting Functions|Server Functions List]]. First we need a function to get the players position. Since players are Elements, we first jump to the '''Element functions''' where we find the [[getElementPosition]] function. By clicking on the function name in the list, you get to the function description. There we can see the syntax, what it returns and usually an example. The syntax shows us what arguments we can or have to submit.<br />
<br />
For [[getElementPosition]], the syntax is:<br />
<syntaxhighlight lang="lua"><br />
float, float, float getElementPosition ( element theElement )<br />
</syntaxhighlight><br />
<br />
The three ''float'' in front of the function name are the return type. In this case it means the function returns three floating point numbers. (x, y and z) Within the parentheses, you can see what arguments you have to submit. In this case only the element whose position you want to get, which is the player in our example.<br />
<br />
<syntaxhighlight lang="lua"><br />
function createVehicleForPlayer(thePlayer, command, vehicleModel)<br />
-- get the position and put it in the x,y,z variables<br />
-- (local means, the variables only exist in the current scope, in this case, the function)<br />
local x,y,z = getElementPosition(thePlayer)<br />
end<br />
</syntaxhighlight><br />
<br />
Next we want to ensure that the vehicle won't spawn directly in the player, so we add a few units to the ''x'' variable, which will make it spawn east from the player.<br />
<br />
<syntaxhighlight lang="lua"><br />
function createVehicleForPlayer(thePlayer, command, vehicleModel)<br />
local x,y,z = getElementPosition(thePlayer) -- get the position of the player<br />
x = x + 5 -- add 5 units to the x position<br />
end<br />
</syntaxhighlight><br />
<br />
Now we need another function, one to spawn a vehicle. We once again search for it on the [[Scripting Functions|Server Functions List]], this time - since we are talking about vehicles - in the '''Vehicle functions''' section, where we will choose [[createVehicle]]. In this function's syntax, we only have one return type (which is more common), a vehicle element that points to the vehicle we just created. Also, we see that some arguments are enclosed within [ ] which means that those are optional.<br />
<br />
We already have all arguments we need for [[createVehicle]] in our function: The position we just calculated in the ''x,y,z'' variables and the model id that we provided through the command ("createvehicle 468") and can access in the function as ''vehicleModel'' variable.<br />
<br />
<syntaxhighlight lang="lua"><br />
function createVehicleForPlayer(thePlayer, command, vehicleModel)<br />
local x,y,z = getElementPosition(thePlayer) -- get the position of the player<br />
x = x + 5 -- add 5 units to the x position<br />
-- create the vehicle and store the returned vehicle element in the ''createdVehicle'' variable<br />
local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)<br />
end<br />
</syntaxhighlight><br />
<br />
Of course this code can be improved in many ways, but at least we want to add a check whether the vehicle was created successfully or not. As we can read on the [[createVehicle]] page under '''Returns''', the function returns ''false'' when it was unable to create the vehicle. Thus, we check the value of the ''createVehicle'' variable.<br />
<br />
Now we have our complete script:<br />
<syntaxhighlight lang="lua"><br />
function createVehicleForPlayer(thePlayer, command, vehicleModel)<br />
local x,y,z = getElementPosition(thePlayer) -- get the position of the player<br />
x = x + 5 -- add 5 units to the x position<br />
local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)<br />
-- check if the return value was ''false''<br />
if (createdVehicle == false) then<br />
-- if so, output a message to the chatbox, but only to this player.<br />
outputChatBox("Failed to create vehicle.",thePlayer)<br />
end<br />
end<br />
addCommandHandler("createvehicle", createVehicleForPlayer)<br />
</syntaxhighlight><br />
<br />
As you can see, we introduced another function with [[outputChatBox]]. By now, you should be able to explore the function's documentation page yourself. For more advanced scripting, please check out the [[Map manager|Map Manager]].<br />
<br />
==What you need to know==<br />
You already read some things about resources, command handlers and finding functions in the documentation in the first paragraph, but there is much more to learn. This section will give you a rather short overview over some of these things, while linking to related pages if possible.<br />
===Clientside and Serverside scripts===<br />
You may have already noticed these or similiar terms (Server/Client) somewhere on this wiki, mostly in conjunction with functions. MTA not only supports scripts that run on the server and provide commands (like the one we wrote above) or other features, but also scripts that run on the MTA client the players use to connect to the server. The reason for this is, that some features MTA provides have to be clientside (like a GUI - Graphical User Interface), others should be because they work better and still others are better off to be serverside or just don't work clientside.<br />
<br />
Most scripts you will make (gamemodes, maps) will probably be serverside, like the one we wrote in the first section. If you run into something that can't be solved serverside, you will probably have to make it clientside. For a clientside script for example, you would create a ordinary script file (for example called ''client.lua'') and specify it in the meta.xml, like this:<br />
<syntaxhighlight lang="xml"><br />
<script src="client.lua" type="client" /><br />
</syntaxhighlight><br />
The ''type'' attribute defaults to 'server', so you only need to specify it for clientside scripts. When you do this, the clientside script will be downloaded to the player's computer once he connects to the server. Read more about [[Client side scripts]].<br />
<br />
===More complex resources===<br />
The previous section showed briefly how to add clientside scripts to the resource, but there is also much more possible. As mentioned at the very top of this page, resources can be pretty much everything. Their purpose is defined by what they do. Let's have some theoretical resources, by looking at the files it contains, the ''meta.xml'' and what they might do:<br />
<br />
====First example - A utility script====<br />
<syntaxhighlight lang="xml"><br />
/admin_commands<br />
/meta.xml<br />
/commands.lua<br />
/client.lua<br />
</syntaxhighlight><br />
<syntaxhighlight lang="xml"><br />
<meta><br />
<info author="Someguy" description="admin commands" /><br />
<script src="commands.lua" /><br />
<script src="client.lua" type="client" /><br />
</meta><br />
</syntaxhighlight><br />
<br />
* The ''commands.lua'' provides some admin commands, like banning a player, muting or something else that can be used to admin the server<br />
* The ''client.lua'' provides a GUI to be able to perform the mentioned actions easily<br />
<br />
This example might be running all the time (maybe even auto-started when the server starts) as it's useful during the whole gaming experience and also wont interfere with the gameplay, unless an admin decides to take some action of course.<br />
<br />
====Second example - A gamemode====<br />
<syntaxhighlight lang="xml"><br />
/counterstrike<br />
/meta.xml<br />
/counterstrike.lua<br />
/buymenu.lua<br />
</syntaxhighlight><br />
<syntaxhighlight lang="xml"><br />
<meta><br />
<info author="Someguy" description="Counterstrike remake" type="gamemode" /><br />
<script src="counterstrike.lua" /><br />
<script src="buymenu.lua" type="client" /><br />
</meta><br />
</syntaxhighlight><br />
<br />
* The ''counterstrike.lua'' contains similiar to the following features:<br />
** Let players choose their team and spawn them<br />
** Provide them with weapons, targets and instructions (maybe read from a Map, see below)<br />
** Define the game's rules, e.g. when does the round end, what happens when a player dies<br />
** .. and maybe some more<br />
* The ''buymenu.lua'' is a clientside script and creates a menu to buy weapons<br />
<br />
This example can be called a gamemode, since it not only intereferes with the gameplay, but actually defines the rules of it. The ''type'' attribute indicates that this example works with the [[Map manager]], yet another resource that was written by the QA Team to manage gamemodes and map loading. It is highly recommended that you base your gamemodes on the techniques it provides.<br />
<br />
This also means that the gamemode probably won't run without a map. Gamemodes should always be as generic as possible. An example for a map is stated in the next example.<br />
<br />
====Third example - A Map====<br />
<syntaxhighlight lang="xml"><br />
/cs-airport<br />
/meta.xml<br />
/airport.map<br />
/airport.lua<br />
</syntaxhighlight><br />
<syntaxhighlight lang="xml"><br />
<meta><br />
<info author="Someguy" description="Counterstrike airport map" type="map" gamemodes="counterstrike" /><br />
<map src="airport.map" /><br />
<script src="airport.lua" /><br />
</meta><br />
</syntaxhighlight><br />
<br />
* The ''airport.map'' in a XML file that provides information about the map to the gamemode, these may include:<br />
** Where the players should spawn, with what weapons, what teams there are<br />
** What the targets are<br />
** Weather, World Time, Timelimit<br />
** Provide vehicles<br />
* The ''airport.lua'' might contain map-specific features, that may include:<br />
** Opening some door/make something explode when something specific happens<br />
** Create or move some custom objects, or manipulate objects that are created through the .map file<br />
** .. anything else map-specific you can think of<br />
<br />
As you can see, the ''type'' attribute changed to 'map', telling the [[Map manager]] that this resource is a map, while the ''gamemodes'' attribute tells it for which gamemodes this map is valid, in this case the gamemode from the above example.<br />
What may come as a surprise is that there is also a script in the Map resource. Of course this is not necessarily needed in a map, but opens a wide range of possibilities for map makers to create their own world within the rules of the gamemode they create it for.<br />
<br />
The ''airport.map'' file might look similiar to this:<br />
<syntaxhighlight lang="xml"><br />
<map mode="deathmatch" version="1.0"><br />
<terrorists><br />
<spawnpoint posX="2332.23" posY="-12232.33" posZ="4.42223" skins="23-40" /><br />
</terrorists><br />
<counterterrorists><br />
<spawnpoint posX="2334.23443" posY="-12300.233" posZ="10.2344" skins="40-50" /><br />
</counterterrorists><br />
<br />
<bomb posX="23342.23" posY="" posZ="" /><br />
<br />
<vehicle posX="" posY="" posZ="" model="602" /> <br />
<vehicle posX="" posY="" posZ="" model="603" /> <br />
</map><br />
</syntaxhighlight><br />
<br />
When a gamemode is started with a map, the map resources is automatically started by the mapmanager and the information it contains can be read by the gamemode resource. When the map changes, the current map resource is stopped and the next map resource is started. For a more in-depth explanation and examples of how map resources are utilized in the main script, please visit the [[Writing Gamemodes]] page.<br />
<br />
===Events===<br />
Events are the way MTA tells scripts about things that happen. For example when a player dies, the [[onPlayerWasted]] event is triggered. In order to perform any actions when a player dies, you have to prepare yourself similiar to adding a command handler, as shown in [[#Writing_the_script|the first chapter]].<br />
<br />
This example will output a message with the name of the player who died:<br />
<syntaxhighlight lang="lua"><br />
function playerDied(totalAmmo, killer, killerWeapon, bodypart)<br />
outputChatBox(getPlayerName(source).." died!")<br />
end<br />
addEventHandler("onPlayerWasted",getRootElement(),playerDied)<br />
</syntaxhighlight><br />
<br />
Instead of showing what arguments are needed, the documentation page for Events shows what parameters are passed to the handler function, similiar to the way a [[#About_command_handlers|command handler]] does, just that it is different from event to event. Another important point is the ''source'' variable, that exists in handler functions. It doesn't have to be added to the parameter list of the function, but it still exists. It has a different value from event to event, for player events (as in the example above) it is the player element. As another example, you can take a look at the basic spawning player script in the first section to get an idea how ''source'' is used.<br />
<br />
==Where to go from here==<br />
You should now be familiar with the most basic aspects of MTA scripting and also a bit with the documentation. The [[Main Page]] provides you with links to more information, Tutorials and References that allow a deeper look into the topics you desire to learn about.<br />
{{note|From here we recommend reading the [[debugging]] tutorial. Good debugging skills are an absolute necessity when you are making scripts. We also recommend you to use the [[predefined variables list]] to help you with certain tasks and make scripting easier and faster.}}<br />
'''See also:'''<br />
* [[Advanced Topics]]<br />
[[es:Introducción a la Programación]]<br />
[[it:Introduzione allo scripting]]<br />
[[nl:Scripting_introductie]]<br />
[[pt-br:Introdução ao Scripting]]<br />
[[ru:Scripting Introduction]]<br />
[[ar:مقدمه_في_البرمجه]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Talk:Tocolor&diff=34521Talk:Tocolor2013-01-16T17:29:04Z<p>Remi-X: About this opposite function</p>
<hr />
<div>This opposite function, shoudn't that be an useful function? I suggest moving it to there.<br />
--[[User:Remi-X|Remi-X]] 17:29, 16 January 2013 (UTC)</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Talk:Tocolor&diff=34520Talk:Tocolor2013-01-16T17:28:43Z<p>Remi-X: Created page with "This opposite function, shoudn't that be an useful function? I suggest moving it to there. --~~~~"</p>
<hr />
<div>This opposite function, shoudn't that be an useful function? I suggest moving it to there.<br />
--[[User:Remi-X|Remi-X]] 17:28, 16 January 2013 (UTC)</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Changes_in_1.3&diff=34519Changes in 1.32013-01-16T17:23:21Z<p>Remi-X: There we go.</p>
<hr />
<div>{{Note|For changes between 1.3 and 1.3.1, see [[Changes in 1.3.1]]}}<br />
==Main Additions==<br />
* Added functions to remove and re-add parts of the San Andreas world<br />
<br />
==Client==<br />
<br />
===New Functions===<br />
* Added [[removeWorldModel]] (Available in 1.2.0-3591)<br />
* Added [[restoreWorldModel]] (Available in 1.2.0-3591)<br />
* Added [[restoreAllWorldModels]] (Available in 1.2.0-3591)<br />
* Added [[getBirdsEnabled]]<br />
* Added [[setBirdsEnabled]]<br />
* Added [[setOcclusionsEnabled]]<br />
<br />
===New Events===<br />
* Added [[onClientVehicleCollision]]<br />
<br />
===Changes===<br />
* Online players in the bottom right of the server browser<br />
* New "Lighter Black" skin for CEGUI from Aibo<br />
<br />
<br />
===Bug Fixes===<br />
* Fixed custom vehicle collisions not loading<br />
* Fixed custom model textures not loading sometimes<br />
* onVehicleExplode triggers for RC Vehicles now<br />
* Projectiles fire at a normal rate<br />
* Fixed spider CJ<br />
* Speed up in entity collision detection client side<br />
* Fixed the glitchy GTASA animation when you block+sprint (where hands are repeatedly raised and lowered)<br />
* Fixed Objects scaled with setObjectScale aren't rendered when the unscaled bounding box goes off-screen<br />
* Fixed Always falling off bikes and motorbikes<br />
* Fixed Some vehicles become indestructible when a certain door is open<br />
* Possible fix for client freezing/crashing after playing a long while<br />
* Markers in interiors not appearing<br />
* Chineese/Japanese/Korean input fixed<br />
<br />
==Server==<br />
<br />
===New Functions===<br />
* Added [[takePlayerScreenShot]]<br />
* Added [[setOcclusionsEnabled]]<br />
* Added [[removeWorldModel]] (Available in 1.2.0-3624)<br />
* Added [[restoreWorldModel]] (Available in 1.2.0-3624)<br />
* Added [[restoreAllWorldModels]] (Available in 1.2.0-3624)<br />
<br />
===New Events===<br />
* Added [[onPlayerScreenShot]]<br />
<br />
===Changes===<br />
* None yet<br />
<br />
===Bug Fixes===<br />
* Fixed Map download breaking often on large transfers<br />
<br />
==Resources==<br />
* Admin: added anti nick change spam option<br />
* Freeroam: added chat spam and repeat message option<br />
* Freeroam: added location bookmarking<br />
<br />
==Editor==<br />
* Added LOD information to aid removing LOD's<br />
<br />
[[ru:Changes in 1.3]]<br />
[[pt-br:Novidades na versão 1.3]]<br />
[[es:Cambios en la versión 1.3]]<br />
<br />
[[Category:Changelog]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Changes_in_1.3&diff=34518Changes in 1.32013-01-16T17:21:54Z<p>Remi-X: Undo revision 34515 by T9 (talk) -- Fucking arabs.</p>
<hr />
<div>{{Note|For changes between 1.3 and 1.3.1, see [[Changes in 1.3.1]]}}<br />
==Main Additions==<br />
* Added functions to remove and re-add parts of the San Andreas world<br />
<br />
==Client==<br />
<br />
===New Functions===<br />
* Added [[removeWorldModel]] (Available in 1.2.0-3591)<br />
* Added [[restoreWorldModel]] (Available in 1.2.0-3591)<br />
* Added [[restoreAllWorldModels]] (Available in 1.2.0-3591)<br />
* Added [[getBirdsEnabled]]<br />
* Added [[setBirdsEnabled]]<br />
* Added [[setOcclusionsEnabled]]<br />
<br />
===New Events===<br />
* Added [[onClientVehicleCollision]]<br />
<br />
===التغييرات===<br />
* الاون لاين لاعبين في أسفل يمين المتصفح الخادم<br />
* جديد : تطوير شخصية CEGUI<br />
<br />
===Bug Fixes===<br />
* Fixed custom vehicle collisions not loading<br />
* Fixed custom model textures not loading sometimes<br />
* onVehicleExplode triggers for RC Vehicles now<br />
* Projectiles fire at a normal rate<br />
* Fixed spider CJ<br />
* Speed up in entity collision detection client side<br />
* Fixed the glitchy GTASA animation when you block+sprint (where hands are repeatedly raised and lowered)<br />
* Fixed Objects scaled with setObjectScale aren't rendered when the unscaled bounding box goes off-screen<br />
* Fixed Always falling off bikes and motorbikes<br />
* Fixed Some vehicles become indestructible when a certain door is open<br />
* Possible fix for client freezing/crashing after playing a long while<br />
* Markers in interiors not appearing<br />
* Chineese/Japanese/Korean input fixed<br />
<br />
==Server==<br />
<br />
===New Functions===<br />
* Added [[takePlayerScreenShot]]<br />
* Added [[setOcclusionsEnabled]]<br />
* Added [[removeWorldModel]] (Available in 1.2.0-3624)<br />
* Added [[restoreWorldModel]] (Available in 1.2.0-3624)<br />
* Added [[restoreAllWorldModels]] (Available in 1.2.0-3624)<br />
<br />
===New Events===<br />
* Added [[onPlayerScreenShot]]<br />
<br />
===Changes===<br />
* None yet<br />
<br />
===اصلاح===<br />
* تحميل خريطة ثابتة كسر في كثير من الأحيان على التحويلات الكبيرة<br />
<br />
==Resources==<br />
* Admin: added anti nick change spam option<br />
* Freeroam: added chat spam and repeat message option<br />
* Freeroam: added location bookmarking<br />
<br />
==Editor==<br />
* Added LOD information to aid removing LOD's<br />
<br />
[[ru:Changes in 1.3]]<br />
[[pt-br:Novidades na versão 1.3]]<br />
[[es:Cambios en la versión 1.3]]<br />
<br />
[[Category:Changelog]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&diff=34331Template:Useful Functions2012-12-25T14:06:00Z<p>Remi-X: </p>
<hr />
<div>*[[callClientFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to call any clientside function from the server's side.</span><br />
*[[callServerFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to call any server-side function from the client's side.</span><br />
*[[centerWindow]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function center the window in any resolution.</span><br />
*[[Check]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if it's arguments are of the right types and calls the error-function if one isn't.</span><br />
*[[coroutine.resume]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Fix for hidden coroutine error messages</span><br />
*[[dxDrawColorText]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a dx text with #RRGGBB color codes support.</span><br />
*[[dxDrawGifImage]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function simulates the effect of a GIF image by using image sprites.</span><br />
*[[dxDrawImage3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D image.</span><br />
*[[dxDrawRectangle3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D rectangle.</span><br />
*[[dxGetFontSizeFromHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculate a font size from given height for dxDraw.</span><br />
*[[dxGetRealFontHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Accurately measures the pixel height of a font.</span><br />
*[[findRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Takes two points and returns the direction from point A to point B.</span><br />
*[[FormatDate]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Formats a date on the basis of a format string and returns it.</span><br />
*[[GenerateString]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» With this function you can generate a random string with any characters.</span><br />
*[[getAge]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculates the age of a birthday.</span><br />
*[[getAlivePlayers (Client)|getAlivePlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns all the alive players by a client side, so you can store them into a Gridlist or something like that, faster.</span><br />
*[[getAlivePlayersInTeam]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the alive players in a team.</span><br />
*[[getCursorMoveOn]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks in which way the cursor is currently moving.</span><br />
*[[getDistanceBetweenPointAndSegment2D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.</span><br />
*[[getElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get element speed in kph or mph units.</span><br />
*[[getJetpackWeaponsEnabled]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of enabled weapons usable on a jetpack.</span><br />
*[[getOffsetFromXYZ]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.</span><br />
*[[getOnlineAdmins]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function will give the online admins.</span><br />
*[[getOnlineStaff]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns all online staff, names separated by two spaces.</span><br />
*[[getPlayerFromNamePart]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get player From his Name part.</span><br />
*[[getPlayersInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gets all the players in a photograph.</span><br />
*[[getPointFromDistanceRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Finds a point based on a starting point, direction and distance.</span><br />
*[[getResourceSettings]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the resource settings.</span><br />
*[[getTimestamp]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» With this function you can get the UNIX timestamp.</span><br />
*[[getXMLNodes]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns all children of a node</span><br />
*[[guiComboBoxAdjustHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Adjusts the combobox to have a correct height.</span><br />
*[[guiEditSetActive]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Puts the caret of an editbox to the gived position.</span><br />
*[[IfElse]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns one of two values based on a boolean expression.</span><br />
*[[isElementInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element was in the player's camera picture.</span><br />
*[[isElementInRange]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.</span><br />
*[[IsElementMoving]]<span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element is moving.</span><br />
*[[isLeapYear]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Checks if the given year is a leap year.</span><br />
*[[isVehicleOnRoof]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether vehicle is on roof.</span><br />
*[[iterElements]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).</span><br />
*[[math.neg]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the negative value of a number.</span><br />
*[[math.round]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Rounds a number whereas the number of decimals to keep and the method may be set.</span><br />
*[[multi_check]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks one element to many, handy and clean.</span><br />
*[[onVehicleWeaponFire]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.</span><br />
*[[setElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to set moving element speed in kph or mph units.</span><br />
*[[setTableProtected]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Protects a table and makes it read-only.</span><br />
*[[setVehicleGravityPoint]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This clientside function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.</span><br />
*[[string.count]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function counts a text from a text.</span><br />
*[[string.explode]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function splits a string at a given separator pattern and returns a table with the pieces.</span><br />
*[[switch]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allow the value of a variable or expression to control the flow of program execution via a multiway branch.</span><br />
*[[table.copy]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function copies a whole table and all the tables in that table.</span><br />
*[[table.condition]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function check if both tables is equal. </span><br />
*[[table.empty]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function check is empty table or not.</span><br />
*[[table.map]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.</span><br />
*[[table.random]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function retrieves a random variable from a table.</span><br />
*[[table.size]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Finds the absolute size of a table.</span><br />
*[[var dump]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function outputs information about one or more variables using outputConsole()</span><br />
*[[RGBToHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a string representing the color in hexadecimal.</span><br />
*[[toHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.</span><br />
*[[wavelengthToRGBA]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a phisical wavelength of light to a RGBA color.</span><br />
*[[convertNumber]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts large numbers and adds commas to it. (Example: 100000 -> 100,000)</span><br />
[[Category:Useful Functions]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=GuiComboBoxAdjustHeight&diff=34182GuiComboBoxAdjustHeight2012-12-05T20:54:52Z<p>Remi-X: ups fuck me</p>
<hr />
<div>{{Useful Function}}<br />
__NOTOC__<br />
This function adjusts your combobox to the correct height. Small comboboxes do not show a list when clicking; their list height is based on element height too.<br><br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">string guiComboBoxAdjustHeight ( element combobox, int itemcount )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''combobox''': The gui-combobox element.<br />
* '''itemcount''': The amount of listitems your combobox has.<br />
<br />
===Returns===<br />
Returns true if there were no errors, false otherwise.<br />
<br />
==Code==<br />
<section name="Clientside script" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
function guiComboBoxAdjustHeight ( combobox, itemcount )<br />
if getElementType ( combobox ) ~= "gui-combobox" or type ( itemcount ) ~= "number" then error ( "Invalid arguments @ 'guiComboBoxAdjustHeight'", 2 ) end<br />
local width = guiGetSize ( combobox, false )<br />
return guiSetSize ( combobox, width, ( itemcount * 20 ) + 20, false )<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
==Example==<br />
No example >:(<br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=GuiCreateComboBox&diff=34181GuiCreateComboBox2012-12-05T20:48:04Z<p>Remi-X: added a note to GuiComboBoxAdjustHeight</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
This function creates a combobox GUI element, which you can compare to a gridlist with a dropdown feature.<br />
* '''NOTE:''' The height of a combobox must be enough to fit the drop down menu, else the drop down won't appear. See [[guiComboBoxAdjustHeight]] to give your combobox the correct height.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
element guiCreateComboBox ( float x, float y, float width, float height, string caption, bool relative, [ element parent = nil ] )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
[[Image:Gui-combobox.jpg|frame|Example GUI ComboBox.]]<br />
*'''x:''' A float of the 2D x position of the GUI combobox on a player's screen. This is affected by the ''relative'' argument.<br />
*'''y:''' A float of the 2D y position of the GUI combobox on a player's screen. This is affected by the ''relative'' argument.<br />
*'''width:''' A float of the width of the GUI combobox. This is affected by the ''relative'' argument.<br />
*'''height:''' A float of the height of the GUI combobox. This is affected by the ''relative'' argument. Note: height must be enough to fit the drop down menu, else the drop down won't appear.<br />
*'''caption:''' A string for what the title of your combobox will be. This will be shown if no item is selected.<br />
*'''relative:''' This is whether sizes and positioning are relative. If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent.<br />
<br />
===Optional Arguments=== <br />
{{OptionalArg}} <br />
*'''parent:''' This is the parent that the GUI combobox is attached to. If the ''relative'' argument is true, sizes and positioning will be made relative to this parent. If the ''relative'' argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning.<br />
<br />
===Returns===<br />
Returns an element of the created combobox if it was successfully created, false otherwise.<br />
<br />
==Example==<br />
<section name="Client" class="client" show="true"><br />
This example creates a combo box in the center of the screen with all server vehicles on it.<br />
<syntaxhighlight lang="lua">addEventHandler ("onClientResourceStart",resourceRoot,function()<br />
local screenWidth, screenHeight = guiGetScreenSize()<br />
local windowWidth, windowHeight = 200,100<br />
local left = screenWidth/2 - windowWidth/2<br />
local top = screenHeight/2 - windowHeight/2<br />
local vehiclesComboBox = guiCreateComboBox ( left, top, windowWidth,windowHeight, "Vehicle Names", false ) -- We create a combo box.<br />
for index, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do -- We loop through all vehicles.<br />
guiComboBoxAddItem ( vehiclesComboBox, getVehicleName ( vehicle ) ) -- We add the vehicle name to our combo box.<br />
end<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{GUI functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&diff=34180Template:Useful Functions2012-12-05T20:42:52Z<p>Remi-X: </p>
<hr />
<div>*[[callClientFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to call any clientside function from the server's side.</span><br />
*[[callServerFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to call any server-side function from the client's side.</span><br />
*[[centerWindow]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function center the window in any resolution.</span><br />
*[[Check]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if it's arguments are of the right types and calls the error-function if one isn't.</span><br />
*[[coroutine.resume]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Fix for hidden coroutine error messages</span><br />
*[[dxDrawColorText]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a dx text with #RRGGBB color codes support.</span><br />
*[[dxDrawGifImage]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function simulates the effect of a GIF image by using image sprites.</span><br />
*[[dxDrawImage3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D image.</span><br />
*[[dxDrawRectangle3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D rectangle.</span><br />
*[[dxGetFontSizeFromHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculate a font size from given height for dxDraw.</span><br />
*[[dxGetRealFontHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Accurately measures the pixel height of a font.</span><br />
*[[findRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Takes two points and returns the direction from point A to point B.</span><br />
*[[FormatDate]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Formats a date on the basis of a format string and returns it.</span><br />
*[[GenerateString]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» With this function you can generate a random string with any characters.</span><br />
*[[getAge]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculates the age of a birthday.</span><br />
*[[getAlivePlayers (Client)|getAlivePlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns all the alive players by a client side, so you can store them into a Gridlist or something like that, faster.</span><br />
*[[getAlivePlayersInTeam]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the alive players in a team.</span><br />
*[[getCursorMoveOn]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks in which way the cursor is currently moving.</span><br />
*[[getDistanceBetweenPointAndSegment2D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.</span><br />
*[[getElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get element speed in kph or mph units.</span><br />
*[[getJetpackWeaponsEnabled]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of enabled weapons usable on a jetpack.</span><br />
*[[getOffsetFromXYZ]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.</span><br />
*[[getOnlineAdmins]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function will give the online admins.</span><br />
*[[getOnlineStaff]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns all online staff, names separated by two spaces.</span><br />
*[[getPlayerFromNamePart]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get player From his Name part.</span><br />
*[[getPlayersInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gets all the players in a photograph.</span><br />
*[[getPointFromDistanceRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Finds a point based on a starting point, direction and distance.</span><br />
*[[getResourceSettings]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the resource settings.</span><br />
*[[getTimestamp]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» With this function you can get the UNIX timestamp.</span><br />
*[[getXMLNodes]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns all children of a node</span><br />
*[[guiComboBoxAdjustHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Adjusts the combobox to have a correct height.</span><br />
*[[IfElse]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns one of two values based on a boolean expression.</span><br />
*[[isElementInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element was in the player's camera picture.</span><br />
*[[isElementInRange]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.</span><br />
*[[IsElementMoving]]<span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element is moving.</span><br />
*[[isLeapYear]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Checks if the given year is a leap year.</span><br />
*[[isVehicleOnRoof]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether vehicle is on roof.</span><br />
*[[iterElements]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).</span><br />
*[[math.neg]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the negative value of a number.</span><br />
*[[math.round]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Rounds a number whereas the number of decimals to keep and the method may be set.</span><br />
*[[multi_check]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks one element to many, handy and clean.</span><br />
*[[onVehicleWeaponFire]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.</span><br />
*[[setElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to set moving element speed in kph or mph units.</span><br />
*[[setTableProtected]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Protects a table and makes it read-only.</span><br />
*[[setVehicleGravityPoint]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This clientside function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.</span><br />
*[[string.count]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function counts a text from a text.</span><br />
*[[string.explode]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function splits a string at a given separator pattern and returns a table with the pieces.</span><br />
*[[switch]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allow the value of a variable or expression to control the flow of program execution via a multiway branch.</span><br />
*[[table.copy]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function copies a whole table and all the tables in that table.</span><br />
*[[table.condition]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function check if both tables is equal. </span><br />
*[[table.empty]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function check is empty table or not.</span><br />
*[[table.map]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.</span><br />
*[[table.random]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function retrieves a random variable from a table.</span><br />
*[[table.size]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Finds the absolute size of a table.</span><br />
*[[var dump]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function outputs information about one or more variables using outputConsole()</span><br />
*[[RGBToHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a string representing the color in hexadecimal.</span><br />
*[[toHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.</span><br />
*[[wavelengthToRGBA]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a phisical wavelength of light to a RGBA color.</span><br />
*[[convertNumber]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts large numbers and adds commas to it. (Example: 100000 -> 100,000)</span><br />
[[Category:Useful Functions]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=GuiComboBoxAdjustHeight&diff=34179GuiComboBoxAdjustHeight2012-12-05T20:41:05Z<p>Remi-X: why not adding this uh</p>
<hr />
<div>{{Useful Function}}<br />
__NOTOC__<br />
This function adjusts your combobox to the correct height. Small comboboxes do not show a list when clicking; their list height is based on element height too.<br><br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">string guiComboBoxAdjustHeight ( element combobox, int itemcount )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''combobox''': The gui-combobox element.<br />
* '''itemcount''': The amount of listitems your combobox has.<br />
<br />
===Returns===<br />
Returns true if there were no errors, false otherwise.<br />
<br />
==Code==<br />
<section name="Clientside script" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
function guiComboBoxAdjustHeight ( combobox, itemcount )<br />
if type ( combobox ) ~= "gui-combobox" or type ( itemcount ) ~= "number" then error ( "Invalid arguments @ 'guiComboBoxAdjustHeight'", 2 ) end<br />
local width = guiGetSize ( combobox, false )<br />
return guiSetSize ( combobox, width, ( itemcount * 20 ) + 20, false )<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
==Example==<br />
No example >:(<br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=GuiGridListSetColumnWidth&diff=30564GuiGridListSetColumnWidth2012-05-09T14:18:00Z<p>Remi-X: damned code tag doesnt like html comments :o</p>
<hr />
<div>{{Client function}}<br />
__NOTOC__ <br />
This allows you to set the width of an existing column in a gridlist.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool guiGridListSetColumnWidth ( element gridList, int columnIndex, number width, bool relative )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''gridList:''' The grid list you want to add a column to<br />
*'''columnIndex:''' Column ID of the size you want to change<br />
*'''width:''' A float or integer of the width of the column depending on the '''relative''' argument.<br />
*'''relative:''' A boolean defining whether '''width''' measurements will be relative to the Gridlist size, or absolute pixels.<br />
<br />
===Returns===<br />
Returns ''true'' if the gridlist column width was successfully set, ''false'' if bad arguments were given.<br />
<br />
==Example== <br />
This example creates a gridlist with one column that is too small to display. After the column has been successfully created, we give it a new width so you can see column.<br />
<!-- Why these odd positions? Examples look cleaner with numbers like 250 instead of 249. Dunno whether I should change them.--><br />
<syntaxhighlight lang="lua">local gridlist = guiCreateGridList ( 332, 195, 286, 249, false ) <br />
local column = guiGridListAddColumn ( gridlist, "My column", 0 )<br />
<br />
if column then<br />
guiGridListSetColumnWidth ( gridlist, column, 0.5 )<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=GuiGridListSetColumnWidth&diff=30563GuiGridListSetColumnWidth2012-05-09T14:17:28Z<p>Remi-X: Test your scripts Jaysds1! You can't just add examples without testing them. I editted your example to what should be right, but you're the one who has to test it yet. And learn to english..</p>
<hr />
<div>{{Client function}}<br />
__NOTOC__ <br />
This allows you to set the width of an existing column in a gridlist.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool guiGridListSetColumnWidth ( element gridList, int columnIndex, number width, bool relative )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''gridList:''' The grid list you want to add a column to<br />
*'''columnIndex:''' Column ID of the size you want to change<br />
*'''width:''' A float or integer of the width of the column depending on the '''relative''' argument.<br />
*'''relative:''' A boolean defining whether '''width''' measurements will be relative to the Gridlist size, or absolute pixels.<br />
<br />
===Returns===<br />
Returns ''true'' if the gridlist column width was successfully set, ''false'' if bad arguments were given.<br />
<br />
==Example== <br />
This example creates a gridlist with one column that is too small to display. After the column has been successfully created, we give it a new width so you can see column.<br />
<syntaxhighlight lang="lua">local gridlist = guiCreateGridList ( 332, 195, 286, 249, false ) <!-- Why these odd positions? Examples look cleaner with numbers like 250 instead of 249. Dunno whether I should change them.--><br />
local column = guiGridListAddColumn ( gridlist, "My column", 0 )<br />
<br />
if column then<br />
guiGridListSetColumnWidth ( gridlist, column, 0.5 )<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=ExecuteCommandHandler&diff=30026ExecuteCommandHandler2012-04-20T21:42:58Z<p>Remi-X: </p>
<hr />
<div>{{Server client function}}<br />
__NOTOC__<br />
This function will call all the attached functions of an existing console command, for a specified player.<br />
<br />
'''NOTE:''' You can only execute commands created by Lua. You cannot execute MTA harcoded commands due to security reasons.<br />
<br />
==Syntax== <br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua">bool executeCommandHandler ( string commandName, player thePlayer, [ string args ] )</syntaxhighlight><br />
<br />
==Required Arguments==<br />
*'''commandName:''' The name of the command you wish to execute. This is what must be typed into the console to trigger the function.<br />
*'''thePlayer:''' The player that will be presented as executer of the command to the handler function(s) of the command.<br />
<br />
==Optional Arguments==<br />
{{OptionalArg}}<br />
* '''args:''' Additional parameters that will be passed to the handler function(s) of the command that is called, separated by spaces.<br />
</section><br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua">bool executeCommandHandler ( string commandName, [ string args ] )</syntaxhighlight><br />
<br />
==Required Arguments==<br />
*'''commandName:''' The name of the command you wish to execute. This is what must be typed into the console to trigger the function.<br />
<br />
==Optional Arguments==<br />
{{OptionalArg}}<br />
* '''args:''' Additional parameters that will be passed to the handler function(s) of the command that is called, separated by spaces.<br />
</section><br />
===Returns===<br />
Returns ''true'' if the command handler was called successfully, ''false'' otherwise.<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
This example defines a command handler for the command ''createmarker'' (which creates a red marker at the caller's position). It then creates a second command handler ''createmarker2'' which will call the first one.<br />
<syntaxhighlight lang="lua"><br />
-- Define the function that will handle the 'createmarker' command<br />
function consoleCreateMarker ( playerSource, commandName )<br />
-- If a player triggered it (rather than the admin) then<br />
if ( playerSource )<br />
-- Get that player's position<br />
x, y, z = getElementPosition ( playerSource )<br />
-- Create a marker at their position<br />
createMarker ( x, y, z, 0, "checkpoint", 255, 0, 0, 255 )<br />
-- Output it in the chat box<br />
outputChatBox ( "You got a red marker", playerSource )<br />
end<br />
end<br />
-- Add the function as a handler for the command<br />
addCommandHandler ( "createmarker", consoleCreateMarker )<br />
<br />
-- Define a second console command that will just call the first.<br />
-- First define the function<br />
function consoleCreateMarker2 ( playerSource, commandName )<br />
-- re-route back to the original<br />
executeCommandHandler ( "createmarker", playerSource )<br />
end<br />
-- Then add it as a handler for the new console command<br />
addCommandHandler ( "createmarker2", consoleCreateMarker2 )<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Server functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:GUI_events&diff=29935Template:GUI events2012-04-09T10:24:55Z<p>Remi-X: Not sure wether it should go here, as imo it could be listed under "Other Events " too.</p>
<hr />
<div>*[[onClientGUIClick]]<br />
*[[onClientGUIDoubleClick]]<br />
*[[onClientGUIChanged]]<br />
*[[onClientGUIAccepted]]<br />
*[[onClientGUIScroll]]<br />
*[[onClientClick]]<br />
{{New items|3.0110|1.1|<br />
*[[onClientDoubleClick]]<br />
*[[onClientKey]]<br />
}}<br />
*[[onClientCharacter]]<br />
*[[onClientMouseEnter]]<br />
*[[onClientMouseLeave]]<br />
*[[onClientMouseMove]]<br />
*[[onClientMouseWheel]]<br />
*[[onClientCursorMove]]<br />
*[[onClientGUIMouseDown]]<br />
*[[onClientGUIMouseUp]]<br />
*[[onClientGUIMove]]<br />
*[[onClientGUISize]]<br />
*[[onClientGUITabSwitched]]<br />
{{New items|3.0110|1.1|<br />
*[[onClientGUIComboBoxAccepted]]<br />
*[[onClientGUIFocus]]<br />
*[[onClientGUIBlur]]<br />
}}<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=29687Resource:Handling Editor2012-03-21T16:23:18Z<p>Remi-X: </p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
<!--==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table getDefaultHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section>--><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br><br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Client_player_functions&diff=29597Template:Client player functions2012-03-07T16:04:50Z<p>Remi-X: Added missing isPlayerNametagShowing function</p>
<hr />
<div>* [[getLocalPlayer]]<br />
* [[getPlayerFromName]]<br />
* [[getPlayerName]]<br />
* [[getPlayerNametagColor]]<br />
* [[getPlayerNametagText]]<br />
* [[getPlayerPing]]<br />
* [[getPlayerTeam]]<br />
* [[getPlayerWantedLevel]]<br />
* [[isPlayerDead]]<br />
* [[isPlayerMapForced]]<br />
* [[isPlayerMapVisible]]<br />
* [[isPlayerNametagShowing]]<br />
* [[showPlayerHudComponent]]<br />
{{New items|3|1.0|<br />
* [[getPlayerMapBoundingBox]]<br />
* [[getPlayerMoney]]<br />
* [[givePlayerMoney]]<br />
* [[setPlayerMoney]]<br />
* [[setPlayerNametagColor]]<br />
* [[setPlayerNametagShowing]]<br />
* [[setPlayerNametagText]]<br />
* [[takePlayerMoney]]<br />
}}<br />
{{Deprecated items|3|1.0|<br />
* [[canPlayerBeKnockedOffBike]]<br />
* [[doesPlayerHaveJetPack]]<br />
* [[getPlayerAmmoInClip]]<br />
* [[getPlayerArmor]]<br />
* [[getPlayerContactElement]]<br />
* [[getPlayerOccupiedVehicle]]<br />
* [[getPlayerRotation]]<br />
* [[getPlayerSimplestTask]]<br />
* [[getPlayerSkin]]<br />
* [[getPlayerStat]]<br />
* [[getPlayerTarget]]<br />
* [[getPlayerTargetCollision]]<br />
* [[getPlayerTargetEnd]]<br />
* [[getPlayerTargetRange]]<br />
* [[getPlayerTargetStart]]<br />
* [[getPlayerTask]]<br />
* [[getPlayerTotalAmmo]]<br />
* [[getPlayerWeapon]]<br />
* [[getPlayerWeaponSlot]]<br />
* [[isPlayerChoking]]<br />
* [[isPlayerDoingTask]]<br />
* [[isPlayerDucked]]<br />
* [[isPlayerInVehicle]]<br />
* [[isPlayerInWater]]<br />
* [[isPlayerOnGround]]<br />
* [[setPlayerCanBeKnockedOffBike]]<br />
* [[setPlayerRotation]]<br />
* [[setPlayerSkin]]<br />
* [[setPlayerWeaponSlot]]<br />
}}<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=29194Resource:Handling Editor2012-01-28T11:59:55Z<p>Remi-X: </p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
EXPORTED FUNCTIONS HERE DO NOT WORK<br />
<br />
==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table getDefaultHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br><br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=RespawnVehicle&diff=29107RespawnVehicle2012-01-22T19:54:01Z<p>Remi-X: Also respawns vehicles without setVehicleRespawnPosition.</p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function respawns a vehicle according to its set respawn position, set by [[setVehicleRespawnPosition]] or the position and rotation it was created on. To spawn a vehicle to a specific location just once, [[spawnVehicle]] can be used.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool respawnVehicle ( vehicle theVehicle )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The vehicle you wish to respawn<br />
<br />
===Returns===<br />
Returns ''true'' if the vehicle respawned successfully, ''false'' if the passed argument does not exist or is not a vehicle.<br />
<br />
==Example== <br />
<!-- Explain what the example is in a single sentance --><br />
This example makes an exploded vehicle re-spawn after 5 seconds!<br />
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --><br />
<syntaxhighlight lang="lua"><br />
function respawnExplodedVehicle()<br />
setTimer(respawnVehicle, 5000, 1, source)<br />
end<br />
addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Vehicle functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=UnbindKey&diff=28100UnbindKey2011-11-18T12:51:06Z<p>Remi-X: bindKey usage was incorrect. for a very, very long time lol</p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
Removes an existing key bind from the specified player.<br />
<br />
==Syntax== <br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
bool unbindKey ( player thePlayer, string key, [ string keyState, function handler ] )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''thePlayer:''' The player you wish to unbind the key of.<br />
*'''key:''' The key you wish to unbind. See [[Key names]] for a list of valid key names.<br />
<br />
===Optional Arguments===<br />
*'''keyState:''' Can be either:<br />
**'''"up":''' If the bound key triggered a function when the key was released<br />
**'''"down":''' If the bound key triggered a function when the key was pressed<br />
**'''"both":''' If the bound key triggered a function when the key was pressed and released<br />
*'''handler:''' The function you wish to unbind.<br />
Note: If you do not specify a ''keyState'' or ''handler'', any instances of ''key'' being bound will be unbound, whatever function they are bound to.<br />
<br />
===Returns===<br />
Returns '''true'' if the key was unbound, ''false'' if it was not previously bound or invalid arguments were passed to the function.<br />
</section><br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
bool unbindKey ( string key, [ string keyState, function handler ] )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''key:''' The key you wish to unbind. See [[Key names]] for a list of valid key names.<br />
<br />
===Optional Arguments===<br />
*'''keyState:''' Can be either:<br />
**'''"up":''' If the bound key triggered a function when the key was released<br />
**'''"down":''' If the bound key triggered a function when the key was pressed<br />
**'''"both":''' If the bound key triggered a function when the key was pressed and released<br />
*'''handler:''' The function you wish to unbind.<br />
Note: If you do not specify a ''keyState'' or ''handler'', any instances of ''key'' being bound will be unbound, whatever function they are bound to.<br />
<br />
===Returns===<br />
Returns '''true'' if the key was unbound, ''false'' if it was not previously bound or invalid arguments were passed to the function.<br />
</section><br />
<br />
==Example==<br />
<section name="Server" class="server" show="true"><br />
This function binds the player's ''F1'' key to a function ''goMoo'' which outputs a chat message when pressed. The key is then unbound so that it can effectively only be used once per life.<br />
<syntaxhighlight lang="lua"><br />
-- define the function that will be called when F1 is pressed<br />
function goMoo( player )<br />
outputChatBox ( getPlayerName ( player ) .. " says Mooooooo!" )<br />
unbindKey ( player, "F1", "down", goMoo ) -- this function will no longer be triggered by the player, after removing the bind.<br />
end<br />
<br />
function playerSpawn ( )<br />
bindKey ( source, "F1", "down", goMoo ) -- bind the player's F1 key to the 'goMoo' function defined above<br />
end<br />
addEventHandler ( "onPlayerSpawn", getRootElement(), playerSpawn ) -- make the playerSpawn function be called when a player spawns<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Input functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=SetVehicleHandling&diff=27864SetVehicleHandling2011-11-15T00:30:28Z<p>Remi-X: Improper use of example.</p>
<hr />
<div>{{Server function}} <br />
__NOTOC__ <br />
This function is used to change the handling data of a vehicle.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool setVehicleHandling ( element theVehicle, string property, var value ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The vehicle you wish to set the handling of.<br />
*'''property:''' The property you wish to set the handling of the vehicle to.<br />
{{Handling Properties}}<br />
*'''value:''' The value of the property you wish to set the handling of the vehicle to.<br />
<br />
===Returns===<br />
Returns ''true'' if the handling was set successfully, ''false'' otherwise. See below a list of valid propertys and their required values:<br />
<br />
==Notes==<br />
for functionality reasons suspension modification is disabled on monster trucks, trains and boats.<br />
==Example== <br />
<syntaxhighlight lang="lua"><br />
function massChange ( me, command, mass )<br />
mass = tonumber ( mass ) -- Convert mass to a number<br />
local veh = getPedOccupiedVehicle ( me ) -- Get the player's vehicle<br />
<br />
if mass and veh then -- If valid mass and in a vehicle<br />
local success = setVehicleHandling ( veh, "mass", mass ) -- Set the vehicle's mass, and check if successful<br />
<br />
if success then -- If successful<br />
outputChatBox ( "Your vehicle's mass has been changed to: "..mass.." kg", me, 0, 255, 0 ) -- Notify the player of success<br />
else -- Too bad failure is still an option<br />
outputChatBox ( "Setting mass failed. It's probably above or below allowed limits", me, 255, 0, 0 ) -- Notify the player of failure, and give a possible reason<br />
end<br />
elseif not veh then -- If not in a vehicle<br />
outputChatBox ( "You're not in a vehicle", me, 255, 0, 0 ) -- Tell the player; He / she obviously doesn't know<br />
elseif not mass then -- If not a valid mass<br />
outputChatBox ( "Syntax: /changemass [mass]", me, 255, 0, 0 ) -- Tell the player the proper syntax<br />
end<br />
end<br />
addCommandHandler ( "changemass", massChange )<br />
</syntaxhighlight><br />
<br />
==See other vehicle functions==<br />
{{Vehicle functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=MTA_Wiki:New_Main_Page_Concept&diff=27796MTA Wiki:New Main Page Concept2011-11-13T21:07:44Z<p>Remi-X: plural thingy</p>
<hr />
<div>__NOTOC__<br />
__NOEDITSECTION__<br />
{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
<div style="border: 1px solid #D8D8D8; padding: 5px; height: 130px;"><br />
[[File:Mtalogo.png|left|100px]]'''Welcome to the Multi Theft Auto wiki.''' On this wiki you'll find a wealth of information on using Multi Theft Auto.<br />
<br />
There are many [[How you can help|things you can do to help us]] improve MTA - create a map, a gamemode, help document scripting functions, write example code, write tutorials or just play MTA and report the bugs you find.<br />
<br />
If you have any questions or problems related to scripting, feel free to get in touch with us on our [[IRC Channel]].<br />
<br><br>''Stop playing with yourself''<br />
</div><br />
|}<br />
{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
|-<br />
|width="50%" style="vertical-align:top;" |<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Input-gaming.png]]</div><br />
=== Play ===<br />
<div style="background: #FFEEAA;"><br />
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Download Multi Theft Auto: San Andreas {{Current Version|full}}]'''</div><br />
* [[Client Manual]]<br />
* [[Changes_in_1.1| Changes in 1.1]]<br />
* [[Known_Issues_-_FAQ|Known Issues]]<br />
* [[Upgrading_from_MTA:Race|Migrating from MTA:Race to MTA:SA 1.0.x]]<br />
* [[Server Manual]]<br />
* [[Map manager|Map Manager]]<br />
<br />
=== Map Editor ===<br />
*[[Resource:Editor|Manual]]<br />
*[[Resource:Editor/EDF|Editor Definition Format]]<br />
*[[Resource:Editor/Plugins|Plugins]]<br />
*[[Resource:Editor#FAQ|Frequently Asked Questions]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Package-x-generic.png]]</div><br />
====Databases====<br />
This section outlines all the Lua capabilites MTA or resources provide.<br />
* [[:Category:Resource|Resource Catalogue]] - You must learn these to make proper scripts<br />
* [[Client side scripts]]<br />
* [[Modules]]<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Applications-development.png]]</div><br />
====Developing Multi Theft Auto====<br />
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Nightly builds]<br />
* [[Compiling_MTASA|Compiling MTASA on Windows]]<br />
* [[Building_MTASA_Server_on_Mac_OS_X|Compiling MTASA on Mac OS X]]<br />
* [[Building_MTASA_Server_on_GNU_Linux|Compiling MTASA on GNU/Linux]]<br />
* [[Coding guidelines]]<br />
* [http://code.google.com/p/mtasa-blue Google Code SVN]<br />
* [[Roadmap]]<br />
* [http://bugs.mtasa.com/ Bugtracker]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Applications-office.png]]</div><br />
=== Wiki - How can you help ===<br />
* Finish documentation for [[:Category:Incomplete|Incomplete functions]].<br />
* [[:Category:Needs_Example |Add examples to functions and events]].<br />
* Review and verify [[:Category:Needs Checking|pages that need checking]].<br />
* Write tutorials to help new people.<br />
* Translate wiki pages.<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Internet-group-chat.png]]</div><br />
=== Community ===<br />
* [http://forum.multitheftauto.com/ Forum]<br />
* IRC: [irc://irc.multitheftauto.com/mta irc.multitheftauto.com #mta]<br />
* [http://community.mtasa.com/ MTA Community] - Share and download resources.<br />
* [http://www.youtube.com/user/MTAQA Youtube Channel]<br />
</div><br />
<br />
| width="50%" style="vertical-align:top;" |<br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Accessories-text-editor.png]]</div><br />
=== Scripting ===<br />
* [[Scripting Introduction|Introduction to Scripting]]<br />
* [[Introduction to Scripting the GUI]]<br />
* [[Debugging|Debugging Tutorial]] - How to find errors in your scripts<br />
* [[Resources|Introduction to Resources]]<br />
** [[Resource Web Access]] - How you can write websites with resources<br />
** [[:Category:Resource|Resource Catalogue]]<br />
** [[Meta.xml]] - Behind every resource is a meta file that defines it<br />
** [[ACL]] - Access Control List, this is vital for complex scripts to work<br />
* [[Writing_Gamemodes|Writing Gamemodes]]<br />
* [[Useful_Functions|Useful functions]]<br />
<div style="float:right; width: 32px;">[[File:start-here.png]]</div><br />
====General Lua Help====<br />
Pages designed to aid your understanding of Lua<br />
*[http://www.lua.org/pil/index.html "Programming in Lua" Manual]<br />
**[http://www.lua.org/manual/5.1/#index Internal Lua functions reference]<br />
*[http://lua-users.org/wiki/TutorialDirectory Lua Wiki]<br />
*[http://nixstaller.berlios.de/manual/0.2/nixstaller_9.html A general guide to Lua from Nixstaller]<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#CCCCFF;"><br />
====Reference====<br />
* [[Client Scripting Functions|Client-side Functions]]<br />
* [[Client Scripting Events|Client-side Events]]<br />
* [[Server Scripting Functions|Server-side Functions]]<br />
* [[Server Scripting Events|Server-side Events]]<br />
<!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --><br />
* [[MTA Classes]] - Detailed descriptions of all MTA custom types<br />
** [[Element|MTA Elements]] / [[Element tree]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:System-file-manager.png]]</div><br />
====[[Id|ID Lists]]====<br />
*[[Animations|Animations]]<br />
*[[Character Skins]]<br />
*[[CJ_Clothes|Clothing styles]]<br />
*[[Garage|Garage IDs]]<br />
*[[Interior IDs]]<br />
*[[Material IDs]]<br />
*[[Projectiles]]<br />
*[[Radar Blips]]<br />
*[[Sounds]]<br />
*[[Vehicle IDs]]<br />
*[[Vehicle Colors]]<br />
*[[Vehicle Upgrades]]<br />
*[[Vehicle variants]]<br />
*[[Weapons|Weapons]]<br />
*[[Weather]]<br />
</div><br />
<div style="padding:4px 8px 8px 8px; margin:10px;"><br />
[[File:Osi symbol.png|75px|link=http://opensource.org/]]<br />
'''Multi Theft Auto''' is '''Open Source'''. <br />
This means anyone can contribute to making Multi Theft Auto even better! <br />
</div><br />
| colspan="2" |<br />
|}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Handling_Properties&diff=27376Template:Handling Properties2011-10-24T15:32:20Z<p>Remi-X: </p>
<hr />
<div><br> http://projectcerbera.com/gta/sa/tutorials/handling <br><br />
{| border="1" cellpadding="1" cellspacing="0" align="center"<br />
|-<br />
! scope="col" style="background:#afafaf;"|Property<br />
! scope="col" style="background:#afafaf;"|Value<br />
! scope="col" style="background:#afafaf;"|Minimum value<br />
! scope="col" style="background:#afafaf;"|Maximum value<br />
! scope="col" style="background:#afafaf;"|Notes<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''mass'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''turnMass'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1000000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''dragCoeff'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-200.0<br />
| style="background:#efefef;"|200.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''centerOfMass'''<br />
| style="background:#efefef;"|Table = { [1]=posX, [2]=posY, [3]=posZ } (floats)<br />
| style="background:#efefef;"|-10.0<br />
| style="background:#efefef;"|10.0<br />
| style="background:#efefef;"|Get returns a table, set needs a table.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''percentSubmerged'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|1<br />
| style="background:#efefef;"|99999<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tractionMultiplier'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-100000.0<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tractionLoss'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tractionBias'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''numberOfGears'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|1<br />
| style="background:#efefef;"|5<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''maxVelocity'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.1<br />
| style="background:#efefef;"|200000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''engineAcceleration'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''engineInertia'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-1000.0<br />
| style="background:#efefef;"|1000.0<br />
| style="background:#efefef;"|Inertia of 0 can cause a LSOD. (Unable to divide by zero)<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''driveType'''<br />
| style="background:#efefef;"|String<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Use 'rwd', 'fwd' or 'awd'.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''engineType'''<br />
| style="background:#efefef;"|String<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Use 'petrol', 'diesel' or 'electric'.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''brakeDeceleration'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.1<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''brakeBias'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''ABS'''<br />
| style="background:#efefef;"|Boolean<br />
| style="background:#efefef;"|true<br />
| style="background:#efefef;"|false<br />
| style="background:#efefef;"|Has no effect.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''steeringLock'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|360.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionForceLevel'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionDamping'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionHighSpeedDamping'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|600.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionUpperLimit'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-50.0<br />
| style="background:#efefef;"|50.0<br />
| style="background:#efefef;"|Can't be equal to suspensionLowerLimit.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionLowerLimit'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-50.0<br />
| style="background:#efefef;"|50.0<br />
| style="background:#efefef;"|Can't be equal to suspensionUpperLimit.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionFrontRearBias'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|Hardcoded maximum is 3.0, but values above 1.0 have no effect.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionAntiDiveMultiplier'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|30.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''seatOffsetDistance'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-20.0<br />
| style="background:#efefef;"|20.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''collisionDamageMultiplier'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|10.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''monetary'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|0<br />
| style="background:#efefef;"|230195200<br />
| style="background:#efefef;"|Get works, set is disabled.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''modelFlags'''<br />
| style="background:#efefef;"|Hexadecimal/Decimal<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Property uses a decimal value, generated by a hexadecimal value. Either use 0x12345678 or tonumber ( "0x12345678" ). See [http://projectcerbera.com/gta/sa/tutorials/handling projectcerbera] for possible values.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''handlingFlags'''<br />
| style="background:#efefef;"|Hexadecimal/Decimal<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Property uses a decimal value, generated by a hexadecimal value. Either use 0x12345678 or tonumber ( "0x12345678" ). See [http://projectcerbera.com/gta/sa/tutorials/handling projectcerbera] for possible values.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''headLight'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Get works, set is disabled.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tailLight'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Get works, set is disabled.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''animGroup'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|??<br />
| style="background:#efefef;"|??<br />
| style="background:#efefef;"|Get works, set is disabled due to people not knowing this property was vehicle-based and caused crashes.<br />
|}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=GetOriginalHandling&diff=27375GetOriginalHandling2011-10-24T15:27:58Z<p>Remi-X: getOriginalHandling</p>
<hr />
<div>{{Server client function}} <br />
__NOTOC__ <br />
This function returns a table of the original vehicle handling. Use [[getVehicleHandling]] if you wish to get the current handling of a vehicle, or [[getModelHandling]] for a specific vehicle model.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table getOriginalHandling ( int modelID ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''modelID:''' The vehicle ID you wish to get the original handling from.<br />
<br />
===Returns===<br />
Returns a ''table'' containing all the handling data, ''false'' otherwise. Here a list of valid table properties and what they return:<br />
{{Handling Properties}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo, but basically works the same as getVehicleHandling.<br />
</syntaxhighlight><br />
<br />
==See other vehicle functions==<br />
{{Vehicle functions}}<br />
[[Category:Needs_Example]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:GUI_events&diff=27200Template:GUI events2011-09-21T16:59:12Z<p>Remi-X: ups</p>
<hr />
<div>*[[onClientGUIClick]]<br />
*[[onClientGUIDoubleClick]]<br />
*[[onClientGUIChanged]]<br />
*[[onClientGUIAccepted]]<br />
*[[onClientGUIScroll]]<br />
*[[onClientClick]]<br />
{{New feature|3.0110|1.1|<br />
*[[onClientDoubleClick]]<br />
*[[onClientKey]]<br />
}}<br />
*[[onClientMouseEnter]]<br />
*[[onClientMouseLeave]]<br />
*[[onClientMouseMove]]<br />
*[[onClientMouseWheel]]<br />
*[[onClientCursorMove]]<br />
*[[onClientGUIMouseDown]]<br />
*[[onClientGUIMouseUp]]<br />
*[[onClientGUIMove]]<br />
*[[onClientGUISize]]<br />
*[[onClientGUITabSwitched]]<br />
{{New feature|3.0110|1.1|<br />
*[[onClientGUIComboBoxAccepted]]<br />
*[[onClientGUIFocus]]<br />
*[[onClientGUIBlur]]<br />
}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:GUI_events&diff=27199Template:GUI events2011-09-21T16:52:53Z<p>Remi-X: onClientGUIComboBoxAccept</p>
<hr />
<div>*[[onClientGUIClick]]<br />
*[[onClientGUIDoubleClick]]<br />
*[[onClientGUIChanged]]<br />
*[[onClientGUIAccepted]]<br />
*[[onClientGUIScroll]]<br />
*[[onClientClick]]<br />
{{New feature|3.0110|1.1|<br />
*[[onClientDoubleClick]]<br />
*[[onClientKey]]<br />
}}<br />
*[[onClientMouseEnter]]<br />
*[[onClientMouseLeave]]<br />
*[[onClientMouseMove]]<br />
*[[onClientMouseWheel]]<br />
*[[onClientCursorMove]]<br />
*[[onClientGUIMouseDown]]<br />
*[[onClientGUIMouseUp]]<br />
*[[onClientGUIMove]]<br />
*[[onClientGUISize]]<br />
*[[onClientGUITabSwitched]]<br />
{{New feature|3.0110|1.1|<br />
*[[onClientGUIComboBoxAccept]]<br />
*[[onClientGUIFocus]]<br />
*[[onClientGUIBlur]]<br />
}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=SetPedFootBloodEnabled&diff=27172SetPedFootBloodEnabled2011-09-18T14:14:26Z<p>Remi-X: Typo lol</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
This function makes a players foot prints bloody.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua">bool setPedFootBloodEnabled (element thePlayer, bool enabled)</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''thePlayer:''' The player to give bloody foot prints to.<br />
*'''enabled:''' Boolean specifying whether or not to have bloody feet.<br />
<br />
===Returns===<br />
Returns ''true'' if changing the players bloody feet status worked.<br />
<br />
==Example== <br />
This example gives the player bloody feet forever.<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
setPedFootBloodEnabled(localPlayer, true)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Client_ped_functions}}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Handling_Properties&diff=27063Template:Handling Properties2011-09-05T06:45:52Z<p>Remi-X: Updated animGroup</p>
<hr />
<div><br> http://projectcerbera.com/gta/sa/tutorials/handling <br><br />
{| border="1" cellpadding="1" cellspacing="0" align="center"<br />
|-<br />
! scope="col" style="background:#afafaf;"|Property<br />
! scope="col" style="background:#afafaf;"|Value<br />
! scope="col" style="background:#afafaf;"|Minimum value<br />
! scope="col" style="background:#afafaf;"|Maximum value<br />
! scope="col" style="background:#afafaf;"|Notes<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''mass'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''turnMass'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1000000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''dragCoeff'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-200.0<br />
| style="background:#efefef;"|200.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''centerOfMass'''<br />
| style="background:#efefef;"|Table = { [1]=posX, [2]=posY, [3]=posZ } (floats)<br />
| style="background:#efefef;"|-10.0<br />
| style="background:#efefef;"|10.0<br />
| style="background:#efefef;"|Get returns a table, set needs a table.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''percentSubmerged'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|1<br />
| style="background:#efefef;"|99999<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tractionMultiplier'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-100000.0<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tractionLoss'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tractionBias'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''numberOfGears'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|1<br />
| style="background:#efefef;"|5<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''maxVelocity'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.1<br />
| style="background:#efefef;"|200000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''engineAcceleration'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''engineInertia'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-1000.0<br />
| style="background:#efefef;"|1000.0<br />
| style="background:#efefef;"|Inertia of 0 can cause a LSOD. (Unable to divide by zero)<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''driveType'''<br />
| style="background:#efefef;"|String<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Use 'rwd', 'fwd' or 'awd'.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''engineType'''<br />
| style="background:#efefef;"|String<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Use 'petrol', 'diesel' or 'electric'.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''brakeDeceleration'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.1<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''brakeBias'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''ABS'''<br />
| style="background:#efefef;"|Boolean<br />
| style="background:#efefef;"|true<br />
| style="background:#efefef;"|false<br />
| style="background:#efefef;"|Has no effect.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''steeringLock'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|360.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionForceLevel'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionDamping'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionHighSpeedDamping'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|600.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionUpperLimit'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-50.0<br />
| style="background:#efefef;"|50.0<br />
| style="background:#efefef;"|Can't be equal to suspensionLowerLimit.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionLowerLimit'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-50.0<br />
| style="background:#efefef;"|50.0<br />
| style="background:#efefef;"|Can't be equal to suspensionUpperLimit.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionFrontRearBias'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|Hardcoded maximum is 3.0, but values above 1.0 have no effect.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionAntiDiveMultiplier'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|30.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''seatOffsetDistance'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-20.0<br />
| style="background:#efefef;"|20.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''collisionDamageMultiplier'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|10.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''monetary'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|0<br />
| style="background:#efefef;"|230195200<br />
| style="background:#efefef;"|Get works, set is disabled.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''modelFlags'''<br />
| style="background:#efefef;"|Hexadecimal/Decimal<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Property uses a decimal value, generated by a hexadecimal value. Either use 0x12345678 or tonumber ( "0x12345678" ). See projectcerbera for possible values.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''handlingFlags'''<br />
| style="background:#efefef;"|Hexadecimal/Decimal<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Property uses a decimal value, generated by a hexadecimal value. Either use 0x12345678 or tonumber ( "0x12345678" ). See projectcerbera for possible values.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''headLight'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Get works, set is disabled.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tailLight'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Get works, set is disabled.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''animGroup'''<br />
| style="background:#efefef;"|Integer?<br />
| style="background:#efefef;"|??<br />
| style="background:#efefef;"|??<br />
| style="background:#efefef;"|Get works, set is disabled due to people not knowing this property was vehicle-based and caused crashes.<br />
|}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=26994Resource:Handling Editor2011-09-03T16:38:34Z<p>Remi-X: /* Exported Events */</p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table getDefaultHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br><br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=26993Resource:Handling Editor2011-09-03T16:33:10Z<p>Remi-X: /* Exported Events */</p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table getDefaultHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
element thePlayer, string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''thePlayer:''' The player who changed the handling<br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
*'''fullName:''' The full name of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
*'''fullName:''' The full name of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br><br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Vehicle_functions&diff=26938Template:Vehicle functions2011-08-29T13:14:36Z<p>Remi-X: </p>
<hr />
<div>*[[addVehicleUpgrade]]<br />
*[[attachTrailerToVehicle]]<br />
*[[blowVehicle]]<br />
*[[createVehicle]]<br />
*[[detachTrailerFromVehicle]]<br />
*[[fixVehicle]]<br />
*[[getVehicleColor ]]<br />
*[[getVehicleCompatibleUpgrades]]<br />
*[[getVehicleController]]<br />
*[[getVehicleDoorState]]<br />
*[[getVehicleEngineState]]<br />
*[[getVehicleLandingGearDown]]<br />
*[[getVehicleLightState]]<br />
*[[getVehicleMaxPassengers]]<br />
*[[getVehicleName]]<br />
*[[getVehicleOccupant]]<br />
*[[getVehicleOccupants]]<br />
*[[getVehicleOverrideLights]]<br />
*[[getVehiclePaintjob]]<br />
*[[getVehiclePanelState]]<br />
*[[getVehicleRotation]]<br />
*[[getVehicleSirensOn]]<br />
*[[getVehiclesOfType]]<br />
*[[getVehicleTowedByVehicle]]<br />
*[[getVehicleTowingVehicle]]<br />
*[[getVehicleTurnVelocity]]<br />
*[[getVehicleTurretPosition]]<br />
*[[getVehicleType]]<br />
*[[getVehicleUpgradeOnSlot]]<br />
*[[getVehicleUpgrades]]<br />
*[[getVehicleUpgradeSlotName]]<br />
*[[getVehicleWheelStates]]<br />
{{New feature|3.0110|1.1|<br />
*[[getVehicleDoorOpenRatio]]<br />
*[[getVehicleHandling]]<br />
*[[getOriginalHandling]]<br />
}}<br />
*[[isVehicleDamageProof]]<br />
*[[isVehicleFrozen]]<br />
*[[isVehicleFuelTankExplodable]]<br />
*[[isVehicleLocked]]<br />
*[[isVehicleOnGround]]<br />
*[[removeVehicleUpgrade]]<br />
*[[resetVehicleExplosionTime]]<br />
*[[resetVehicleIdleTime]]<br />
*[[respawnVehicle]]<br />
*[[setVehicleColor]]<br />
*[[setVehicleDamageProof]]<br />
*[[setVehicleDirtLevel]]<br />
*[[setVehicleDoorState]]<br />
*[[setVehicleDoorsUndamageable]]<br />
*[[setVehicleEngineState]]<br />
*[[setVehicleFrozen]]<br />
*[[setVehicleFuelTankExplodable]]<br />
*[[setVehicleIdleRespawnDelay]]<br />
*[[setVehicleLandingGearDown]]<br />
*[[setVehicleLightState]]<br />
*[[setVehicleLocked]]<br />
*[[setVehicleOverrideLights]]<br />
*[[setVehiclePaintjob]]<br />
*[[setVehiclePanelState]]<br />
*[[setVehicleRespawnDelay]]<br />
*[[setVehicleRespawnPosition]]<br />
*[[setVehicleRotation]]<br />
*[[setVehicleSirensOn]]<br />
{{New feature|3.0110|1.1|<br />
*[[setVehicleTurretPosition]]<br />
*[[setVehicleDoorOpenRatio]]<br />
*[[setVehicleHandling]]<br />
*[[setModelHandling]]<br />
}}<br />
*[[setVehicleTurnVelocity]]<br />
*[[setVehicleWheelStates]]<br />
*[[spawnVehicle]]<br />
*[[toggleVehicleRespawn]]<br />
*[[getTrainDirection]]<br />
*[[getTrainSpeed]]<br />
*[[getVehicleHeadLightColor]]<br />
*[[getVehicleModelFromName]]<br />
*[[getVehicleNameFromModel]]<br />
*[[isTrainDerailable]]<br />
*[[isTrainDerailed]]<br />
*[[isVehicleBlown]]<br />
*[[isVehicleTaxiLightOn]]<br />
*[[setTrainDerailable]]<br />
*[[setTrainDerailed]]<br />
*[[setTrainDirection]]<br />
*[[setTrainSpeed]]<br />
*[[setVehicleHeadLightColor]]<br />
*[[setVehicleTaxiLightOn]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&diff=26937Template:Client vehicle functions2011-08-29T13:13:42Z<p>Remi-X: ups forgot one AGAIN</p>
<hr />
<div>*[[addVehicleUpgrade]]<br />
*[[attachTrailerToVehicle]]<br />
*[[blowVehicle]]<br />
*[[createVehicle]]<br />
*[[detachTrailerFromVehicle]]<br />
*[[fixVehicle]]<br />
*[[getVehicleAdjustableProperty]]<br />
*[[getVehicleColor]]<br />
*[[getVehicleCompatibleUpgrades]]<br />
*[[getVehicleController]]<br />
*[[getVehicleDoorState]]<br />
*[[getVehicleEngineState]]<br />
*[[getVehicleLandingGearDown]]<br />
*[[getVehicleLightState]]<br />
*[[getVehicleMaxPassengers]]<br />
*[[getVehicleName]]<br />
*[[getVehicleOccupant]]<br />
*[[getVehicleOccupants]]<br />
*[[getVehicleCurrentGear]]<br />
*[[getVehicleOverrideLights]]<br />
*[[getVehiclePaintjob]]<br />
*[[getVehiclePanelState]]<br />
*[[getVehiclePlateText]]<br />
*[[getVehicleRotation]]<br />
*[[getVehicleSirensOn]]<br />
*[[getVehicleTowedByVehicle]]<br />
*[[getVehicleTowingVehicle]]<br />
*[[getVehicleTurnVelocity]]<br />
*[[getVehicleTurretPosition]]<br />
*[[getVehicleUpgradeOnSlot]]<br />
*[[getVehicleUpgrades]]<br />
*[[getVehicleUpgradeSlotName]]<br />
*[[getVehicleWheelStates]]<br />
{{New feature|3.0110|1.1|<br />
*[[getVehicleDoorOpenRatio]]<br />
*[[getVehicleHandling]]<br />
*[[getModelHandling]]<br />
*[[getOriginalHandling]]<br />
}}<br />
*[[isVehicleDamageProof]]<br />
*[[isVehicleFrozen]]<br />
*[[isVehicleFuelTankExplodable]]<br />
*[[isVehicleLocked]]<br />
*[[isVehicleOnGround]]<br />
*[[removeVehicleUpgrade]]<br />
*[[setVehicleAdjustableProperty]]<br />
*[[setVehicleColor]]<br />
*[[setVehicleDamageProof]]<br />
*[[setVehicleDirtLevel]]<br />
*[[setVehicleDoorState]]<br />
*[[setVehicleDoorsUndamageable]]<br />
*[[setVehicleEngineState]]<br />
*[[setVehicleFrozen]]<br />
*[[setVehicleFuelTankExplodable]]<br />
*[[setVehicleLandingGearDown]]<br />
*[[setVehicleLightState]]<br />
*[[setVehicleLocked]]<br />
*[[setVehicleOverrideLights]]<br />
*[[setVehiclePaintjob]]<br />
*[[setVehiclePanelState]]<br />
*[[setVehicleRotation]]<br />
*[[setVehicleSirensOn]]<br />
{{New feature|3.0110|1.1|<br />
*[[setVehicleTurretPosition]]<br />
*[[setVehicleDoorOpenRatio]]<br />
}}<br />
*[[setVehicleTurnVelocity]]<br />
*[[setVehicleWheelStates]]<br />
*[[getHelicopterRotorSpeed]]<br />
*[[getTrainDirection]]<br />
*[[getTrainSpeed]]<br />
*[[getVehicleGravity]]<br />
*[[getVehicleHeadLightColor]]<br />
*[[getVehicleModelFromName]]<br />
*[[getVehicleNameFromModel]]<br />
*[[getVehicleType]]<br />
*[[isTrainDerailable]]<br />
*[[isTrainDerailed]]<br />
*[[isVehicleBlown]]<br />
*[[isVehicleTaxiLightOn]]<br />
*[[setHelicopterRotorSpeed]]<br />
*[[setTrainDerailable]]<br />
*[[setTrainDerailed]]<br />
*[[setTrainDirection]]<br />
*[[setTrainSpeed]]<br />
*[[setVehicleGravity]]<br />
*[[setVehicleHeadLightColor]]<br />
*[[setVehicleTaxiLightOn]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&diff=26936Template:Client vehicle functions2011-08-29T13:12:58Z<p>Remi-X: </p>
<hr />
<div>*[[addVehicleUpgrade]]<br />
*[[attachTrailerToVehicle]]<br />
*[[blowVehicle]]<br />
*[[createVehicle]]<br />
*[[detachTrailerFromVehicle]]<br />
*[[fixVehicle]]<br />
*[[getVehicleAdjustableProperty]]<br />
*[[getVehicleColor]]<br />
*[[getVehicleCompatibleUpgrades]]<br />
*[[getVehicleController]]<br />
*[[getVehicleDoorState]]<br />
*[[getVehicleEngineState]]<br />
*[[getVehicleLandingGearDown]]<br />
*[[getVehicleLightState]]<br />
*[[getVehicleMaxPassengers]]<br />
*[[getVehicleName]]<br />
*[[getVehicleOccupant]]<br />
*[[getVehicleOccupants]]<br />
*[[getVehicleCurrentGear]]<br />
*[[getVehicleOverrideLights]]<br />
*[[getVehiclePaintjob]]<br />
*[[getVehiclePanelState]]<br />
*[[getVehiclePlateText]]<br />
*[[getVehicleRotation]]<br />
*[[getVehicleSirensOn]]<br />
*[[getVehicleTowedByVehicle]]<br />
*[[getVehicleTowingVehicle]]<br />
*[[getVehicleTurnVelocity]]<br />
*[[getVehicleTurretPosition]]<br />
*[[getVehicleUpgradeOnSlot]]<br />
*[[getVehicleUpgrades]]<br />
*[[getVehicleUpgradeSlotName]]<br />
*[[getVehicleWheelStates]]<br />
{{New feature|3.0110|1.1|<br />
*[[getVehicleDoorOpenRatio]]<br />
*[[getVehicleHandling]]<br />
*[[getModelHandling]]<br />
}}<br />
*[[isVehicleDamageProof]]<br />
*[[isVehicleFrozen]]<br />
*[[isVehicleFuelTankExplodable]]<br />
*[[isVehicleLocked]]<br />
*[[isVehicleOnGround]]<br />
*[[removeVehicleUpgrade]]<br />
*[[setVehicleAdjustableProperty]]<br />
*[[setVehicleColor]]<br />
*[[setVehicleDamageProof]]<br />
*[[setVehicleDirtLevel]]<br />
*[[setVehicleDoorState]]<br />
*[[setVehicleDoorsUndamageable]]<br />
*[[setVehicleEngineState]]<br />
*[[setVehicleFrozen]]<br />
*[[setVehicleFuelTankExplodable]]<br />
*[[setVehicleLandingGearDown]]<br />
*[[setVehicleLightState]]<br />
*[[setVehicleLocked]]<br />
*[[setVehicleOverrideLights]]<br />
*[[setVehiclePaintjob]]<br />
*[[setVehiclePanelState]]<br />
*[[setVehicleRotation]]<br />
*[[setVehicleSirensOn]]<br />
{{New feature|3.0110|1.1|<br />
*[[setVehicleTurretPosition]]<br />
*[[setVehicleDoorOpenRatio]]<br />
}}<br />
*[[setVehicleTurnVelocity]]<br />
*[[setVehicleWheelStates]]<br />
*[[getHelicopterRotorSpeed]]<br />
*[[getTrainDirection]]<br />
*[[getTrainSpeed]]<br />
*[[getVehicleGravity]]<br />
*[[getVehicleHeadLightColor]]<br />
*[[getVehicleModelFromName]]<br />
*[[getVehicleNameFromModel]]<br />
*[[getVehicleType]]<br />
*[[isTrainDerailable]]<br />
*[[isTrainDerailed]]<br />
*[[isVehicleBlown]]<br />
*[[isVehicleTaxiLightOn]]<br />
*[[setHelicopterRotorSpeed]]<br />
*[[setTrainDerailable]]<br />
*[[setTrainDerailed]]<br />
*[[setTrainDirection]]<br />
*[[setTrainSpeed]]<br />
*[[setVehicleGravity]]<br />
*[[setVehicleHeadLightColor]]<br />
*[[setVehicleTaxiLightOn]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&diff=26935Template:Client vehicle functions2011-08-29T13:12:02Z<p>Remi-X: </p>
<hr />
<div>*[[addVehicleUpgrade]]<br />
*[[attachTrailerToVehicle]]<br />
*[[blowVehicle]]<br />
*[[createVehicle]]<br />
*[[detachTrailerFromVehicle]]<br />
*[[fixVehicle]]<br />
*[[getVehicleAdjustableProperty]]<br />
*[[getVehicleColor]]<br />
*[[getVehicleCompatibleUpgrades]]<br />
*[[getVehicleController]]<br />
*[[getVehicleDoorState]]<br />
*[[getVehicleEngineState]]<br />
*[[getVehicleLandingGearDown]]<br />
*[[getVehicleLightState]]<br />
*[[getVehicleMaxPassengers]]<br />
*[[getVehicleName]]<br />
*[[getVehicleOccupant]]<br />
*[[getVehicleOccupants]]<br />
*[[getVehicleCurrentGear]]<br />
*[[getVehicleOverrideLights]]<br />
*[[getVehiclePaintjob]]<br />
*[[getVehiclePanelState]]<br />
*[[getVehiclePlateText]]<br />
*[[getVehicleRotation]]<br />
*[[getVehicleSirensOn]]<br />
*[[getVehicleTowedByVehicle]]<br />
*[[getVehicleTowingVehicle]]<br />
*[[getVehicleTurnVelocity]]<br />
*[[getVehicleTurretPosition]]<br />
*[[getVehicleUpgradeOnSlot]]<br />
*[[getVehicleUpgrades]]<br />
*[[getVehicleUpgradeSlotName]]<br />
*[[getVehicleWheelStates]]<br />
{{New feature|3.0110|1.1|<br />
*[[getVehicleDoorOpenRatio]]<br />
*[[getVehicleHandling]]<br />
}}<br />
*[[isVehicleDamageProof]]<br />
*[[isVehicleFrozen]]<br />
*[[isVehicleFuelTankExplodable]]<br />
*[[isVehicleLocked]]<br />
*[[isVehicleOnGround]]<br />
*[[removeVehicleUpgrade]]<br />
*[[setVehicleAdjustableProperty]]<br />
*[[setVehicleColor]]<br />
*[[setVehicleDamageProof]]<br />
*[[setVehicleDirtLevel]]<br />
*[[setVehicleDoorState]]<br />
*[[setVehicleDoorsUndamageable]]<br />
*[[setVehicleEngineState]]<br />
*[[setVehicleFrozen]]<br />
*[[setVehicleFuelTankExplodable]]<br />
*[[setVehicleLandingGearDown]]<br />
*[[setVehicleLightState]]<br />
*[[setVehicleLocked]]<br />
*[[setVehicleOverrideLights]]<br />
*[[setVehiclePaintjob]]<br />
*[[setVehiclePanelState]]<br />
*[[setVehicleRotation]]<br />
*[[setVehicleSirensOn]]<br />
{{New feature|3.0110|1.1|<br />
*[[setVehicleTurretPosition]]<br />
*[[setVehicleDoorOpenRatio]]<br />
}}<br />
*[[setVehicleTurnVelocity]]<br />
*[[setVehicleWheelStates]]<br />
*[[getHelicopterRotorSpeed]]<br />
*[[getTrainDirection]]<br />
*[[getTrainSpeed]]<br />
*[[getVehicleGravity]]<br />
*[[getVehicleHeadLightColor]]<br />
*[[getVehicleModelFromName]]<br />
*[[getVehicleNameFromModel]]<br />
*[[getVehicleType]]<br />
*[[isTrainDerailable]]<br />
*[[isTrainDerailed]]<br />
*[[isVehicleBlown]]<br />
*[[isVehicleTaxiLightOn]]<br />
*[[setHelicopterRotorSpeed]]<br />
*[[setTrainDerailable]]<br />
*[[setTrainDerailed]]<br />
*[[setTrainDirection]]<br />
*[[setTrainSpeed]]<br />
*[[setVehicleGravity]]<br />
*[[setVehicleHeadLightColor]]<br />
*[[setVehicleTaxiLightOn]]</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=26329Resource:Handling Editor2011-07-08T21:07:52Z<p>Remi-X: /* Exported Events */</p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table getDefaultHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
element thePlayer, string hProperty, var oldValue, var newValue, string fullName<br />
</syntaxhighlight><br />
*'''thePlayer:''' The player who changed the handling<br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
*'''fullName:''' The full name of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue, string fullName<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
*'''fullName:''' The full name of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br><br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=26328Resource:Handling Editor2011-07-08T20:54:17Z<p>Remi-X: /* onVehicleHandlingChange */</p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table getDefaultHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
element thePlayer, string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''thePlayer:''' The player who changed the handling<br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br><br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=26327Resource:Handling Editor2011-07-08T20:54:03Z<p>Remi-X: /* onVehicleHandlingChange */</p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table getDefaultHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
element thePlayer, string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''player:''' The player who changed the handling<br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br><br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Template:Handling_Properties&diff=26118Template:Handling Properties2011-06-22T11:07:57Z<p>Remi-X: Improved look, thanks to the weapons page for colors :)</p>
<hr />
<div><br> http://projectcerbera.com/gta/sa/tutorials/handling <br><br />
{| border="1" cellpadding="1" cellspacing="0" align="center"<br />
|-<br />
! scope="col" style="background:#afafaf;"|Property<br />
! scope="col" style="background:#afafaf;"|Value<br />
! scope="col" style="background:#afafaf;"|Minimum value<br />
! scope="col" style="background:#afafaf;"|Maximum value<br />
! scope="col" style="background:#afafaf;"|Notes<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''mass'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''turnMass'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1000000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''dragCoeff'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-200.0<br />
| style="background:#efefef;"|200.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''centerOfMass'''<br />
| style="background:#efefef;"|Table = { [1]=posX, [2]=posY, [3]=posZ } (floats)<br />
| style="background:#efefef;"|-10.0<br />
| style="background:#efefef;"|10.0<br />
| style="background:#efefef;"|Get returns a table, set needs a table.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''percentSubmerged'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|1<br />
| style="background:#efefef;"|99999<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tractionMultiplier'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-100000.0<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tractionLoss'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tractionBias'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''numberOfGears'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|1<br />
| style="background:#efefef;"|5<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''maxVelocity'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.1<br />
| style="background:#efefef;"|200000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''engineAcceleration'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''engineInertia'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-1000.0<br />
| style="background:#efefef;"|1000.0<br />
| style="background:#efefef;"|Inertia of 0 can cause a LSOD. (Unable to divide by zero)<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''driveType'''<br />
| style="background:#efefef;"|String<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Use 'rwd', 'fwd' or 'awd'.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''engineType'''<br />
| style="background:#efefef;"|String<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Use 'petrol', 'diesel' or 'electric'.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''brakeDeceleration'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.1<br />
| style="background:#efefef;"|100000.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''brakeBias'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''ABS'''<br />
| style="background:#efefef;"|Boolean<br />
| style="background:#efefef;"|true<br />
| style="background:#efefef;"|false<br />
| style="background:#efefef;"|Has no effect.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''steeringLock'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|360.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionForceLevel'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionDamping'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|100.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionHighSpeedDamping'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|600.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionUpperLimit'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-50.0<br />
| style="background:#efefef;"|50.0<br />
| style="background:#efefef;"|Can't be equal to suspensionLowerLimit.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionLowerLimit'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-50.0<br />
| style="background:#efefef;"|50.0<br />
| style="background:#efefef;"|Can't be equal to suspensionUpperLimit.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionFrontRearBias'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|1.0<br />
| style="background:#efefef;"|Hardcoded maximum is 3.0, but values above 1.0 have no effect.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''suspensionAntiDiveMultiplier'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|30.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''seatOffsetDistance'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|-20.0<br />
| style="background:#efefef;"|20.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''collisionDamageMultiplier'''<br />
| style="background:#efefef;"|Float<br />
| style="background:#efefef;"|0.0<br />
| style="background:#efefef;"|10.0<br />
| style="background:#efefef;"|<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''monetary'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|0<br />
| style="background:#efefef;"|230195200<br />
| style="background:#efefef;"|Get works, set is disabled.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''modelFlags'''<br />
| style="background:#efefef;"|Hexadecimal/Decimal<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Property uses a decimal value, generated by a hexadecimal value. Either use 0x12345678 or tonumber ( "0x12345678" ). See projectcerbera for possible values.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''handlingFlags'''<br />
| style="background:#efefef;"|Hexadecimal/Decimal<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Property uses a decimal value, generated by a hexadecimal value. Either use 0x12345678 or tonumber ( "0x12345678" ). See projectcerbera for possible values.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''headLight'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Get works, set is disabled.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''tailLight'''<br />
| style="background:#efefef;"|Integer<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|N/A<br />
| style="background:#efefef;"|Get works, set is disabled.<br />
|-<br />
| scope="row" style="background:#cfcfcf;"|'''animGroup'''<br />
| style="background:#efefef;"|Integer?<br />
| style="background:#efefef;"|??<br />
| style="background:#efefef;"|??<br />
| style="background:#efefef;"|Vehicle based.<br />
|}</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=26113Resource:Handling Editor2011-06-21T12:22:33Z<p>Remi-X: /* getDefaultHandling */</p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table getDefaultHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
element thePlayer, string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The player who changed the handling<br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br><br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=26111Resource:Handling Editor2011-06-20T10:41:07Z<p>Remi-X: /* See also */</p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server & Client" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table importVehicleHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
element thePlayer, string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The player who changed the handling<br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br><br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-Xhttps://wiki.multitheftauto.com/index.php?title=Resource:Handling_Editor&diff=26110Resource:Handling Editor2011-06-20T10:35:46Z<p>Remi-X: </p>
<hr />
<div>{{Resource page}}<br />
The MTA Ingame Handling Editor (shortly hedit or ahe) is an open source resource being developed for MTA 1.1.<br />
You can see and download the latest version on the [http://code.google.com/p/hedit/ Google Code project]. <br><br><br />
'''[http://forum.mtasa.com/viewtopic.php?f=108&t=30494/ Be sure to see the forumtopic for all information!]'''<br />
<br />
==Exported Functions==<br />
<br />
===getDefaultHandling===<br />
<section name="Server & Client" class="both" show="true"><br />
This function is used to get the default handling of some vehicle. While getOriginalHandling returns the default handling by San Andreas, this function returns the default handling which has been set by the Handling Editor. If the editor did not load any custom handlings as default, this function will return the same as getOriginalHandling.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table importVehicleHandling ( element theVehicle )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to get the default handling of<br />
<br />
==Returns==<br />
Returns a table containing the default handling, false otherwise.<br />
</section><br />
<br />
===importVehicleHandling===<br />
<section name="Server" class="server" show="true"><br />
This function is used to import the handling set of all vehicles with the specified model ID.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool importVehicleHandling ( element theVehicle, string/table data )<br />
</syntaxhighlight><br />
<br />
==Required Arguments== <br />
*'''theVehicle''': The vehicle you wish to set the handling of<br />
*'''data''': A string if you want to load a handling.cfg line, or a table containing valid handlingProperties and data.<br />
<br />
==Returns==<br />
Returns '''true''' if the handling was set successfully, '''false''' otherwise.<br />
</section><br />
<br />
==Exported Events==<br />
===onVehicleHandlingChange===<br />
<section name="Server" class="server" show="true"><br />
This event is called when someone changes some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
element thePlayer, string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The player who changed the handling<br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
===onClientVehicleHandlingChange===<br />
<section name="Client" class="client" show="true"><br />
This event is called when you change some handling from any vehicle.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string hProperty, var oldValue, var newValue<br />
</syntaxhighlight><br />
*'''hProperty:''' The handling property which has been changed<br />
*'''oldValue:''' The old value of the changed property<br />
*'''newValue:''' The new value of the changed property<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the vehicle element that got changed.<br />
</section><br />
<br />
==See also==<br />
[http://www.code.google.com/p/hedit/ Google Code Project] - See and get the latest changes here.<br><br />
[http://forum.mtasa.com/viewtopic.php?f=108&t=30494 Official Forum Topic] - The place for discussing this project.<br />
[http://www.youtube.com/user/SilentStrikeMTA?feature=mhsn#p/p Youtube playlist] - Full playlist of all development video's of the handling editor.</div>Remi-X