https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=Patrick2562&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-29T08:58:05ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=GetPedBonePosition&diff=77178GetPedBonePosition2023-07-18T17:47:52Z<p>Patrick2562: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
Returns the 3D world coordinates of a specific bone of a given ped.<br />
{{Tip|If you want attach element to ped bone, use [[https://github.com/Patrick2562/mtasa-pAttach pAttach]] resource}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float, float, float getPedBonePosition ( ped thePed, int bone )<br />
</syntaxhighlight><br />
{{OOP||[[ped]]:getBonePosition||}}<br />
<br />
===Required Arguments===<br />
*'''thePed:''' the ped you want to inspect.<br />
*'''bone:''' the number of the bone to get the position of.<br />
<br />
[[Image:Bones.jpg|thumb|Bone numbers]]<br />
<br />
<div style="border: 3px red solid; margin-bottom:3px; padding-left:5px;"><br />
*'''1:''' BONE_PELVIS1<br />
*'''2:''' BONE_PELVIS<br />
*'''3:''' BONE_SPINE1<br />
*'''4:''' BONE_UPPERTORSO<br />
*'''5:''' BONE_NECK<br />
*'''6:''' BONE_HEAD2<br />
*'''7:''' BONE_HEAD1<br />
*'''8:''' BONE_HEAD<br />
*'''21:''' BONE_RIGHTUPPERTORSO<br />
*'''22:''' BONE_RIGHTSHOULDER<br />
*'''23:''' BONE_RIGHTELBOW<br />
*'''24:''' BONE_RIGHTWRIST<br />
*'''25:''' BONE_RIGHTHAND<br />
*'''26:''' BONE_RIGHTTHUMB<br />
*'''31:''' BONE_LEFTUPPERTORSO<br />
*'''32:''' BONE_LEFTSHOULDER<br />
*'''33:''' BONE_LEFTELBOW<br />
*'''34:''' BONE_LEFTWRIST<br />
*'''35:''' BONE_LEFTHAND<br />
*'''36:''' BONE_LEFTTHUMB<br />
*'''41:''' BONE_LEFTHIP<br />
*'''42:''' BONE_LEFTKNEE<br />
*'''43:''' BONE_LEFTANKLE<br />
*'''44:''' BONE_LEFTFOOT<br />
*'''51:''' BONE_RIGHTHIP<br />
*'''52:''' BONE_RIGHTKNEE<br />
*'''53:''' BONE_RIGHTANKLE<br />
*'''54:''' BONE_RIGHTFOOT<br />
</div><br />
<br />
===Returns===<br />
Returns the x, y, z world position of the bone.<br />
<br />
==Example==<br />
This example renders name tags above a player's head bone.<br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "onClientRender",root,<br />
function( )<br />
local px, py, pz, tx, ty, tz, dist<br />
px, py, pz = getCameraMatrix( )<br />
for _, v in ipairs( getElementsByType ( 'player' ) ) do<br />
tx, ty, tz = getElementPosition( v )<br />
dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 )<br />
if dist < 30.0 then<br />
if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then<br />
local sx, sy, sz = getPedBonePosition( v, 5 )<br />
local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 )<br />
if x then -- getScreenFromWorldPosition returns false if the point isn't on screen<br />
dxDrawText( getPlayerName( v ), x, y, x, y, tocolor(150, 50, 0), 0.85 + ( 15 - dist ) * 0.02, "bankgothic" )<br />
end<br />
end<br />
end<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==Example 2==<br />
This one draw all local player's bones<br />
<syntaxhighlight lang="lua"><br />
addEventHandler('onClientRender', root, function()<br />
for bone = 1, 54 do<br />
local bonePos = {getPedBonePosition(localPlayer, bone)}<br />
if bonePos[1] then<br />
local screen = {getScreenFromWorldPosition(unpack(bonePos))}<br />
if screen[1] then<br />
dxDrawText(''..bone, screen[1], screen[2])<br />
end<br />
end<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_ped_functions}}<br />
<br />
[[hu:getPedBonePosition]]<br />
[[ru:GetPedBonePosition]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=EncodeString&diff=75920EncodeString2023-01-05T15:41:16Z<p>Patrick2562: </p>
<hr />
<div>__NOTOC__<br />
{{Shared function}}<br />
{{New feature/item|3.0156|1.5.5|11849|<br />
This function encodes a [[string]] using the specified algorithm. The counterpart of this function is [[decodeString]].<br />
}}<br />
<br />
{{Tip|If it doesn't matter which algorithm you use for the encoding, keep in mind that ''aes128'' uses hardware acceleration so it may outperform the ''tea'' algorithm on most processors.}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
string encodeString ( string algorithm, string input, table options [, function callback ] ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''algorithm:''' The algorithm to use.<br />
*'''input:''' The input to encode.<br />
*'''options:''' A [[table]] with options and other necessary data for the algorithm, as detailed below.<br />
<br />
===Options for each algorithm===<br />
* ''tea'' ([https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm Tiny Encryption Algorithm])<br />
** '''key''': a key to encode the input with.<br />
{{Added feature/item|1.5.9|1.5.8|20898|<br />
* ''aes128'' ([https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard] in CTR mode)<br />
** '''key''': a key to encode the input with (must be 16 characters long).<br />
|20898}}<br />
{{Added feature/item|1.5.9|1.5.8|21055|<br />
* ''rsa'' ([https://en.wikipedia.org/wiki/RSA_(cryptosystem) Rivest-Shamir-Adleman] in OAEP with SHA-1 mode)<br />
** '''key''': a public key to encode the input. (use [[generateKeyPair]] to create a new private and public key)<br />
|21055}}<br />
<br />
===Optional Arguments===<br />
*'''callback:''' providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.<br />
===Returns for each algorithm===<br />
* ''tea'' <br />
** '''encodedString''': the encoded string if successful, ''false'' otherwise. If a callback was provided, ''true'' is returned immediately, and the encoded string is passed as an argument to the callback.<br />
{{New items|3.0159|1.5.8|<br />
* ''aes128'' <br />
** '''encodedString''': the encoded string if successful, ''false'' otherwise. If a callback was provided, ''true'' is returned immediately, and the encoded string is passed as an argument to the callback.<br />
** '''iv''' ([https://en.wikipedia.org/wiki/Initialization_vector Initialization vector]): this is a string generated by the encryption algorithm that is needed to decrypt the message by [[decodeString]]. If a callback was provided, ''true'' is returned immediately, and the ''iv'' is passed as an argument to the callback.<br />
|20898}}<br />
{{New items|3.0159|1.5.8|<br />
* ''rsa'' <br />
** '''encodedString''': the encoded string if successful, ''false'' otherwise. If a callback was provided, ''true'' is returned immediately, and the encoded string is passed as an argument to the callback.<br />
|21055}}<br />
<br />
==Example== <br />
Adds an ''/encode'' command in which you can provide an algorithm, key and data to encode. Below is the example provided as both server-side and client-side variations.<br />
<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("encode", <br />
function(player, _, algorithm, key, ...)<br />
if algorithm and key then<br />
local text = table.concat({...}, " ")<br />
if type(text) == "string" and text ~= "" then<br />
local encoded = encodeString(algorithm, text, { key = key })<br />
if encoded then<br />
outputChatBox("The result of " .. algorithm .. " encoding is: " .. encoded, player)<br />
else<br />
outputChatBox("Failed to encode. Make sure that all arguments are valid.", player, 255, 0, 0)<br />
end<br />
else<br />
outputChatBox("Please specify text in the command.", player, 255, 0, 0)<br />
end<br />
else<br />
outputChatBox("Invalid algorithm and/or key.", player, 255, 0, 0)<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Utility functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Element_functions&diff=70919Template:Element functions2021-04-24T20:42:14Z<p>Patrick2562: </p>
<hr />
<div>{{New items|3.0158|1.5.7|<br />
*[[addElementDataSubscriber]]<br />
|20477}}<br />
*[[attachElements]]<br />
*[[clearElementVisibleTo]]<br />
*[[cloneElement]]<br />
*[[createElement]]<br />
*[[destroyElement]]<br />
*[[detachElements]]<br />
*[[getAllElementData]]<br />
*[[getAttachedElements]]<br />
*[[getElementAlpha]]<br />
*[[getElementAttachedOffsets]]<br />
*[[getElementAttachedTo]]<br />
*[[getElementCollisionsEnabled]]<br />
*[[getElementByID]]<br />
*[[getElementByIndex]]<br />
*[[getElementChild]]<br />
*[[getElementChildren]]<br />
*[[getElementChildrenCount]]<br />
*[[getElementColShape]]<br />
*[[getElementData]]<br />
*[[getElementDimension]]<br />
*[[getElementHealth]]<br />
*[[getElementID]]<br />
*[[getElementInterior]]<br />
*[[getElementMatrix]]<br />
*[[getElementModel]]<br />
*[[getElementParent]]<br />
*[[getElementPosition]]<br />
*[[getElementRotation]]<br />
*[[getElementSyncer]]<br />
*[[getElementType]]<br />
*[[getElementVelocity]]<br />
*[[getElementZoneName]]<br />
*[[getElementsByType]]<br />
*[[getElementsWithinColShape]]<br />
*[[getElementsWithinRange]]<br />
*[[getLowLODElement]]<br />
*[[getRootElement]]<br />
{{New items|3.0158|1.5.7|<br />
*[[hasElementData]]<br />
|20447}}<br />
{{New items|3.0158|1.5.7|<br />
*[[hasElementDataSubscriber]]<br />
|20477}}<br />
*[[isElement]]<br />
*[[isElementAttached]]<br />
*[[isElementCallPropagationEnabled]]<br />
*[[isElementDoubleSided]]<br />
*[[isElementFrozen]]<br />
*[[isElementInWater]]<br />
*[[isElementLowLOD]]<br />
*[[isElementVisibleTo]]<br />
*[[isElementWithinColShape]]<br />
*[[isElementWithinMarker]]<br />
*[[removeElementData]]<br />
{{New items|3.0158|1.5.7|<br />
*[[removeElementDataSubscriber]]<br />
|20477}}<br />
*[[setElementAlpha]]<br />
{{New items|3.0156|1.5.5|<br />
* [[setElementAngularVelocity]]<br />
* [[getElementAngularVelocity]]<br />
|14165}}<br />
*[[setElementAttachedOffsets]]<br />
*[[setElementCallPropagationEnabled]]<br />
*[[setElementCollisionsEnabled]]<br />
*[[setElementData]]<br />
*[[setElementDimension]]<br />
*[[setElementDoubleSided]]<br />
*[[setElementFrozen]]<br />
*[[setElementHealth]]<br />
*[[setElementID]]<br />
*[[setElementInterior]]<br />
*[[setElementModel]]<br />
*[[setElementParent]]<br />
*[[setElementPosition]]<br />
*[[setElementRotation]]<br />
*[[setElementSyncer]]<br />
*[[setElementVelocity]]<br />
*[[setElementVisibleTo]]<br />
*[[setLowLODElement]]<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Element_events&diff=69672Template:Element events2021-03-20T22:02:38Z<p>Patrick2562: </p>
<hr />
<div>*[[onElementClicked]]<br />
*[[onElementColShapeHit]]<br />
*[[onElementColShapeLeave]]<br />
*[[onElementDataChange]]<br />
*[[onElementDestroy]]<br />
{{New items|3.0160|1.5.8|<br />
*[[onElementDimensionChange]]<br />
|20724}}<br />
{{New items|3.0160|1.5.8|<br />
*[[onElementInteriorChange]]<br />
|20837}}<br />
*[[onElementModelChange]]<br />
*[[onElementStartSync]]<br />
*[[onElementStopSync]]<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Element_events&diff=69671Template:Element events2021-03-20T22:01:41Z<p>Patrick2562: </p>
<hr />
<div>*[[onElementClicked]]<br />
*[[onElementColShapeHit]]<br />
*[[onElementColShapeLeave]]<br />
*[[onElementDataChange]]<br />
*[[onElementDestroy]]<br />
{{New items|3.0160|1.5.8|<br />
*[[onElementDimensionChange]]<br />
*[[onElementInteriorChange]]<br />
|20724}}<br />
*[[onElementModelChange]]<br />
*[[onElementStartSync]]<br />
*[[onElementStopSync]]<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Client_element_events&diff=69670Template:Client element events2021-03-20T22:01:05Z<p>Patrick2562: </p>
<hr />
<div>*[[onClientElementColShapeHit]]<br />
*[[onClientElementColShapeLeave]]<br />
*[[onClientElementDataChange]]<br />
*[[onClientElementDestroy]]<br />
{{New items|3.0160|1.5.8|<br />
*[[onClientElementDimensionChange]]<br />
|20724}}<br />
{{New items|3.0160|1.5.8|<br />
*[[onClientElementInteriorChange]]<br />
|20837}}<br />
{{New items|3.0157|1.5.6|<br />
*[[onClientElementModelChange]]<br />
|16404}}<br />
*[[onClientElementStreamIn]]<br />
*[[onClientElementStreamOut]]<br />
<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Client_element_events&diff=69666Template:Client element events2021-03-20T11:19:48Z<p>Patrick2562: </p>
<hr />
<div>*[[onClientElementColShapeHit]]<br />
*[[onClientElementColShapeLeave]]<br />
*[[onClientElementDataChange]]<br />
*[[onClientElementDestroy]]<br />
{{New items|3.0160|1.5.8|<br />
*[[onClientElementDimensionChange]]<br />
|20724}}<br />
{{New items|3.0160|1.6|<br />
*[[onClientElementInteriorChange]]<br />
|20837}}<br />
{{New items|3.0157|1.5.6|<br />
*[[onClientElementModelChange]]<br />
|16404}}<br />
*[[onClientElementStreamIn]]<br />
*[[onClientElementStreamOut]]<br />
<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OnElementInteriorChange&diff=69656OnElementInteriorChange2021-03-19T01:50:16Z<p>Patrick2562: Undo revision 69653 by Patrick2562 (talk)</p>
<hr />
<div>__NOTOC__<br />
{{Server event}}<br />
{{New feature/item|3.0160|1.5.8|20837|This event is triggered when the interior of an [[element]] is changed using [[setElementInterior]].}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
int oldInterior, int newInterior<br />
</syntaxhighlight><br />
*'''oldInterior''': an [[int]] representing the interior the [[element]] was in before.<br />
*'''newInterior''': an [[int]] representing the interior the [[element]] is in now.<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[element]] that changed its interior.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
local vehicle = createVehicle(411, 0, 0, 3)<br />
setTimer(setElementDimension, 1000, 1, vehicle, 10)<br />
<br />
addEventHandler("onElementInteriorChange", vehicle, function(oldInterior, newInterior)<br />
outputChatBox(inspect(source).."'s interior changed from "..oldInterior.." to "..newInterior)<br />
end)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|1.5.8-9.20837|n/a|}}<br />
<br />
{{See also/Server event|Element events}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OnClientElementInteriorChange&diff=69655OnClientElementInteriorChange2021-03-19T01:50:05Z<p>Patrick2562: Undo revision 69654 by Patrick2562 (talk)</p>
<hr />
<div>__NOTOC__<br />
{{Client event}}<br />
{{New feature/item|3.0160|1.5.8|20837|This event is triggered when the interior of an [[element]] is changed using [[setElementInterior]].}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
int oldInterior, int newInterior<br />
</syntaxhighlight><br />
*'''oldInterior''': an [[int]] representing the interior the [[element]] was in before.<br />
*'''newInterior''': an [[int]] representing the interior the [[element]] is in now.<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[element]] that changed its interior.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
local vehicle = createVehicle(411, 0, 0, 3)<br />
setTimer(setElementInterior, 1000, 1, vehicle, 10)<br />
<br />
addEventHandler("onClientElementInteriorChange", vehicle, function(oldInterior, newInterior)<br />
outputChatBox(inspect(source).."'s interior changed from "..oldInterior.." to "..newInterior)<br />
end)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.5.8-9.20837|}}<br />
<br />
==See Also==<br />
===Client element events===<br />
{{Client_element_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OnClientElementInteriorChange&diff=69654OnClientElementInteriorChange2021-03-19T01:49:41Z<p>Patrick2562: </p>
<hr />
<div>__NOTOC__<br />
{{Client event}}<br />
{{New feature/item|3.0160|1.5.8|20837|This event is triggered when the interior of an [[element]] is changed using [[setElementInterior]].}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
int oldInterior, int newInterior<br />
</syntaxhighlight><br />
*'''oldInterior''': an [[int]] representing the interior the [[element]] was in before.<br />
*'''newInterior''': an [[int]] representing the interior the [[element]] is in now.<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[element]] that changed its interior.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
local vehicle = createVehicle(411, 0, 0, 3)<br />
setTimer(setElementInterior, 1000, 1, vehicle, 10)<br />
<br />
addEventHandler("onClientElementInteriorChange", vehicle, function(oldInterior, newInterior)<br />
outputChatBox(inspect(source).."'s interior changed from "..oldInterior.." to "..newInterior)<br />
end)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|1.5.8-9.20837|1.5.8-9.20837|}}<br />
<br />
==See Also==<br />
===Client element events===<br />
{{Client_element_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OnElementInteriorChange&diff=69653OnElementInteriorChange2021-03-19T01:49:11Z<p>Patrick2562: </p>
<hr />
<div>__NOTOC__<br />
{{Server event}}<br />
{{New feature/item|3.0160|1.5.8|20837|This event is triggered when the interior of an [[element]] is changed using [[setElementInterior]].}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
int oldInterior, int newInterior<br />
</syntaxhighlight><br />
*'''oldInterior''': an [[int]] representing the interior the [[element]] was in before.<br />
*'''newInterior''': an [[int]] representing the interior the [[element]] is in now.<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[element]] that changed its interior.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
local vehicle = createVehicle(411, 0, 0, 3)<br />
setTimer(setElementDimension, 1000, 1, vehicle, 10)<br />
<br />
addEventHandler("onElementInteriorChange", vehicle, function(oldInterior, newInterior)<br />
outputChatBox(inspect(source).."'s interior changed from "..oldInterior.." to "..newInterior)<br />
end)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|1.5.8-9.20837|1.5.8-9.20837|}}<br />
<br />
{{See also/Server event|Element events}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OnElementInteriorChange&diff=69652OnElementInteriorChange2021-03-19T01:47:09Z<p>Patrick2562: Created page with "__NOTOC__ {{Server event}} {{New feature/item|3.0160|1.5.8|20837|This event is triggered when the interior of an element is changed using setElementInterior.}} ==Para..."</p>
<hr />
<div>__NOTOC__<br />
{{Server event}}<br />
{{New feature/item|3.0160|1.5.8|20837|This event is triggered when the interior of an [[element]] is changed using [[setElementInterior]].}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
int oldInterior, int newInterior<br />
</syntaxhighlight><br />
*'''oldInterior''': an [[int]] representing the interior the [[element]] was in before.<br />
*'''newInterior''': an [[int]] representing the interior the [[element]] is in now.<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[element]] that changed its interior.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
local vehicle = createVehicle(411, 0, 0, 3)<br />
setTimer(setElementDimension, 1000, 1, vehicle, 10)<br />
<br />
addEventHandler("onElementInteriorChange", vehicle, function(oldInterior, newInterior)<br />
outputChatBox(inspect(source).."'s interior changed from "..oldInterior.." to "..newInterior)<br />
end)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|1.5.8-9.20837|n/a|}}<br />
<br />
{{See also/Server event|Element events}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Ped_events&diff=69651Template:Ped events2021-03-19T01:43:35Z<p>Patrick2562: </p>
<hr />
<div>*[[onPedVehicleEnter]]<br />
*[[onPedVehicleExit]]<br />
*[[onPedWasted]]<br />
*[[onPedWeaponSwitch]]<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Element_events&diff=69650Template:Element events2021-03-19T01:42:38Z<p>Patrick2562: </p>
<hr />
<div>*[[onElementClicked]]<br />
*[[onElementColShapeHit]]<br />
*[[onElementColShapeLeave]]<br />
*[[onElementDataChange]]<br />
*[[onElementDestroy]]<br />
*[[onElementDimensionChange]]<br />
{{New items|3.0160|1.5.8|<br />
*[[onElementInteriorChange]]<br />
|20837}}<br />
*[[onElementModelChange]]<br />
*[[onElementStartSync]]<br />
*[[onElementStopSync]]<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Client_resource_events&diff=69649Template:Client resource events2021-03-19T01:38:24Z<p>Patrick2562: </p>
<hr />
<div>*[[onClientResourceFileDownload]]<br />
*[[onClientResourceStart]]<br />
*[[onClientResourceStop]]<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Client_other_events&diff=69648Template:Client other events2021-03-19T01:37:50Z<p>Patrick2562: </p>
<hr />
<div>*[[onClientChatMessage]]<br />
*[[onClientConsole]]<br />
*[[onClientDebugMessage]]<br />
*[[onClientExplosion]]<br />
*[[onClientFileDownloadComplete]]<br />
*[[onClientHUDRender]]<br />
*[[onClientMinimize]]<br />
*[[onClientPedsProcessed]]<br />
*[[onClientPlayerNetworkStatus]]<br />
*[[onClientPreRender]]<br />
*[[onClientRender]]<br />
*[[onClientRestore]]<br />
*[[onClientTransferBoxProgressChange]]<br />
*[[onClientTransferBoxVisibilityChange]]<br />
{{New items|3.0157|1.5.6|<br />
*[[onClientWorldSound]]<br />
|14652}}<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Client_ped_events&diff=69647Template:Client ped events2021-03-19T01:33:58Z<p>Patrick2562: </p>
<hr />
<div>*[[onClientPedDamage]]<br />
*[[onClientPedHeliKilled]]<br />
*[[onClientPedHitByWaterCannon]]<br />
*[[onClientPedVehicleEnter]]<br />
*[[onClientPedVehicleExit]]<br />
*[[onClientPedWasted]]<br />
*[[onClientPedWeaponFire]]<br />
{{New feature/item|3.0157|1.5.6|14735|<br />
*[[onClientPedStep]]<br />
}}<br />
<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Template:Client_element_events&diff=69646Template:Client element events2021-03-19T01:32:01Z<p>Patrick2562: </p>
<hr />
<div>*[[onClientElementColShapeHit]]<br />
*[[onClientElementColShapeLeave]]<br />
*[[onClientElementDataChange]]<br />
*[[onClientElementDestroy]]<br />
*[[onClientElementDimensionChange]]<br />
{{New items|3.0160|1.5.8|<br />
*[[onClientElementInteriorChange]]<br />
|20837}}<br />
*[[onClientElementModelChange]]<br />
*[[onClientElementStreamIn]]<br />
*[[onClientElementStreamOut]]<br />
<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OnClientElementInteriorChange&diff=69645OnClientElementInteriorChange2021-03-19T01:27:40Z<p>Patrick2562: Created page with "__NOTOC__ {{Client event}} {{New feature/item|3.0160|1.5.8|20837|This event is triggered when the interior of an element is changed using setElementInterior.}} ==Para..."</p>
<hr />
<div>__NOTOC__<br />
{{Client event}}<br />
{{New feature/item|3.0160|1.5.8|20837|This event is triggered when the interior of an [[element]] is changed using [[setElementInterior]].}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
int oldInterior, int newInterior<br />
</syntaxhighlight><br />
*'''oldInterior''': an [[int]] representing the interior the [[element]] was in before.<br />
*'''newInterior''': an [[int]] representing the interior the [[element]] is in now.<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[element]] that changed its interior.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
local vehicle = createVehicle(411, 0, 0, 3)<br />
setTimer(setElementInterior, 1000, 1, vehicle, 10)<br />
<br />
addEventHandler("onClientElementInteriorChange", vehicle, function(oldInterior, newInterior)<br />
outputChatBox(inspect(source).."'s interior changed from "..oldInterior.." to "..newInterior)<br />
end)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.5.8-9.20837|}}<br />
<br />
==See Also==<br />
===Client element events===<br />
{{Client_element_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Modules/MTA-MySQL&diff=67775Modules/MTA-MySQL2020-11-21T13:21:46Z<p>Patrick2562: </p>
<hr />
<div><pageclass class="#AA7592" subcaption="MTA-MySQL Module"></pageclass><br />
<div style="font-size: 4em; line-height: 1em;">{{Warning|We don't provide any support for this module!}}</div><br />
<br><br />
<div style="font-size: 10em; line-height: 1em;">{{Warning|This module is too old, please use [[dbConnect]] instead.}}</div><br />
{{Module_Info|<br />
name = MTA MySQL |<br />
version = 0.5 |<br />
author = [[User:ryden|Alberto Alonso (ryden)]] |<br />
author2 = [[User:ryden|Alberto Alonso (ryden)]] |<br />
module_website = [http://code.google.com/p/multitheftauto-modules Here] |<br />
download_link = [https://nightly.mtasa.com/files/modules/32/mta_mysql.dll Windows 32 bit]<br/>[https://nightly.mtasa.com/files/modules/64/mta_mysql.dll Windows 64 bit]<br />
[https://nightly.mtasa.com/files/modules/32/mta_mysql.so Linux 32 bit]<br/>[https://nightly.mtasa.com/files/modules/64/mta_mysql.so Linux 64 bit] |<br />
license = [http://www.opensource.org/licenses/bsd-license.php BSD] |<br />
written_in = C++ |<br />
operating_system = Cross-platform |<br />
compatible_with = DP2.x & 1.X |<br />
}}<br />
MTA MySQL is an alternative to the default [[Modules/MySQL|ml_mysql]] module provided by the MTA team.<br />
It is available for Windows and GNU/Linux and provides the source code.<br />
<br />
''Note: From version 0.4 it supports both DP2.3 and 1.0 servers.''<br />
<br />
==Installation==<br />
===Windows===<br />
'''32 bit:''' Copy 32 bit mta_mysql.dll into the '''MTA San Andreas\server\mods\deathmatch\modules\''' directory.<br/><br />
''(You might also need to install [https://nightly.mtasa.com/files/vcredist_2013_x86.exe 32 bit VS2013 Runtime Redist])''<br />
<br />
'''64 bit:''' Copy 64 bit mta_mysql.dll into the '''MTA San Andreas\server\x64\modules\''' directory.<br/><br />
''(You might also need to install [https://nightly.mtasa.com/files/vcredist_2013_x64.exe 64 bit VS2013 Runtime Redist])''<br />
<br />
Then, add the following line in mtaserver.conf:<br />
<syntaxhighlight lang="xml"><br />
<module src="mta_mysql.dll" /><br />
</syntaxhighlight><br />
<br />
===GNU/Linux===<br />
'''32 bit:''' Copy 32 bit mta_mysql.so into the '''mods/deathmatch/modules/''' directory.<br/><br />
<br />
'''64 bit:''' Copy 64 bit mta_mysql.so into the '''x64/modules/''' directory.<br />
<br />
Then, add the following line in mtaserver.conf:<br />
<syntaxhighlight lang="xml"><br />
<module src="mta_mysql.so" /><br />
</syntaxhighlight><br />
<br />
<br />
To fix '''MODULE: Unable to find modules/mta_mysql.so (libmysqlclient.so.16: cannot open shared object file: No such file or directory)!''' copy ''libmysqlclient.so.16'' into '''/usr/lib''' ([https://nightly.mtasa.com/files/modules/32/libmysqlclient.so.16 32 bit], [https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16 64 bit])<br />
<br />
'''If you experience an error on Unix systems:'''<br />
Try to add port and socket parameters to your mysql_connect.<br />
<br />
==Handler functions==<br />
{{Modules/MTA-MySQL/Handler_functions}}<br />
<br />
==Result managing functions==<br />
{{Modules/MTA-MySQL/Result_functions}}<br />
<br />
==Version 0.5 calling method==<br />
From version 0.5 onwards you can call all this module functions, except mysql_connect and mysql_null, as if they are methods of an object.<br />
<br />
For example, having a valid MySQL handler, you can do handler:query ( "SELECT * FROM table" ) instead of mysql_query ( handler, "SELECT * FROM table" ).<br />
<br />
===Function aliases===<br />
A function alias is a second name for a function, which makes calling any of the original name or the alias have the same result. The new aliases introduced in version 0.5 are:<br />
* result:num_rows() is the same as result:numrows()<br />
* result:num_fields() is the same as result:numfields()<br />
* result:free_result() is the same as result:free()<br />
<br />
[[Category:Modules]]<br />
<br />
[[ru:Modules/MTA-MySQL]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Modules/MTA-MySQL&diff=67738Modules/MTA-MySQL2020-11-14T21:11:08Z<p>Patrick2562: Undo revision 67405 by 506 (talk)</p>
<hr />
<div><pageclass class="#AA7592" subcaption="MTA-MySQL Module"></pageclass><br />
<div style="font-size: 10em; line-height: 1em;">{{Warning|This module is too old, please use [[dbConnect]] instead.}}</div><br />
{{Module_Info|<br />
name = MTA MySQL |<br />
version = 0.5 |<br />
author = [[User:ryden|Alberto Alonso (ryden)]] |<br />
author2 = [[User:ryden|Alberto Alonso (ryden)]] |<br />
module_website = [http://code.google.com/p/multitheftauto-modules Here] |<br />
download_link = [https://nightly.mtasa.com/files/modules/32/mta_mysql.dll Windows 32 bit]<br/>[https://nightly.mtasa.com/files/modules/64/mta_mysql.dll Windows 64 bit]<br />
[https://nightly.mtasa.com/files/modules/32/mta_mysql.so Linux 32 bit]<br/>[https://nightly.mtasa.com/files/modules/64/mta_mysql.so Linux 64 bit] |<br />
license = [http://www.opensource.org/licenses/bsd-license.php BSD] |<br />
written_in = C++ |<br />
operating_system = Cross-platform |<br />
compatible_with = DP2.x & 1.X |<br />
}}<br />
MTA MySQL is an alternative to the default [[Modules/MySQL|ml_mysql]] module provided by the MTA team.<br />
It is available for Windows and GNU/Linux and provides the source code.<br />
<br />
''Note: From version 0.4 it supports both DP2.3 and 1.0 servers.''<br />
<br />
==Installation==<br />
===Windows===<br />
'''32 bit:''' Copy 32 bit mta_mysql.dll into the '''MTA San Andreas\server\mods\deathmatch\modules\''' directory.<br/><br />
''(You might also need to install [https://nightly.mtasa.com/files/vcredist_2013_x86.exe 32 bit VS2013 Runtime Redist])''<br />
<br />
'''64 bit:''' Copy 64 bit mta_mysql.dll into the '''MTA San Andreas\server\x64\modules\''' directory.<br/><br />
''(You might also need to install [https://nightly.mtasa.com/files/vcredist_2013_x64.exe 64 bit VS2013 Runtime Redist])''<br />
<br />
Then, add the following line in mtaserver.conf:<br />
<syntaxhighlight lang="xml"><br />
<module src="mta_mysql.dll" /><br />
</syntaxhighlight><br />
<br />
===GNU/Linux===<br />
'''32 bit:''' Copy 32 bit mta_mysql.so into the '''mods/deathmatch/modules/''' directory.<br/><br />
<br />
'''64 bit:''' Copy 64 bit mta_mysql.so into the '''x64/modules/''' directory.<br />
<br />
Then, add the following line in mtaserver.conf:<br />
<syntaxhighlight lang="xml"><br />
<module src="mta_mysql.so" /><br />
</syntaxhighlight><br />
<br />
<br />
To fix '''MODULE: Unable to find modules/mta_mysql.so (libmysqlclient.so.16: cannot open shared object file: No such file or directory)!''' copy ''libmysqlclient.so.16'' into '''/usr/lib''' ([https://nightly.mtasa.com/files/modules/32/libmysqlclient.so.16 32 bit], [https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16 64 bit])<br />
<br />
'''If you experience an error on Unix systems:'''<br />
Try to add port and socket parameters to your mysql_connect.<br />
<br />
==Handler functions==<br />
{{Modules/MTA-MySQL/Handler_functions}}<br />
<br />
==Result managing functions==<br />
{{Modules/MTA-MySQL/Result_functions}}<br />
<br />
==Version 0.5 calling method==<br />
From version 0.5 onwards you can call all this module functions, except mysql_connect and mysql_null, as if they are methods of an object.<br />
<br />
For example, having a valid MySQL handler, you can do handler:query ( "SELECT * FROM table" ) instead of mysql_query ( handler, "SELECT * FROM table" ).<br />
<br />
===Function aliases===<br />
A function alias is a second name for a function, which makes calling any of the original name or the alias have the same result. The new aliases introduced in version 0.5 are:<br />
* result:num_rows() is the same as result:numrows()<br />
* result:num_fields() is the same as result:numfields()<br />
* result:free_result() is the same as result:free()<br />
<br />
[[Category:Modules]]<br />
<br />
[[ru:Modules/MTA-MySQL]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=RemoveWorldModel&diff=67640RemoveWorldModel2020-10-25T14:55:44Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
<!--<br />
{{Note box|Pre r4844: There are two types of world objects Binary IPL (anything not in data/maps and in gta3.img) and data IPL (anything in data/maps) Binary IPL removal requires a stream out if you are deleting anything within 300 units (anything visible) you can just move the camera to do this. Data IPL are removed instantly and this is not required. Also LOD objects are not removed automatically so you need to remove them separately.}}<br />
--><br />
This function is used to remove a world object.<br />
<!--<br />
{{Tip|Pre r4844: It is strongly advised that you use this server side rather than client side because it will just function infinitely better as you should not need to handle streaming it out/back in.}}<br />
--><br />
==Syntax== <br />
<syntaxhighlight lang="lua">bool removeWorldModel ( int modelID, float radius, float x, float y, float z [, int interior = -1 ] )</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''modelID:''' A whole integer specifying the GTASA object model ID.<br />
*'''radius:''' A floating point number representing the radius that will be eliminated.<br />
*'''x:''' A floating point number representing the X coordinate on the map.<br />
*'''y:''' A floating point number representing the Y coordinate on the map.<br />
*'''z:''' A floating point number representing the Z coordinate on the map.<br />
<br />
===Optional Arguments=== <br />
{{New items|3.0132|1.3.2|<br />
*'''interior:''' The interior ID to apply the removal to. Some objects in interior 13 show in all interiors so if you want to remove everything in interior 0 also remove everything in interior 13. A value of -1 here will affect all interiors.}}<br />
===Returns===<br />
Returns ''true'' if the [[object]] was removed, ''false'' if invalid arguments were passed.<br />
<br />
==Requirements==<br />
{{Requirements|1.2.0-9.03618|1.2.0-9.03618|}}<br />
<br />
==Example== <br />
This example will removes buildings on BigEar:<br />
<syntaxhighlight lang="lua"><br />
removeWorldModel(16617, 1000, -300, 1556, 75) --lod<br />
removeWorldModel(16616, 1000, -300, 1556, 75) --lod<br />
removeWorldModel(16615, 1000, -300, 1556, 75) --lod<br />
removeWorldModel(16138, 1000, -300, 1556, 75) -- model<br />
</syntaxhighlight><br />
<br />
This example removes CJ house:<br />
<syntaxhighlight lang="lua"><br />
for i = 700, 19999 do<br />
removeWorldModel(i, 10, 2494, -1696, 17)<br />
end<br />
</syntaxhighlight><br />
<br />
This server script example removes all models, everywhere:<br />
<syntaxhighlight lang="lua"><br />
for i = 550, 19999 do<br />
removeWorldModel(i, 10000, 0, 0, 0)<br />
end<br />
setOcclusionsEnabled(false) -- Also disable occlusions when removing certain models<br />
setWaterLevel(-5000) -- Also hide the default water as it will be full of holes<br />
</syntaxhighlight><br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.3.1-9.04636|Added interior argument}}<br />
{{ChangelogItem|1.3.1-9.04844|Everything streams out fine now.}}<br />
<br />
==See Also==<br />
{{Client_world_functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Changes_in_1.5.8&diff=67528Changes in 1.5.82020-10-12T11:27:46Z<p>Patrick2562: </p>
<hr />
<div><pageclass class="#39dd57" subcaption="Current release"></pageclass><br />
{{Changelogs}}<br />
__NOTOC__<br />
* GitHub commit log: https://github.com/multitheftauto/mtasa-blue/compare/1.5.7...master<br />
* GitHub milestone: https://github.com/multitheftauto/mtasa-blue/milestone/2<br />
* So far https://github.com/multitheftauto/mtasa-blue/compare/6941e0b...master<br />
<br />
'''This changelog is partial and needs updating.'''<br />
<br />
<br />
== Main Additions / Changes ==<br />
<section show="true"><br />
* Add [[dxDrawPrimitive3D]] and [[dxDrawMaterialPrimitive3D]] ([https://github.com/multitheftauto/mtasa-blue/pull/760 #760] by '''CrosRoad95''')<br />
* Add functions to modify dynamic objects' behaviour ([https://github.com/multitheftauto/mtasa-blue/pull/784 #784] by '''forkerer''')<br />
* Add dynamic ped ID allocating using [[engineRequestModel]] and [[engineFreeModel]] ([https://github.com/multitheftauto/mtasa-blue/commit/475544f1753ce1af24c4cdff7f0d0be48ede709b #349] by '''lopezloo''' + '''Neproify''' + '''Arran''' + '''qaisjp''')<br />
* Add functions to manipulate colshapes parameters ([https://github.com/multitheftauto/mtasa-blue/pull/1215 #1215] by '''StrixG''')<br />
* Add element data subscription functionality ([https://github.com/multitheftauto/mtasa-blue/pull/1055 #1055] by '''tederis''') <br />
* Add [[engineGetModelTextures]] function ([https://github.com/multitheftauto/mtasa-blue/pull/1058 #1058] by '''Lpsd''')<br />
* Improve trailer sync ([https://github.com/multitheftauto/mtasa-blue/pull/1247 #1247] by '''tederis''')<br />
</section><br />
* Added wheel scaling functions ([https://github.com/multitheftauto/mtasa-blue/pull/1641 #1641], [https://github.com/multitheftauto/mtasa-blue/pull/1644 #1644], and [https://github.com/multitheftauto/mtasa-blue/pull/1648 #1648] by '''AlexTMjugador''')<br />
<br />
== Statistics ==<br />
<section show="true"><br />
These are some statistics since the [[Changes in 1.5.7|previous release]].<br />
* This is the '''25<sup>th</sup>''' 1.x.x release<br />
* '''{{date difference|2019|8|31}}''' days<br />
* '''1''' deprecation<br />
* '''5''' announced backwards incompatible changes<br />
* '''37''' new functions<br />
* '''61+''' bug fixes and changes<br />
* '''463''' commits ([https://github.com/multitheftauto/mtasa-blue/compare/1.5.7...master see comparison])<br />
* '''196''' new open GitHub issues ([https://github.com/multitheftauto/mtasa-blue/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+created%3A%3E%3D2019-08-31 see list])<br />
* '''102''' resolved GitHub issues ([https://github.com/multitheftauto/mtasa-blue/issues?utf8=%E2%9C%93&q=is%3Aclosed+is%3Aissue+milestone%3A1.5.8 see list])<br />
* '''108''' closed GitHub issues ([https://github.com/multitheftauto/mtasa-blue/issues?utf8=%E2%9C%93&q=is%3Aclosed+is%3Aissue+closed%3A%3E%3D2019-08-31+no%3Amilestone see list])<br />
* '''47''' new open GitHub pull requests ([https://github.com/multitheftauto/mtasa-blue/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+created%3A%3E%3D2019-08-31 see list])<br />
* '''192''' merged GitHub pull requests ([https://github.com/multitheftauto/mtasa-blue/pulls?q=is%3Apr+milestone%3A1.5.8+is%3Amerged see list])<br />
* '''36''' closed GitHub pull requests ([https://github.com/multitheftauto/mtasa-blue/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aunmerged+closed%3A%3E%3D2019-08-31 see list])<br />
* '''37''' contributors of which '''27''' are new ([https://github.com/multitheftauto/mtasa-blue/graphs/contributors?from=2019-08-31&to=2020-08-31&type=c see list])<br />
* '''98+''' total contributors ([https://github.com/multitheftauto/mtasa-blue/graphs/contributors see list])<br />
* '''4''' vendor updates<br />
<br />
<!--<br />
We don't have the https://www.mediawiki.org/wiki/Extension:Variables extension installed,<br />
so remember to update the date in all parts below.<br />
--><br />
<sub>'''Note:''' Last update to these statistics was made<br />
{{#ifeq: {{date difference|2020|8|8}} | 0 | today |<br />
{{#ifeq: {{date difference|2020|8|8}} | 1 | yesterday |<br />
{{date difference|2020|8|8}} days ago<br />
}}<br />
}}.</sub><br />
</section><br />
<br />
== Scripting ==<br />
<section show="true"><br />
=== 5 Backwards Incompatible Changes ===<br />
These changes will take effect in 1.6:<br />
* [[callRemote]] callbacks currently set the error code to '''nil''' when there is no error. In 1.6, to be consistent with [[fetchRemote]], the error code reported will be '''0'''. See [https://github.com/multitheftauto/mtasa-blue/issues/294 GitHub #294].<br />
* Since July 2016 if you provide an invalid string like '''"randomstring"''' when a function expects a number, the string will be treated as '''0''' and raise a script warning. In 1.6 this will be an error. You will still be able to provide strings containing numbers (e.g. '''"100"''' and '''"12.34"'''), this change only affects invalid strings. See [https://github.com/multitheftauto/mtasa-blue/issues/1043 GitHub #1043].<br />
* When providing a width and height of (0, 0) to [[createBrowser]] or [[guiCreateBrowser]] you will encounter a script error instead of a warning. The warning was introduced Feb 2019. See [https://github.com/multitheftauto/mtasa-blue/issues/1069 GitHub #1069].<br />
* Some functions expect only unsigned integers (positive numbers), and since Jan 2016 providing negative numbers would be a warning. This will now be an error. See [https://github.com/multitheftauto/mtasa-blue/issues/1070 GitHub #1070].<br />
* Since Aug 2015, we replaced the custom '''mtalocal://''' URL scheme with '''http://mta/resourceName/blah.html'''. This '''mtalocal://''' URL scheme will now be removed. See [https://github.com/multitheftauto/mtasa-blue/issues/1071 GitHub #1071].<br />
<br />
This list is inconclusive and we may introduce more changes later.<br />
</section><br />
<br />
<br />
== Client ==<br />
<section show="true"><br />
=== 21 New Functions ===<br />
* Add [[setPedFightingStyle]] (previously available server-side only) ([https://github.com/multitheftauto/mtasa-blue/pull/810 #810] by '''StrixG''')<br />
* Add [[setPedArmor]] (previously available server-side only) ([https://github.com/multitheftauto/mtasa-blue/pull/811 #811] by '''StrixG''')<br />
* Add [[areVehicleLightsOn]] ([https://github.com/multitheftauto/mtasa-blue/pull/938 #938] by '''StrixG''')<br />
* Add [[dxDrawPrimitive3D]] and [[dxDrawMaterialPrimitive3D]] ([https://github.com/multitheftauto/mtasa-blue/pull/760 #760] by '''CrosRoad95''')<br />
* Add functions to modify dynamic objects' behaviour ([https://github.com/multitheftauto/mtasa-blue/pull/784 #784] by '''forkerer''')<br />
** [[engineGetModelPhysicalPropertiesGroup]]<br />
** [[engineRestoreModelPhysicalPropertiesGroup]]<br />
** [[engineSetModelPhysicalPropertiesGroup]]<br />
** [[engineGetObjectGroupPhysicalProperty]]<br />
** [[engineRestoreObjectGroupPhysicalProperties]]<br />
** [[engineSetObjectGroupPhysicalProperty]]<br />
* Add dynamic ped ID allocating using [[engineRequestModel]] and [[engineFreeModel]] ([https://github.com/multitheftauto/mtasa-blue/commit/475544f1753ce1af24c4cdff7f0d0be48ede709b #349] by '''lopezloo''' + '''Neproify''' + '''Arran''' + '''qaisjp''')<br />
* Add [[engineResetModelLODDistance]] function ([https://github.com/multitheftauto/mtasa-blue/pull/971 #971] by '''Lpsd''')<br />
* Add [[engineGetModelTextures]] function ([https://github.com/multitheftauto/mtasa-blue/pull/1058 #1058] by '''Lpsd''')<br />
* Add [[resetBlurLevel]] function ([https://github.com/multitheftauto/mtasa-blue/pull/1266 #1266] by '''Luxy.c''')<br />
* Add [[dxGetTextSize]] function ([https://github.com/multitheftauto/mtasa-blue/pull/935 #935] by '''StrixG''')<br />
* Add functions to modify vehicle wheels, visibly and in collision by ([https://github.com/multitheftauto/mtasa-blue/pull/1641 #1641], [https://github.com/multitheftauto/mtasa-blue/pull/1644 #1644], and [https://github.com/multitheftauto/mtasa-blue/pull/1648 #1648] by '''AlexTMjugador''')<br />
** [[getVehicleWheelScale]]<br />
** [[getVehicleModelWheelSize]]<br />
** [[setVehicleWheelScale]]<br />
** [[setVehicleModelWheelSize]]<br />
<br />
=== 45 Bug Fixes & Changes ===<br />
* Add new client setting to toggle external sounds ([https://github.com/multitheftauto/mtasa-blue/pull/834 #834] by '''patrikjuvonen''')<br />
* Fix crash when attempting to stream out a sound that's not streamed in (See commit [https://github.com/multitheftauto/mtasa-blue/commit/e1b7c730448d12a5eeb452239e8053e86924294f e1b7c73] by '''sbx320''')<br />
* Fix [[dxDrawCircle]] ''segments'' argument being wrongly offset by one ([https://github.com/multitheftauto/mtasa-blue/pull/1079 #1079] by '''ApeLsiN4eG''')<br />
* Fix potential crash when moving objects (See commit [https://github.com/multitheftauto/mtasa-blue/commit/90895c221549893501f5f717af3ca56878e29b5d 90895c2] by '''botder''')<br />
* Update credits (See commit [https://github.com/multitheftauto/mtasa-blue/commit/39227d795efafe940dc6c317c20b0162b1bd0bb3 39227d7] by '''qaisjp''')<br />
* Don't apply damage to peds without a game entity (See commit [https://github.com/multitheftauto/mtasa-blue/commit/632130e36a96071290593fc3c677a536f7b19e1f 632130e] by '''botder''')<br />
* Fix doors state with setElementModel ([https://github.com/multitheftauto/mtasa-blue/pull/599 #599] by '''FileEX''')<br />
* Add CVAR _beta_qc_rightclick_command allowing you to reconnect by right clicking the "Quick Connect" button on the main menu (See commit [https://github.com/multitheftauto/mtasa-blue/commit/d1c60675fc0f0f62b69707ae81a82e6bbdf36042 d1c60675] by '''qaisjp''')<br />
* Add more data to [[getPedAnimation]] ([https://github.com/multitheftauto/mtasa-blue/pull/892 #892] by '''Dezash''')<br />
* Add missing destroy method to DxFont ([https://github.com/multitheftauto/mtasa-blue/pull/1259 #1259] by '''MegadreamsBE''')<br />
* Increase [[setPedAnimationSpeed]] limit (See commit [https://github.com/multitheftauto/mtasa-blue/commit/4c36d37056d2a1496904f394bf96303dd0f2b4c5 4c36d37] by '''qaisjp''')<br />
* Fix "ancient" weapon fire crash ([https://github.com/multitheftauto/mtasa-blue/pull/1109 #1109] by '''saml1er''')<br />
* Fix [[bitExtract]] (See commit [https://github.com/multitheftauto/mtasa-blue/commit/aa2df39d3e40e5b446ffea376ef96df89916a9d0 aa2df39d] by '''ccw808''')<br />
* Fix texture blending ([https://github.com/multitheftauto/mtasa-blue/pull/1098 #1098] by '''StrixG''')<br />
* Add client setting to toggle internet sound streams ([https://github.com/multitheftauto/mtasa-blue/pull/834 #834] by '''patrikjuvonen''')<br />
* Implement "remember this option" checkbox to NVidia Optimus dialog ([https://github.com/multitheftauto/mtasa-blue/pull/1177 #1177] by '''Lpsd''')<br />
* Fix inability to crouch when player has 1 HP ([https://github.com/multitheftauto/mtasa-blue/pull/1138 #1138] by '''CrosRoad95''')<br />
* Improve trailer sync ([https://github.com/multitheftauto/mtasa-blue/pull/1247 #1247] by '''tederis''')<br />
* Fix driveby for peds ([https://github.com/multitheftauto/mtasa-blue/pull/1290 #1290] by '''Zangomangu''')<br />
* Add "SettingHighDetailPeds" to [[dxGetStatus]] ([https://github.com/multitheftauto/mtasa-blue/pull/1384 #1384] by '''Patrick2562''')<br />
* Add feature to remove server from the "Recent" tab in server browser ([https://github.com/multitheftauto/mtasa-blue/pull/1381 #1381] by '''ecastro98''')<br />
* Fix [[warpPedIntoVehicle]] failure when there are too many vehicles streamed in ([https://github.com/multitheftauto/mtasa-blue/pull/1431 #1431] by '''saml1er''')<br />
* Fix issue with [[engineReplaceModel]] kicking the player out of the vehicle ([https://github.com/multitheftauto/mtasa-blue/pull/1433 #1433] by '''saml1er''')<br />
* Moved exe patching to loader ([https://github.com/multitheftauto/mtasa-blue/pull/1520 #1520] by '''ccw808''')<br />
* Fix various return values when using OOP (e.g: [https://github.com/multitheftauto/mtasa-blue/commit/5110559b7a7f2d258f01be1dce18fe63d8bca400 5110559b], [https://github.com/multitheftauto/mtasa-blue/commit/88379b8ded766b2d35e171b6d11ef33cb2663b96 88379b8d] by '''qaisjp''')<br />
* Fixed incorrect VRAM detection ([https://github.com/multitheftauto/mtasa-blue/pull/1589 #1589] by '''TheNormalnij''')<br />
* Add ability to play sounds from raw data to playSound(3D) ([https://github.com/multitheftauto/mtasa-blue/pull/1234 #1234] by '''Dezash''')<br />
* Allow downloading of files from other resources ([https://github.com/multitheftauto/mtasa-blue/pull/945 #945] by '''TheNormalnij''') - this affects:<br />
** [[downloadFile]]<br />
** [[onClientFileDownloadComplete]]<br />
* Add ability to get raw controller analog value ([https://github.com/multitheftauto/mtasa-blue/pull/1165 #1165] by '''Addlibs''')<br />
* Add user agent workaround for YouTube TV ([https://github.com/multitheftauto/mtasa-blue/pull/1243 #1243] by '''qaisjp''')<br />
* Add missing destroy method to DxFont ([https://github.com/multitheftauto/mtasa-blue/pull/1259 #1259] by '''MegadreamsBE''')<br />
* Fix engineReplaceModel memory leak ([https://github.com/multitheftauto/mtasa-blue/pull/1265 #1265] by '''saml1er''')<br />
* Fix vehicle model memory leaks (See commit [https://github.com/multitheftauto/mtasa-blue/commit/46dbbe7dd2c4621d7564cf272e8a432cf9f57300 46dbbe7] by '''saml1er''')<br />
* Fix texture memory leak (See commit [https://github.com/multitheftauto/mtasa-blue/commit/d5722d5ac5c0ed0210849bf03c263ec88ea98c2a d5722d5] by '''saml1er''')<br />
* Enable enter_exit for peds to fix alternative attack ([https://github.com/multitheftauto/mtasa-blue/pull/1295 #1295] by '''Zangomangu''')<br />
* Fix "Select device" hides under other program without MTA icon on a taskbar (See commit [https://github.com/multitheftauto/mtasa-blue/commit/2c5251a42a640ccc9ffa928cb2844c9295f47c6c 2c5251a] by '''ccw808''')<br />
* Fix primitive colors are always white ([https://github.com/multitheftauto/mtasa-blue/pull/1312 #1312] by '''StrixG''')<br />
* Add analog control sync for accelerate and brake_reverse ([https://github.com/multitheftauto/mtasa-blue/pull/1164 #1164] by '''Addlibs''')<br />
* Fix resetting dummies in vehicles with replaced models ([https://github.com/multitheftauto/mtasa-blue/pull/1059 #1059] by '''forkerer''' and '''saml1er''')<br />
* Return vector3 instead of number at ped's target ([https://github.com/multitheftauto/mtasa-blue/pull/1379 #1379] by '''ecastro98''')<br />
* Fix replaced weapon_crouch anim does not play if retainPedState is true ([https://github.com/multitheftauto/mtasa-blue/pull/1414 #1414] by '''saml1er''')<br />
* Fix nametags are interiorless ([https://github.com/multitheftauto/mtasa-blue/commit/3df58bd435b3c4052fa5e7fe57d534bdca7e0d2b 3df58bd] by '''qaisjp''')<br />
* Remove amx from the installer (See commit [https://github.com/multitheftauto/mtasa-blue/commit/7d4091fac6e41e6d9e199cd0a03c927dc48aac79 7d4091f] by '''qaisjp''')<br />
* Potential fix for vehicle dummies crash ([https://github.com/multitheftauto/mtasa-blue/pull/1524 #1524] by '''saml1er''')<br />
* Add projectiles support for [[getElementModel]] ([https://github.com/multitheftauto/mtasa-blue/pull/1550 #1550] by '''StrixG''')<br />
<br />
<br />
=== 2 Vendor Updates ===<br />
* Update BASS libraries ([https://github.com/multitheftauto/mtasa-blue/pull/1551 #1551] by '''Dutchman101''')<br />
* Update CEF from 76.1.13+gf19c584 (Chromium 76.0.3809.132) to 81.3.10+gb223419 ([https://chromereleases.googleblog.com/2020/05/stable-channel-update-for-desktop.html Chromium 81.0.4044.138]) (See commit [https://github.com/multitheftauto/mtasa-blue/commit/8d2d0fb20fb094119e86e348340f5cb90e30dc16 8d2d0fb] by '''qaisjp''')<br />
</section><br />
<br />
<br />
== Server ==<br />
<section show="true"><br />
=== 3 New Functions ===<br />
* Add [[setPlayerScriptDebugLevel]] and [[getPlayerScriptDebugLevel]] ([https://github.com/multitheftauto/mtasa-blue/pull/826 #826] by '''knitz12''')<br />
* Add [[isResourceProtected]] function ([https://github.com/multitheftauto/mtasa-blue/pull/1254 #1254] by '''StrixG''')<br />
<br />
<!--<br />
==== New Events ====<br />
* Placeholder<br />
<br />
==== Deprecations ====<br />
* Placeholder<br />
<br />
==== New Arguments & Parameters ====<br />
* Placeholder<br />
--><br />
<br />
=== 9 Bug Fixes & Changes ===<br />
* Fix [[iprint]] to be able to read and output nil arguments properly ([https://github.com/multitheftauto/mtasa-blue/pull/1064 #1064] by '''TheNormalnij''')<br />
* Accept team & table of players in [[outputChatBox]] ([https://github.com/multitheftauto/mtasa-blue/pull/1213 #1213] by '''StrixG''')<br />
* Fix /msg command duplicating when sent by Server Console ([https://github.com/multitheftauto/mtasa-blue/pull/1411 #1411] by '''Dezash''')<br />
* Make colshapes cloneable ([https://github.com/multitheftauto/mtasa-blue/pull/1214 #1214] by '''StrixG''')<br />
* Fix double chat messages if player is in team ([https://github.com/multitheftauto/mtasa-blue/pull/1241 #1241] by '''StrixG''' and '''Luxy.c''')<br />
* Don't queue a resource restart if resource is stopping ([https://github.com/multitheftauto/mtasa-blue/pull/960 #960] by '''StrixG''')<br />
* Add support for more map attributes ([https://github.com/multitheftauto/mtasa-blue/pull/263 #263] by '''patrikjuvonen''')<br />
* Fix server-client inconsistency for isElementAttached failure return ([https://github.com/multitheftauto/mtasa-blue/commit/866506d3f6ebe4a0d4d39664cc4e7d7c0cef1a7c 866506d] by '''qaisjp''')<br />
* Make [[kickPlayer]] accept the Console element as responsiblePlayer ([https://github.com/multitheftauto/mtasa-blue/pull/1427 #1427] by '''qaisjp''')<br />
<br />
<br />
=== 1 Vendor Update ===<br />
* Update sqlite from 3.31.1 to 3.32.3 ([https://github.com/multitheftauto/mtasa-blue/pull/1561 #1561] by '''patrikjuvonen''')<br />
</section><br />
<br />
<br />
== Shared (''Client & Server side'') ==<br />
<section show="true"><br />
=== 17 New Functions ===<br />
* Add [[xmlLoadString]] ([https://github.com/multitheftauto/mtasa-blue/pull/809 #809] by '''Lpsd''')<br />
* Add request info & abort functions for [[fetchRemote]]/[[callRemote]] ([https://github.com/multitheftauto/mtasa-blue/pull/660 #660] by '''Luxy.c''')<br />
** [[getRemoteRequests]]<br />
** [[getRemoteRequestInfo]]<br />
** [[abortRemoteRequest]]<br />
* Add functions to manipulate colshapes parameters ([https://github.com/multitheftauto/mtasa-blue/pull/1215 #1215] by '''StrixG''')<br />
** [[getColShapeRadius]]<br />
** [[setColShapeRadius]]<br />
** [[getColShapeSize]]<br />
** [[setColShapeSize]]<br />
** [[getColPolygonPoints]]<br />
** [[getColPolygonPointPosition]]<br />
** [[setColPolygonPointPosition]]<br />
** [[addColPolygonPoint]]<br />
** [[removeColPolygonPoint]]<br />
* Add [[hasElementData]] function ([https://github.com/multitheftauto/mtasa-blue/pull/1163 #1163] by '''Simi2''')<br />
* Add element data subscription functionality ([https://github.com/multitheftauto/mtasa-blue/pull/1055 #1055] by '''tederis''') - includes 3 new functions:<br />
** [[addElementDataSubscriber]]<br />
** [[removeElementDataSubscriber]]<br />
** [[hasElementDataSubscriber]]<br />
** Adds 1 additional parameter to [[setElementData]]<br />
<br />
<br />
=== 1 Deprecation ===<br />
* Add deprecation message to [[passwordHash]] when using custom salts ([https://github.com/multitheftauto/mtasa-blue/pull/1208 #1208] by '''Luxy.c''')<br />
<br />
<br />
=== 7 Bug Fixes & Changes ===<br />
* Add async [[encodeString]]/[[decodeString]] ([https://github.com/multitheftauto/mtasa-blue/pull/1226 #1226] by '''StrixG''')<br />
* Fix colshape and marker hit detection when attaching ([https://github.com/multitheftauto/mtasa-blue/pull/1327 #1327] by '''Lpsd''')<br />
* Fix driveby aiming being inverted in some cases ([https://github.com/multitheftauto/mtasa-blue/pull/1442 #1442] by '''Zangomangu''')<br />
* Add bIncludeWorldSeaLevel and bIncludeOutsideWorldLevel parameters to [[setWaterLevel]] ([https://github.com/multitheftauto/mtasa-blue/pull/1342 #1342] by '''TheNormalnij''')<br />
* Add [[outputDebugString]] level 4 to omit certain debug info ([https://github.com/multitheftauto/mtasa-blue/pull/1167 #1167] by '''Addlibs''')<br />
* Fix incorrect hash capitalisation ([https://github.com/multitheftauto/mtasa-blue/pull/1527 #1527] by '''qaisjp''')<br />
* Trim [[teaEncode]] trailing zeroes ([https://github.com/multitheftauto/mtasa-blue/pull/1534 #1534] by '''Pirulax''')<br />
<br />
<br />
=== 1 Vendor Update ===<br />
* Update curl from 7.68.0 to 7.69.1 ([https://github.com/multitheftauto/mtasa-blue/pull/1302 #1302] by '''patrikjuvonen''' and '''qaisjp''')<br />
</section><br />
<br />
<br />
<section show="true"><br />
== Extra information ==<br />
''More detailed information available on our GitHub repositories:<br />
:* [https://github.com/multitheftauto/mtasa-blue MTA:SA Blue]<br />
:* [https://github.com/multitheftauto/mtasa-resources MTA:SA Official Resources]<br />
</section><br />
<br />
[[Category:Changelog]]<br />
[[Category:Incomplete]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=IsTransferBoxActive&diff=67448IsTransferBoxActive2020-10-04T12:02:44Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
This function returns whether the file downloading dialog box is active or not. This appears when a resource is started and the client doesn't have all the files that resource requires the client to have.<br />
<br />
It's important to note that resources aren't started on the client until they're completely downloaded, so a resource cannot use this function to detect if it's own files are downloaded. A client-side resource triggers the [[onClientResourceStart]] event when the files it requires are downloaded.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool isTransferBoxActive ()<br />
</syntaxhighlight><br />
{{OOP||[[GUI widgets|GuiElement]].isTransferBoxActive||}}<br />
<br />
===Returns===<br />
Returns ''true'' if the file transfer box is visible, ''false'' if not.<br />
<br />
==Example== <br />
This makes the camera fade in, once all resource downloads are finished.<br />
<syntaxhighlight lang="lua"><br />
function checkTransfer()<br />
if isTransferBoxActive() then<br />
setTimer(checkTransfer, 2000, 1) -- TransferBox is still active, check again after 2 seconds.<br />
else <br />
fadeCamera(true) -- TransferBox isn't active, fade in camera.<br />
end<br />
end<br />
addEventHandler("onClientResourceStart", resourceRoot, checkTransfer)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}<br />
{{GUI_events}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=SetVehicleSirens&diff=67424SetVehicleSirens2020-09-23T17:42:36Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
{{New feature/item|3.0130|1.3.0|3968|<br />
This function changes the properties of a vehicles siren point.<br />
}}<br />
{{Note|Although you may be able to add sirens to any vehice, this function may not work. This function fails on certain vehicle models (https://wiki.multitheftauto.com/wiki/Vehicle_IDs#Lua_table_of_vehicles_that_doesn.27t_support_siren_lights).}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool setVehicleSirens ( vehicle theVehicle, int sirenPoint, float posX, float posY, float posZ, float red, float green, float blue, [float alpha = 255, float minAlpha = 0.0] )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:setSirens||getVehicleSirens}}<br />
===Required Arguments=== <br />
*'''theVehicle:''' The vehicle to modify<br />
*'''sirenPoint:''' The siren point to modify<br />
*'''posX:''' The x position of this siren point from the center of the vehicle<br />
*'''posY:''' The y position of this siren point from the center of the vehicle<br />
*'''posZ:''' The z position of this siren point from the center of the vehicle<br />
*'''red:''' The amount of red from 0 to 255<br />
*'''green:''' The amount of green from 0 to 255<br />
*'''blue:''' The amount of blue from 0 to 255<br />
<br />
===Optional Arguments===<br />
*'''alpha:''' The alpha of the siren from 0 to 255<br />
*'''minAlpha:''' The minimum alpha of the light during day time<br />
<br />
===Returns===<br />
Returns ''true'' if the siren point was successfully changed on the vehicle, ''false'' otherwise. <br />
<br />
==Example==<br />
<section name="Server" class="server" show="true"><br />
This example adds a siren then sets the vehicle siren in the center of the car. (Not sure if it works...)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onVehicleEnter", root, function(player, seat)<br />
if (player) and (seat == 0) then<br />
addVehicleSirens(source, 1, 2)<br />
end<br />
end)<br />
<br />
addEventHandler("onVehicleExit", root, function(player, seat)<br />
if (player) and (seat == 0) then<br />
removeVehicleSirens(source)<br />
end<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
==Requirements==<br />
{{Requirements|1.3.0-9.03968|1.3.0-9.03968|}}<br />
<br />
==See Also==<br />
{{Vehicle_functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=AddVehicleSirens&diff=67422AddVehicleSirens2020-09-23T17:40:43Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__<br />
{{Server function}}<br />
{{New feature/item|3.0130|1.3.0|3968|<br />
This function adds sirens to a vehicle.<br />
}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool addVehicleSirens ( vehicle theVehicle, int sirenCount, int sirenType [, bool 360flag = false, bool checkLosFlag = true, bool useRandomiser flag = true, bool silentFlag = false ] )<br />
</syntaxhighlight> <br />
{{OOP||[[vehicle]]:addSirens}}<br />
===Required Arguments=== <br />
*'''theVehicle:''' The vehicle to add sirens<br />
*'''sirenCount:''' The amount of siren points on the vehicle (8 maximum)<br />
*'''sirenType:''' An integer between 1 and 6 (1: invisible, 2: single, 3+: dual)<br />
<br />
===Optional Arguments===<br />
*'''360flag:''' Visible from all directions (applies to single type only)<br />
*'''checkLosFlag:''' Check line of sight between camera and light so it won't draw if blocked<br />
*'''useRandomiser:''' Randomise the light order, false for sequential<br />
*'''silentFlag:''' If you want the siren to be silent set this to true<br />
<br />
===Returns===<br />
Returns ''true'' if sirens were successfully added to the vehicle, ''false'' otherwise. <br />
<br />
==Example==<br />
This example adds a vehicle siren on entering a vehicle and removes a vehicle siren on exiting. (TESTED!)<br />
<syntaxhighlight lang="lua">addEventHandler("onVehicleEnter", root, function(player, seat)<br />
if (player) and (seat == 0) then<br />
addVehicleSirens(source, 1, 2)<br />
end<br />
end)<br />
<br />
addEventHandler("onVehicleExit", root, function(player, seat)<br />
if (player) and (seat == 0) then<br />
removeVehicleSirens(source)<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|1.3.0-9.03968|n/a|}}<br />
<br />
==See Also==<br />
{{Vehicle_functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OnPlayerCommand&diff=67351OnPlayerCommand2020-08-31T15:27:41Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__<br />
{{Server event}}<br />
This event is triggered when a player issues a command.<br />
{{Note|This event triggers regardless of whether the command exists in a script or is hardcoded. Also, typing anything in chat will execute the internal command "say", so this event will be triggered on every chat message as well. Therefore you should avoid excessive use of this function on busy servers, out of performance considerations.}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string command<br />
</syntaxhighlight><br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[player]] who tried to execute a command.<br />
<br />
==Result of cancelling this event==<br />
The command will not be executed. (Only server-side commands can be canceled.)<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
This example implements an anti-flood protection timer for commands.<br />
'''Be sure to give the resource a function.kickPlayer right.<br />
Also, note, that if the server freezes for a frame and a player executes a command 2x he/she'll get kicked, because those 2 commands will be processed after each other, with very little delay'''<br />
<syntaxhighlight lang="lua"><br />
local CMD_INTERVAL = 200 --// The interval that needs to pass before the player can execute another cmd<br />
local KICK_AFTER_INTERVAL = 50 --// Kick the player if they execute more than 20 cmds/sec<br />
<br />
local executions = setmetatable({}, { --// Metatable for non-existing indexes<br />
__index = function(t, player)<br />
return getTickCount()-CMD_INTERVAL<br />
end<br />
})<br />
<br />
addEventHandler("onPlayerCommand", root,<br />
function()<br />
if (executions[source]-getTickCount()<=CMD_INTERVAL) then<br />
if (executions[source]-getTickCount()<=KICK_AFTER_INTERVAL) then <br />
kickPlayer(source, "Anti-Flood", "Don't flood")<br />
end <br />
cancelEvent()<br />
end<br />
executions[source] = getTickCount()<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
This example disables the hardcoded command 'whois'<br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onPlayerCommand",root,<br />
function(command)<br />
if (command == "whois") then<br />
cancelEvent()<br />
end<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
<br />
<section name="Server" class="server" show="true"><br />
Time limit specific commands.<br />
<syntaxhighlight lang="lua"><br />
local LIMITED_COMMANDS = {<br />
-- ["COMMAND_NAME"] = TIME_LIMIT_IN_SEC<br />
["something"] = 5, -- Can use this command only once in every 5 sec<br />
["spam"] = 10, -- Can use this command only once in every 10 sec<br />
}<br />
<br />
local EXEC = {}<br />
<br />
addEventHandler("onPlayerCommand", root, function(cmd)<br />
local limit_sec = LIMITED_COMMANDS[cmd]<br />
if not limit_sec then return end<br />
<br />
local tick = getTickCount()<br />
<br />
if not EXEC[source] then EXEC[source] = {} end<br />
if not EXEC[source][cmd] then EXEC[source][cmd] = 0 end<br />
<br />
if EXEC[source][cmd] + (limit_sec * 1000) > tick then<br />
cancelEvent()<br />
return outputChatBox("#FF0000[ANTISPAM]#FFFFFF You can use this command once, in every "..limit_sec.." sec.", source, 255, 255, 255, true)<br />
end<br />
EXEC[source][cmd] = tick<br />
end)<br />
<br />
addEventHandler("onPlayerQuit", root, function()<br />
EXEC[source] = nil<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
{{See also/Server event|Player events}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=AddDebugHook&diff=67214AddDebugHook2020-08-07T23:48:48Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
{{New feature/item|3.0136|1.3|5939|<br />
This function allows tracing of MTA functions and events. It should only be used when debugging scripts as it may degrade script performance.<br />
<br />
Debug hooks are not recursive, so functions and events triggered inside the hook callback will not be traced.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool addDebugHook ( string hookType, function callbackFunction [, table nameList ] )<br />
</syntaxhighlight><br />
<br />
===Required Arguments=== <br />
*'''hookType:''' The type of hook to add. This can be:<br />
** preEvent<br />
** postEvent<br />
** preFunction<br />
** postFunction<br />
{{New feature/item|3.0158|1.5.5|11856|<br />
* preEventFunction<br />
* postEventFunction<br />
}}<br />
*'''callbackFunction:''' The function to call<br />
** Returning the string "skip" from the callback function will cause the original function/event to be skipped<br />
<br />
===Optional Arguments=== <br />
*'''nameList:''' Table of strings for restricting which functions and events the hook will be triggered on<br />
** addDebugHook and removeDebugHook will only be hooked if they are specified in the name list<br />
<br />
===Returns===<br />
Returns ''true'' if the hook was successfully added, or ''false'' otherwise.<br />
<br />
==Callback parameters==<br />
<syntaxhighlight lang="lua"><br />
string preFunction( resource sourceResource, string functionName, bool isAllowedByACL, string luaFilename, int luaLineNumber, ...functionArguments )<br />
postFunction( resource sourceResource, string functionName, bool isAllowedByACL, string luaFilename, int luaLineNumber, ...functionArguments )<br />
string preEvent( resource sourceResource, string eventName, element eventSource, element eventClient, string luaFilename, int luaLineNumber, ...eventArguments )<br />
postEvent( resource sourceResource, string eventName, element eventSource, element eventClient, string luaFilename, int luaLineNumber, ...eventArguments )<br />
</syntaxhighlight><br />
{{New feature/item|3.0158|1.5.5|11856|<br />
<syntaxhighlight lang="lua"><br />
string preEventFunction ( resource eventResource, string eventName, element eventSource, element eventClient, string eventFilename, int eventLineNumber, resource functionResource, string functionFilename, int functionLineNumber, ...eventArgs )<br />
postEventFunction ( resource eventResource, string eventName, element eventSource, element eventClient, string eventFilename, int eventLineNumber, resource functionResource, string functionFilename, int functionLineNumber, ...eventArgs )<br />
</syntaxhighlight><br />
}}<br />
<br />
==Example==<br />
This example will dump info about all triggered events:<br />
<syntaxhighlight lang="lua"><br />
function onPreEvent( sourceResource, eventName, eventSource, eventClient, luaFilename, luaLineNumber, ... )<br />
local args = { ... }<br />
local srctype = eventSource and getElementType(eventSource)<br />
local resname = sourceResource and getResourceName(sourceResource)<br />
local plrname = eventClient and getPlayerName(eventClient)<br />
outputDebugString( "preEvent"<br />
.. " " .. tostring(resname)<br />
.. " " .. tostring(eventName)<br />
.. " source:" .. tostring(srctype)<br />
.. " player:" .. tostring(plrname)<br />
.. " file:" .. tostring(luaFilename)<br />
.. "(" .. tostring(luaLineNumber) .. ")"<br />
.. " numArgs:" .. tostring(#args)<br />
.. " arg1:" .. tostring(args[1])<br />
)<br />
end<br />
addDebugHook( "preEvent", onPreEvent )<br />
</syntaxhighlight><br />
This example will dump info about all called MTA functions:<br />
<syntaxhighlight lang="lua"><br />
function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )<br />
local args = { ... }<br />
local resname = sourceResource and getResourceName(sourceResource)<br />
outputDebugString( "preFunction"<br />
.. " " .. tostring(resname)<br />
.. " " .. tostring(functionName)<br />
.. " allowed:" .. tostring(isAllowedByACL)<br />
.. " file:" .. tostring(luaFilename)<br />
.. "(" .. tostring(luaLineNumber) .. ")"<br />
.. " numArgs:" .. tostring(#args)<br />
.. " arg1:" .. tostring(args[1])<br />
)<br />
end<br />
addDebugHook( "preFunction", onPreFunction)<br />
</syntaxhighlight><br />
<br />
This example adds a hook which will only be triggered for the named functions<br />
<syntaxhighlight lang="lua"><br />
addDebugHook( "preFunction", onPreFunction, {"setElementPosition","loadstring"} )<br />
</syntaxhighlight><br />
<br />
{{New feature/item|3.0152|1.5.2|7967|<br />
This example shows how to disable addDebugHook<br />
<syntaxhighlight lang="lua"><br />
function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )<br />
return "skip"<br />
end<br />
addDebugHook( "preFunction", onPreFunction, {"addDebugHook"} )<br />
</syntaxhighlight><br />
}}<br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.3.5-9.06054|Added clientside}}<br />
{{ChangelogItem|1.3.5-9.06142|Added option to restrict to specified functions and events }}<br />
{{ChangelogItem|1.5.2-9.07957|Added option to skip original function/event <br/>Added ability to hook addDebugHook and removeDebugHook }}<br />
{{ChangelogItem|1.5.5-9.11856|Added pre/postEventFunction hooks }}<br />
==Requirements==<br />
{{Requirements|1.3.4-9.05939|1.3.5-9.06054}}<br />
<br />
==See Also==<br />
{{Utility functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=Key_names&diff=67040Key names2020-07-09T16:14:36Z<p>Patrick2562: </p>
<hr />
<div>This page lists all the key names. Except for ''''''escape'''''', they can all be used by the console commands ''bind'' and ''unbind'' as well as the script functions [[bindKey]] and [[unbindKey]].<br />
<br />
Lua table of all the valid key names listed on this page:<br />
<syntaxhighlight lang="lua">keyTable = { "mouse1", "mouse2", "mouse3", "mouse4", "mouse5", "mouse_wheel_up", "mouse_wheel_down", "arrow_l", "arrow_u",<br />
"arrow_r", "arrow_d", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",<br />
"l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "num_0", "num_1", "num_2", "num_3", "num_4", "num_5",<br />
"num_6", "num_7", "num_8", "num_9", "num_mul", "num_add", "num_sep", "num_sub", "num_div", "num_dec", "num_enter", "F1", "F2", "F3", "F4", "F5",<br />
"F6", "F7", "F8", "F9", "F10", "F11", "F12", "escape", "backspace", "tab", "lalt", "ralt", "enter", "space", "pgup", "pgdn", "end", "home",<br />
"insert", "delete", "lshift", "rshift", "lctrl", "rctrl", "[", "]", "pause", "capslock", "scroll", ";", ",", "-", ".", "/", "#", "\\", "=" }</syntaxhighlight><br />
<br />
<br />
<div style="border:3px solid green;margin-bottom:3px;"><div style="float:right;padding-right:5px;font-weight:bold;">MOUSE</div><br />
* '''mouse1''' ''(This is left click)''<br />
* '''mouse2''' ''(This is right click)''<br />
* '''mouse3''' ''(This is the middle mouse button)''<br />
* '''mouse4''' <br />
* '''mouse5'''<br />
* '''mouse_wheel_up'''<br />
* '''mouse_wheel_down'''<br />
</div><br />
<div style="border:3px solid red;margin-bottom:3px;"><div style="float:right;padding-right:5px;font-weight:bold;">ARROW KEYS</div><br />
* '''arrow_l'''<br />
* '''arrow_u'''<br />
* '''arrow_r'''<br />
* '''arrow_d'''<br />
</div><br />
<div style="border:3px solid blue;margin-bottom:3px;"><div style="float:right;padding-right:5px;font-weight:bold;">NUMBERS</div><br />
* '''0'''<br />
* '''1'''<br />
* '''2'''<br />
* '''3'''<br />
* '''4'''<br />
* '''5'''<br />
* '''6'''<br />
* '''7'''<br />
* '''8'''<br />
* '''9'''<br />
</div><br />
<div style="border:3px solid orange;margin-bottom:3px;"><div style="float:right;padding-right:5px;font-weight:bold;">LETTERS</div><br />
* '''a'''<br />
* '''b'''<br />
* '''c'''<br />
* '''d'''<br />
* '''e'''<br />
* '''f'''<br />
* '''g'''<br />
* '''h'''<br />
* '''i'''<br />
* '''j'''<br />
* '''k'''<br />
* '''l'''<br />
* '''m'''<br />
* '''n'''<br />
* '''o'''<br />
* '''p'''<br />
* '''q'''<br />
* '''r'''<br />
* '''s'''<br />
* '''t'''<br />
* '''u'''<br />
* '''v'''<br />
* '''w'''<br />
* '''x'''<br />
* '''y'''<br />
* '''z'''<br />
</div><br />
<div style="border:3px solid yellow;margin-bottom:3px;"><div style="float:right;padding-right:5px;font-weight:bold;">NUMERIC KEYPAD</div><br />
* '''num_0'''<br />
* '''num_1'''<br />
* '''num_2'''<br />
* '''num_3'''<br />
* '''num_4'''<br />
* '''num_5'''<br />
* '''num_6'''<br />
* '''num_7'''<br />
* '''num_8'''<br />
* '''num_9'''<br />
* '''num_mul'''<br />
* '''num_add'''<br />
* '''num_sep'''<br />
* '''num_sub'''<br />
* '''num_div'''<br />
* '''num_dec'''<br />
* '''num_enter'''<br />
</div><br />
<div style="border:3px solid pink;margin-bottom:3px;"><div style="float:right;padding-right:5px;font-weight:bold;">FUNCTION KEYS</div><br />
* '''F1'''<br />
* '''F2'''<br />
* '''F3'''<br />
* '''F4'''<br />
* '''F5'''<br />
* '''F6'''<br />
* '''F7'''<br />
* '''F8'''<br />
* '''F9'''<br />
* '''F10'''<br />
* '''F11'''<br />
* '''F12'''<br />
</div><br />
<div style="border:3px solid purple;margin-bottom:3px;"><div style="float:right;padding-right:5px;font-weight:bold;">OTHER</div><br />
* '''escape'''<br />
* '''backspace'''<br />
* '''tab'''<br />
* '''lalt'''<br />
* '''ralt'''<br />
* '''enter'''<br />
* '''space'''<br />
* '''pgup'''<br />
* '''pgdn'''<br />
* '''end'''<br />
* '''home'''<br />
* '''insert'''<br />
* '''delete'''<br />
* '''lshift'''<br />
* '''rshift'''<br />
* '''lctrl'''<br />
* '''rctrl'''<br />
* '''['''<br />
* ''']'''<br />
* '''pause'''<br />
* '''capslock'''<br />
* '''scroll'''<br />
* ''';'''<br />
* ''','''<br />
* '''-'''<br />
* '''.'''<br />
* '''/'''<br />
* '''#'''<br />
* '''\'''<br />
* '''='''<br />
<br />
</div><br />
[[pl:Key names]]<br />
[[Category:Scripting Concepts]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&diff=67036DxDrawImageSection2020-07-05T20:14:43Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}} <br />
Differing from [[dxDrawImage]], this function only draws a part of an image on the screen for a single frame. In order for the image to stay visible continuously, you need to call this function with the same parameters on each frame update (see [[onClientRender]]).<br />
<br />
Image files should ideally have dimensions that are a power of two, to prevent possible blurring.<br/><br />
<b>Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...</b><br />
<br />
{{Tip|Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.}}<br />
{{Tip|To help prevent edge artifacts when drawing textures, set '''textureEdge''' to '''"clamp"''' when calling [[dxCreateTexture]]}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool dxDrawImageSection ( float posX, float posY, float width, float height,<br />
float u, float v, float usize, float vsize, mixed image,<br />
[ float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0,<br />
int color = white, bool postGUI = false ] )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
[[File:Example patrick.png|thumb|An example of how dxDrawImageSection function works in practice.]]<br />
<br />
*'''posX:''' the absolute X coordinate of the top left corner of the image<br />
*'''posY:''' the absolute Y coordinate of the top left corner of the image<br />
*'''width:''' the absolute width of the image<br />
*'''height:''' the absolute height of the image<br />
*'''u:''' the absolute X coordinate of the top left corner of the section which should be drawn from image<br />
*'''v:''' the absolute Y coordinate of the top left corner of the section which should be drawn from image<br />
*'''usize:''' the absolute width of the image section<br />
*'''vsize:''' the absolute height of the image section<br />
*'''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.<br />
<br />
===Optional Arguments===<br />
*'''rotation:''' the rotation, in degrees for the image.<br />
*'''rotationCenterOffsetX:''' the absolute X offset from the image center for which to rotate the image from.<br />
*'''rotationCenterOffsetY:''' the absolute Y offset from the image center for which to rotate the image from.<br />
*'''color:''' the color of the image, a value produced by [[tocolor]] or hexadecimal number in format: 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).<br />
*'''postgui :''' A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI).<br />
<br />
===Returns===<br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Example 1== <br />
The example draws a section of an image. (You can use [https://i.imgur.com/rMaiEpp.png this] image to test.)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onClientRender", root, function()<br />
local sectionStartX, sectionStartY = 202, 65<br />
local sectionWidth, sectionHeight = 150, 150<br />
<br />
dxDrawImageSection(500, 500, 256, 256, sectionStartX, sectionStartY, sectionWidth, sectionHeight, "example.jpg")<br />
end)<br />
</syntaxhighlight><br />
<br />
<br />
==Example 2== <br />
The example draws a section of an image. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler('onClientRender', root, function()<br />
dxDrawImageSection(400, 200, 64, 64, 0, 0, 64, 64, 'img.jpg') -- Draw a certain section<br />
dxDrawImage(400, 300, 128, 128, 'img.jpg') -- Draw the whole image to be able to identify the difference<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Drawing_functions}}<br />
<br />
[[hu:dxDrawImageSection]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&diff=67035DxDrawImageSection2020-07-05T19:44:29Z<p>Patrick2562: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}} <br />
Differing from [[dxDrawImage]], this function only draws a part of an image on the screen for a single frame. In order for the image to stay visible continuously, you need to call this function with the same parameters on each frame update (see [[onClientRender]]).<br />
<br />
Image files should ideally have dimensions that are a power of two, to prevent possible blurring.<br/><br />
<b>Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...</b><br />
<br />
{{Tip|Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.}}<br />
{{Tip|To help prevent edge artifacts when drawing textures, set '''textureEdge''' to '''"clamp"''' when calling [[dxCreateTexture]]}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool dxDrawImageSection ( float posX, float posY, float width, float height,<br />
float u, float v, float usize, float vsize, mixed image,<br />
[ float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0,<br />
int color = white, bool postGUI = false ] )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
[[File:Example patrick.png|thumb|An example of how dxDrawImageSection function works in practice.]]<br />
<br />
*'''posX:''' the absolute X coordinate of the top left corner of the image<br />
*'''posY:''' the absolute Y coordinate of the top left corner of the image<br />
*'''width:''' the absolute width of the image<br />
*'''height:''' the absolute height of the image<br />
*'''u:''' the absolute X coordinate of the top left corner of the section which should be drawn from image<br />
*'''v:''' the absolute Y coordinate of the top left corner of the section which should be drawn from image<br />
*'''usize:''' the absolute width of the image section<br />
*'''vsize:''' the absolute height of the image section<br />
*'''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.<br />
<br />
===Optional Arguments===<br />
*'''rotation:''' the rotation, in degrees for the image.<br />
*'''rotationCenterOffsetX:''' the absolute X offset from the image center for which to rotate the image from.<br />
*'''rotationCenterOffsetY:''' the absolute Y offset from the image center for which to rotate the image from.<br />
*'''color:''' the color of the image, a value produced by [[tocolor]] or hexadecimal number in format: 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).<br />
*'''postgui :''' A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI).<br />
<br />
===Returns===<br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Example== <br />
The example draws a section of an image. (You can use [https://i.imgur.com/rMaiEpp.png this] image to test.)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onClientRender", root, function()<br />
local sectionStartX, sectionStartY = 202, 65<br />
local sectionWidth, sectionHeight = 150, 150<br />
<br />
dxDrawImageSection(500, 500, 256, 256, sectionStartX, sectionStartY, sectionWidth, sectionHeight, "example.jpg")<br />
end)<br />
</syntaxhighlight><br />
<br />
The example draws a section of an image. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler('onClientRender', root, function()<br />
dxDrawImageSection(400, 200, 64, 64, 0, 0, 64, 64, 'img.jpg') -- Draw a certain section<br />
dxDrawImage(400, 300, 128, 128, 'img.jpg') -- Draw the whole image to be able to identify the difference<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Drawing_functions}}<br />
<br />
[[hu:dxDrawImageSection]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&diff=67034DxDrawImageSection2020-07-05T19:42:32Z<p>Patrick2562: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}} <br />
Differing from [[dxDrawImage]], this function only draws a part of an image on the screen for a single frame. In order for the image to stay visible continuously, you need to call this function with the same parameters on each frame update (see [[onClientRender]]).<br />
<br />
Image files should ideally have dimensions that are a power of two, to prevent possible blurring.<br/><br />
<b>Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...</b><br />
<br />
{{Tip|Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.}}<br />
{{Tip|To help prevent edge artifacts when drawing textures, set '''textureEdge''' to '''"clamp"''' when calling [[dxCreateTexture]]}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool dxDrawImageSection ( float posX, float posY, float width, float height,<br />
float u, float v, float usize, float vsize, mixed image,<br />
[ float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0,<br />
int color = white, bool postGUI = false ] )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
[[File:Example patrick.png|thumb|An example of how dxDrawImageSection function works in practice.]]<br />
<br />
*'''posX:''' the absolute X coordinate of the top left corner of the image<br />
*'''posY:''' the absolute Y coordinate of the top left corner of the image<br />
*'''width:''' the absolute width of the image<br />
*'''height:''' the absolute height of the image<br />
*'''u:''' the absolute X coordinate of the top left corner of the section which should be drawn from image<br />
*'''v:''' the absolute Y coordinate of the top left corner of the section which should be drawn from image<br />
*'''usize:''' the absolute width of the image section<br />
*'''vsize:''' the absolute height of the image section<br />
*'''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.<br />
<br />
===Optional Arguments===<br />
*'''rotation:''' the rotation, in degrees for the image.<br />
*'''rotationCenterOffsetX:''' the absolute X offset from the image center for which to rotate the image from.<br />
*'''rotationCenterOffsetY:''' the absolute Y offset from the image center for which to rotate the image from.<br />
*'''color:''' the color of the image, a value produced by [[tocolor]] or hexadecimal number in format: 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).<br />
*'''postgui :''' A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI).<br />
<br />
===Returns===<br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Example== <br />
The example draws a section of an image. (You can use [https://i.imgur.com/0HwA6a3.png this] image to test.)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onClientRender", root, function()<br />
local sectionStartX, sectionStartY = 202, 65<br />
local sectionWidth, sectionHeight = 150, 150<br />
<br />
dxDrawImageSection(500, 500, 256, 256, sectionStartX, sectionStartY, sectionWidth, sectionHeight, "example.jpg")<br />
end)<br />
</syntaxhighlight><br />
<br />
The example draws a section of an image. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler('onClientRender', root, function()<br />
dxDrawImageSection(400, 200, 64, 64, 0, 0, 64, 64, 'img.jpg') -- Draw a certain section<br />
dxDrawImage(400, 300, 128, 128, 'img.jpg') -- Draw the whole image to be able to identify the difference<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Drawing_functions}}<br />
<br />
[[hu:dxDrawImageSection]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&diff=67033DxDrawImageSection2020-07-05T19:40:41Z<p>Patrick2562: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}} <br />
Differing from [[dxDrawImage]], this function only draws a part of an image on the screen for a single frame. In order for the image to stay visible continuously, you need to call this function with the same parameters on each frame update (see [[onClientRender]]).<br />
<br />
Image files should ideally have dimensions that are a power of two, to prevent possible blurring.<br/><br />
<b>Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...</b><br />
<br />
{{Tip|Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.}}<br />
{{Tip|To help prevent edge artifacts when drawing textures, set '''textureEdge''' to '''"clamp"''' when calling [[dxCreateTexture]]}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool dxDrawImageSection ( float posX, float posY, float width, float height,<br />
float u, float v, float usize, float vsize, mixed image,<br />
[ float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0,<br />
int color = white, bool postGUI = false ] )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
[[File:Example patrick.png|thumb|An example of how dxDrawImageSection function works in practice.]]<br />
<br />
*'''posX:''' the absolute X coordinate of the top left corner of the image<br />
*'''posY:''' the absolute Y coordinate of the top left corner of the image<br />
*'''width:''' the absolute width of the image<br />
*'''height:''' the absolute height of the image<br />
*'''u:''' the absolute X coordinate of the top left corner of the section which should be drawn from image<br />
*'''v:''' the absolute Y coordinate of the top left corner of the section which should be drawn from image<br />
*'''usize:''' the absolute width of the image section<br />
*'''vsize:''' the absolute height of the image section<br />
*'''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.<br />
<br />
===Optional Arguments===<br />
*'''rotation:''' the rotation, in degrees for the image.<br />
*'''rotationCenterOffsetX:''' the absolute X offset from the image center for which to rotate the image from.<br />
*'''rotationCenterOffsetY:''' the absolute Y offset from the image center for which to rotate the image from.<br />
*'''color:''' the color of the image, a value produced by [[tocolor]] or hexadecimal number in format: 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).<br />
*'''postgui :''' A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI).<br />
<br />
===Returns===<br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Example== <br />
The example draws a section of an image. (You can use [https://wiki.multitheftauto.com/images/e/e3/Example_patrick.png this] image to test.)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onClientRender", root, function()<br />
local sectionStartX, sectionStartY = 202, 65<br />
local sectionWidth, sectionHeight = 150, 150<br />
<br />
dxDrawImageSection(500, 500, 256, 256, sectionStartX, sectionStartY, sectionWidth, sectionHeight, "example.jpg")<br />
end)<br />
</syntaxhighlight><br />
<br />
The example draws a section of an image. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler('onClientRender', root, function()<br />
dxDrawImageSection(400, 200, 64, 64, 0, 0, 64, 64, 'img.jpg') -- Draw a certain section<br />
dxDrawImage(400, 300, 128, 128, 'img.jpg') -- Draw the whole image to be able to identify the difference<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Drawing_functions}}<br />
<br />
[[hu:dxDrawImageSection]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&diff=67032DxDrawImageSection2020-07-05T19:36:10Z<p>Patrick2562: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}} <br />
Differing from [[dxDrawImage]], this function only draws a part of an image on the screen for a single frame. In order for the image to stay visible continuously, you need to call this function with the same parameters on each frame update (see [[onClientRender]]).<br />
<br />
Image files should ideally have dimensions that are a power of two, to prevent possible blurring.<br/><br />
<b>Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...</b><br />
<br />
{{Tip|Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.}}<br />
{{Tip|To help prevent edge artifacts when drawing textures, set '''textureEdge''' to '''"clamp"''' when calling [[dxCreateTexture]]}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool dxDrawImageSection ( float posX, float posY, float width, float height,<br />
float u, float v, float usize, float vsize, mixed image,<br />
[ float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0,<br />
int color = white, bool postGUI = false ] )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
[[File:Example patrick.png|thumb|An example of how dxDrawImageSection function works in practice.]]<br />
<br />
*'''posX:''' the absolute X coordinate of the top left corner of the image<br />
*'''posY:''' the absolute Y coordinate of the top left corner of the image<br />
*'''width:''' the absolute width of the image<br />
*'''height:''' the absolute height of the image<br />
*'''u:''' the absolute X coordinate of the top left corner of the section which should be drawn from image<br />
*'''v:''' the absolute Y coordinate of the top left corner of the section which should be drawn from image<br />
*'''usize:''' the absolute width of the image section<br />
*'''vsize:''' the absolute height of the image section<br />
*'''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.<br />
<br />
===Optional Arguments===<br />
*'''rotation:''' the rotation, in degrees for the image.<br />
*'''rotationCenterOffsetX:''' the absolute X offset from the image center for which to rotate the image from.<br />
*'''rotationCenterOffsetY:''' the absolute Y offset from the image center for which to rotate the image from.<br />
*'''color:''' the color of the image, a value produced by [[tocolor]] or hexadecimal number in format: 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).<br />
*'''postgui :''' A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI).<br />
<br />
===Returns===<br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Example== <br />
The example draws a section of an image. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)<br />
<syntaxhighlight lang="lua"><br />
addEventHandler('onClientRender', root, function()<br />
dxDrawImageSection(400, 200, 64, 64, 0, 0, 64, 64, 'img.jpg') -- Draw a certain section<br />
dxDrawImage(400, 300, 128, 128, 'img.jpg') -- Draw the whole image to be able to identify the difference<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Drawing_functions}}<br />
<br />
[[hu:dxDrawImageSection]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=File:Example_patrick.png&diff=67031File:Example patrick.png2020-07-05T19:35:54Z<p>Patrick2562: </p>
<hr />
<div>An example of how dxDrawImageSection function works in practice.</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OOP_server&diff=66722OOP server2020-06-01T12:10:44Z<p>Patrick2562: /* Resource */</p>
<hr />
<div>{{Needs Checking|This page is partially outdated.}}<br />
The new OOP in MTA allows for better code organization and readability. This is a list of [[Server_Scripting_Functions|server-side functions]].<br />
<br />
''See also: [[OOP]]''<br />
<br />
<br />
==Element==<br />
areCollisionsEnabled (function: [[getElementCollisionsEnabled]])<br />
attach (function: [[attachElements]])<br />
clearVisibility (function: [[clearElementVisibleTo]])<br />
clone (function: [[cloneElement]])<br />
create (function: [[createElement]])<br />
destroy (function: [[destroyElement]])<br />
detach (function: [[detachElements]])<br />
getAllByType (function: [[getElementsByType]])<br />
getAllData (function: [[getAllElementData]])<br />
getAlpha (function: [[getElementAlpha]])<br />
getAttachedElements (function: [[getAttachedElements]])<br />
getAttachedOffsets (function: [[getElementAttachedOffsets]])<br />
getAttachedTo (function: [[getElementAttachedTo]])<br />
getByID (function: [[getElementByID]])<br />
getByIndex (function: [[getElementByIndex]])<br />
getChild (function: [[getElementChild]])<br />
getChildren (function: [[getElementChildren]])<br />
getChildrenCount (function: [[getElementChildrenCount]])<br />
getColShape (function: [[getElementColShape]])<br />
getData (function: [[getElementData]])<br />
getDimension (function: [[getElementDimension]])<br />
getHealth (function: [[getElementHealth]])<br />
getID (function: [[getElementID]])<br />
getInterior (function: [[getElementInterior]])<br />
getLowLOD (function: [[getLowLODElement]])<br />
getModel (function: [[getElementModel]])<br />
getParent (function: [[getElementParent]])<br />
getPosition (function: [[getElementPosition]])<br />
getRotation (function: [[getElementRotation]])<br />
getSyncer (function: [[getElementSyncer]])<br />
getType (function: [[getElementType]])<br />
getVelocity (function: [[getElementVelocity]])<br />
getZoneName (function: [[getElementZoneName]])<br />
isAttached (function: [[isElementAttached]])<br />
isCallPropagationEnabled (function: [[isElementCallPropagationEnabled]])<br />
isDoubleSided (function: [[isElementDoubleSided]])<br />
isFrozen (function: [[isElementFrozen]])<br />
isInWater (function: [[isElementInWater]])<br />
isLowLOD (function: [[isElementLowLOD]])<br />
isVisibleTo (function: [[isElementVisibleTo]])<br />
isWithinColShape (function: [[isElementWithinColShape]])<br />
isWithinMarker (function: [[isElementWithinMarker]])<br />
removeData (function: [[removeElementData]])<br />
setAlpha (function: [[setElementAlpha]])<br />
setAttachedOffsets (function: [[setElementAttachedOffsets]])<br />
setCallPropagationEnabled (function: [[setElementCallPropagationEnabled]])<br />
setCollisionsEnabled (function: [[setElementCollisionsEnabled]])<br />
setData (function: [[setElementData]])<br />
setDimension (function: [[setElementDimension]])<br />
setDoubleSided (function: [[setElementDoubleSided]])<br />
setFrozen (function: [[setElementFrozen]])<br />
setHealth (function: [[setElementHealth]])<br />
setID (function: [[setElementID]])<br />
setInterior (function: [[setElementInterior]])<br />
setMatrix (function: [[setElementMatrix]])<br />
setModel (function: [[setElementModel]])<br />
setParent (function: [[setElementParent]])<br />
setPosition (function: [[setElementPosition]])<br />
setRotation (function: [[setElementRotation]])<br />
setSyncer (function: [[setElementSyncer]])<br />
setVelocity (function: [[setElementVelocity]])<br />
<br />
==ACL==<br />
<br />
create (function: [[aclCreate]])<br />
destroy (function: [[aclDestroy]])<br />
get (function: [[aclGet]])<br />
getName (function: [[aclGetName]])<br />
getRight (function: [[aclGetRight]])<br />
hasObjectPermissionTo (function: [[hasObjectPermissionTo]])<br />
list (function: [[aclList]])<br />
listRights (function: [[aclListRights]])<br />
reload (function: [[aclReload]])<br />
removeRight (function: [[aclRemoveRight]])<br />
save (function: [[aclSave]])<br />
setRight (function: [[aclSetRight]])<br />
<br />
==ACLGroup==<br />
<br />
addACL (function: [[aclGroupAddACL]])<br />
addObject (function: [[aclGroupAddObject]])<br />
addToGroup (function: [[aclGroupAddACL]])<br />
create (function: [[aclCreateGroup]])<br />
destroy (function: [[aclDestroyGroup]])<br />
doesContainObject (function: [[isObjectInACLGroup]])<br />
get (function: [[aclGetGroup]])<br />
getName (function: [[aclGroupGetName]])<br />
list (function: [[aclGroupList]])<br />
listACL (function: [[aclGroupListACL]])<br />
listObjects (function: [[aclGroupListObjects]])<br />
removeACL (function: [[aclGroupRemoveACL]])<br />
removeFromGroup (function: [[aclGroupRemoveACL]])<br />
removeObject (function: [[aclGroupRemoveObject]])<br />
<br />
==Account==<br />
<br />
add (function: [[addAccount]])<br />
copyDataTo (function: [[copyAccountData]])<br />
getData (function: [[getAccountData]])<br />
getID (function: [[getAccountID]])<br />
getIP (function: [[getAccountIP]])<br />
getName (function: [[getAccountName]])<br />
getPlayer (function: [[getAccountPlayer]])<br />
getAllByData (function: [[getAccountsByData]])<br />
getAllByIP (function: [[getAccountsByIP]])<br />
getAllBySerial (function: [[getAccountsBySerial]])<br />
getSerial (function: [[getAccountSerial]])<br />
getAll (function: [[getAccounts]])<br />
create (function: [[getAccount]])<br />
getAllData (function: [[getAllAccountData]])<br />
getAccount (function: [[getPlayerAccount]])<br />
isGuest (function: [[isGuestAccount]])<br />
logIn (function: [[logIn]])<br />
logOut (function: [[logOut]])<br />
remove (function: [[removeAccount]])<br />
setData (function: [[setAccountData]])<br />
setName (function: [[setAccountName]])<br />
setPassword (function: [[setAccountPassword]])<br />
<br />
==Ban==<br />
<br />
create (function: [[addBan]])<br />
getAdmin (function: [[getBanAdmin]])<br />
getIP (function: [[getBanIP]])<br />
getList (function: [[getBans]])<br />
getNick (function: [[getBanNick]])<br />
getReason (function: [[getBanReason]])<br />
getSerial (function: [[getBanSerial]])<br />
getTime (function: [[getBanTime]])<br />
getUnbanTime (function: [[getUnbanTime]])<br />
remove (function: [[removeBan]])<br />
<br />
==Blip==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createBlip]])<br />
createAttachedTo (function: [[createBlipAttachedTo]])<br />
getColor (function: [[getBlipColor]])<br />
getIcon (function: [[getBlipIcon]])<br />
getOrdering (function: [[getBlipOrdering]])<br />
getSize (function: [[getBlipSize]])<br />
getVisibleDistance (function: [[getBlipVisibleDistance]])<br />
setColor (function: [[setBlipColor]])<br />
setIcon (function: [[setBlipIcon]])<br />
setOrdering (function: [[setBlipOrdering]])<br />
setSize (function: [[setBlipSize]])<br />
setVisibleDistance (function: [[setBlipVisibleDistance]])<br />
<br />
==ColShape==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
Circle (function: [[createColCircle]])<br />
Cuboid (function: [[createColCuboid]])<br />
getElementsWithin (function: [[getElementsWithinColShape]])<br />
getShapeType (function: [[getColShapeType]])<br />
isElementWithin (function: [[isElementWithinColShape]])<br />
Polygon (function: [[createColPolygon]])<br />
Rectangle (function: [[createColRectangle]])<br />
Sphere (function: [[createColSphere]])<br />
Tube (function: [[createColTube]])<br />
<br />
==File==<br />
<br />
close (function: [[fileClose]])<br />
copy (function: [[fileCopy]])<br />
create (function: [[fileOpen]])<br />
delete (function: [[fileDelete]])<br />
destroy (function: [[fileClose]])<br />
exists (function: [[fileExists]])<br />
flush (function: [[fileFlush]])<br />
getPos (function: [[fileGetPos]])<br />
getSize (function: [[fileGetSize]])<br />
isEOF (function: [[fileIsEOF]])<br />
new (function: [[fileCreate]])<br />
read (function: [[fileRead]])<br />
rename (function: [[fileRename]])<br />
setPos (function: [[fileSetPos]])<br />
write (function: [[fileWrite]])<br />
<br />
==Marker==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createMarker]])<br />
getColor (function: [[getMarkerColor]])<br />
getCount (function: [[getMarkerCount]])<br />
getIcon (function: [[getMarkerIcon]])<br />
getSize (function: [[getMarkerSize]])<br />
getTarget (function: [[getMarkerTarget]])<br />
getType (function: [[getMarkerType]])<br />
setColor (function: [[setMarkerColor]])<br />
setIcon (function: [[setMarkerIcon]])<br />
setSize (function: [[setMarkerSize]])<br />
setTarget (function: [[setMarkerTarget]])<br />
setType (function: [[setMarkerType]])<br />
<br />
==Object==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createObject]])<br />
getScale (function: [[getObjectScale]])<br />
move (function: [[moveObject]])<br />
setScale (function: [[setObjectScale]])<br />
stop (function: [[stopObject]])<br />
<br />
==Ped==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
addClothes (function: [[addPedClothes]])<br />
create (function: [[createPed]])<br />
doesHaveJetpack (function: [[doesPedHaveJetPack]])<br />
getAmmoInClip (function: [[getPedAmmoInClip]])<br />
getAnalogControlState (function: [[getPedAnalogControlState]])<br />
getArmor (function: [[getPedArmor]])<br />
getClothes (function: [[getPedClothes]])<br />
getContactElement (function: [[getPedContactElement]])<br />
getFightingStyle (function: [[getPedFightingStyle]])<br />
getGravity (function: [[getPedGravity]])<br />
getOccupiedVehicle (function: [[getPedOccupiedVehicle]])<br />
getOccupiedVehicleSeat (function: [[getPedOccupiedVehicleSeat]])<br />
getStat (function: [[getPedStat]])<br />
getTarget (function: [[getPedTarget]])<br />
getTotalAmmo (function: [[getPedTotalAmmo]])<br />
getValidModels (function: [[getValidPedModels]])<br />
getWalkingStyle (function: [[getPedWalkingStyle]])<br />
getWeapon (function: [[getPedWeapon]])<br />
getWeaponSlot (function: [[getPedWeaponSlot]])<br />
giveJetPack (function: [[givePedJetPack]])<br />
isChoking (function: [[isPedChoking]])<br />
isDead (function: [[isPedDead]])<br />
isDoingGangDriveby (function: [[isPedDoingGangDriveby]])<br />
isDucked (function: [[isPedDucked]])<br />
isFrozen (function: [[isPedFrozen]])<br />
isHeadless (function: [[isPedHeadless]])<br />
isInVehicle (function: [[isPedInVehicle]])<br />
isInWater (function: [[isPedInWater]])<br />
isOnFire (function: [[isPedOnFire]])<br />
isOnGround (function: [[isPedOnGround]])<br />
kill (function: [[killPed]])<br />
reloadWeapon (function: [[reloadPedWeapon]])<br />
removeClothes (function: [[removePedClothes]])<br />
removeFromVehicle (function: [[removePedFromVehicle]])<br />
removeJetPack (function: [[removePedJetPack]])<br />
setAnalogControlState (function: [[setPedAnalogControlState]])<br />
setAnimation (function: [[setPedAnimation]])<br />
setAnimationProgress (function: [[setPedAnimationProgress]])<br />
setArmor (function: [[setPedArmor]])<br />
setChoking (function: [[setPedChoking]])<br />
setDoingGangDriveBy (function: [[setPedDoingGangDriveby]])<br />
setFightingStyle (function: [[setPedFightingStyle]])<br />
setFrozen (function: [[setPedFrozen]])<br />
setGravity (function: [[setPedGravity]])<br />
setHeadless (function: [[setPedHeadless]])<br />
setOnFire (function: [[setPedOnFire]])<br />
setStat (function: [[setPedStat]])<br />
setWalkingStyle (function: [[setPedWalkingStyle]])<br />
setWeaponSlot (function: [[setPedWeaponSlot]])<br />
warpIntoVehicle (function: [[warpPedIntoVehicle]])<br />
<br />
==Pickup==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createPickup]])<br />
getAmmo (function: [[getPickupAmmo]])<br />
getAmount (function: [[getPickupAmount]])<br />
getRespawnInterval (function: [[getPickupRespawnInterval]])<br />
getType (function: [[getPickupType]])<br />
getWeapon (function: [[getPickupWeapon]])<br />
setRespawnInterval (function: [[setPickupRespawnInterval]])<br />
setType (function: [[setPickupType]])<br />
use (function: [[usePickup]])<br />
<br />
==Player==<br />
''Inherited from [[#Ped|Ped]]''<br />
<br />
ban (function: [[banPlayer]])<br />
create (function: [[getPlayerFromName]])<br />
forceMap (function: [[forcePlayerMap]])<br />
getAccount (function: [[getPlayerAccount]])<br />
getACInfo (function: [[getPlayerACInfo]])<br />
getAllAlive (function: [[getAlivePlayers]])<br />
getAllDead (function: [[getDeadPlayers]])<br />
getAnnounceValue (function: [[getPlayerAnnounceValue]])<br />
getBlurLevel (function: [[getPlayerBlurLevel]])<br />
getCount (function: [[getPlayerCount]])<br />
getIdleTime (function: [[getPlayerIdleTime]])<br />
getIP (function: [[getPlayerIP]])<br />
getMoney (function: [[getPlayerMoney]])<br />
getName (function: [[getPlayerName]])<br />
getNametagColor (function: [[getPlayerNametagColor]])<br />
getNametagText (function: [[getPlayerNametagText]])<br />
getPing (function: [[getPlayerPing]])<br />
getRandom (function: [[getRandomPlayer]])<br />
getSerial (function: [[getPlayerSerial]])<br />
getTeam (function: [[getPlayerTeam]])<br />
getVersion (function: [[getPlayerVersion]])<br />
getWantedLevel (function: [[getPlayerWantedLevel]])<br />
giveMoney (function: [[givePlayerMoney]])<br />
isMapForced (function: [[isPlayerMapForced]])<br />
isMuted (function: [[isPlayerMuted]])<br />
isNametagShowing (function: [[isPlayerNametagShowing]])<br />
isObservingDisplay (function: [[textDisplayIsObserver]])<br />
isVoiceEnabled (function: [[isVoiceEnabled]])<br />
kick (function: [[kickPlayer]])<br />
logOut (function: [[logOut]])<br />
observeDisplay (function: [[textDisplayAddObserver]])<br />
redirect (function: [[redirectPlayer]])<br />
resendModInfo (function: [[resendPlayerModInfo]])<br />
setAnnounceValue (function: [[setPlayerAnnounceValue]])<br />
setBlurLevel (function: [[setPlayerBlurLevel]])<br />
setHudComponentVisible (function: [[setPlayerHudComponentVisible]])<br />
setMoney (function: [[setPlayerMoney]])<br />
setMuted (function: [[setPlayerMuted]])<br />
setName (function: [[setPlayerName]])<br />
setNametagColor (function: [[setPlayerNametagColor]])<br />
setNametagShowing (function: [[setPlayerNametagShowing]])<br />
setNametagText (function: [[setPlayerNametagText]])<br />
setTeam (function: [[setPlayerTeam]])<br />
setVoiceBroadcastTo (function: [[setPlayerVoiceBroadcastTo]])<br />
setVoiceIgnoreFrom (function: [[setPlayerVoiceIgnoreFrom]])<br />
setWantedLevel (function: [[setPlayerWantedLevel]])<br />
showHudComponent (function: [[showPlayerHudComponent]])<br />
spawn (function: [[spawnPlayer]])<br />
stopObservingDisplay (function: [[textDisplayRemoveObserver]])<br />
takeMoney (function: [[takePlayerMoney]])<br />
takeScreenshot (function: [[takePlayerScreenShot]])<br />
triggerEvent (function: [[triggerClientEvent]])<br />
<br />
==RadarArea==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createRadarArea]])<br />
getColor (function: [[getRadarAreaColor]])<br />
getSize (function: [[getRadarAreaSize]])<br />
isFlashing (function: [[isRadarAreaFlashing]])<br />
isInside (function: [[isInsideRadarArea]])<br />
setColor (function: [[setRadarAreaColor]])<br />
setFlashing (function: [[setRadarAreaFlashing]])<br />
setSize (function: [[setRadarAreaSize]])<br />
<br />
==Resource==<br />
call (function: [[call]])<br />
copy (function: [[copyResource]])<br />
create (function: [[createResource]])<br />
getDynamicElementRoot (function: [[getResourceDynamicElementRoot]])<br />
getAll (function: [[getResources]])<br />
getFromName (function: [[getResourceFromName]])<br />
getInfo (function: [[getResourceInfo]])<br />
getMapRootElement (function: [[getResourceMapRootElement]])<br />
getName (function: [[getResourceName]])<br />
getRootElement (function: [[getResourceRootElement]])<br />
getState (function: [[getResourceState]])<br />
removeFile (function: [[removeResourceFile]])<br />
restart (function: [[restartResource]])<br />
start (function: [[startResource]])<br />
stop (function: [[stopResource]])<br />
setInfo (function: [[setResourceInfo]])<br />
rename (function: [[renameResource]])<br />
delete (function: [[deleteResource]])<br />
<br />
==Connection==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[dbConnect]])<br />
exec (function: [[dbExec]])<br />
query (function: [[dbQuery]])<br />
<br />
==QueryHandle==<br />
<br />
free (function: [[dbFree]])<br />
poll (function: [[dbPoll]])<br />
<br />
==Team==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
countPlayers (function: [[countPlayersInTeam]])<br />
create (function: [[createTeam]])<br />
getColor (function: [[getTeamColor]])<br />
getFriendlyFire (function: [[getTeamFriendlyFire]])<br />
getFromName (function: [[getTeamFromName]])<br />
getName (function: [[getTeamName]])<br />
getPlayers (function: [[getPlayersInTeam]])<br />
setColor (function: [[setTeamColor]])<br />
setFriendlyFire (function: [[setTeamFriendlyFire]])<br />
setName (function: [[setTeamName]])<br />
<br />
==TextDisplay==<br />
<br />
addObserver (function: [[textDisplayAddObserver]])<br />
addText (function: [[textDisplayAddText]])<br />
create (function: [[textCreateDisplay]])<br />
destroy (function: [[textDestroyDisplay]])<br />
getObservers (function: [[textDisplayGetObservers]])<br />
isObserver (function: [[textDisplayIsObserver]])<br />
removeObserver (function: [[textDisplayRemoveObserver]])<br />
removeText (function: [[textDisplayRemoveText]])<br />
<br />
==TextItem==<br />
<br />
create (function: [[textCreateTextItem]])<br />
destroy (function: [[textDestroyTextItem]])<br />
getColor (function: [[textItemGetColor]])<br />
getPosition (function: [[textItemGetPosition]])<br />
getPriority (function: [[textItemGetPriority]])<br />
getScale (function: [[textItemGetScale]])<br />
getText (function: [[textItemGetText]])<br />
setColor (function: [[textItemSetColor]])<br />
setPosition (function: [[textItemSetPosition]])<br />
setPriority (function: [[textItemSetPriority]])<br />
setScale (function: [[textItemSetScale]])<br />
setText (function: [[textItemSetText]])<br />
<br />
==Vehicle==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
addSirens (function: [[addVehicleSirens]])<br />
addUpgrade (function: [[addVehicleUpgrade]])<br />
areSirensOn (function: [[getVehicleSirensOn]])<br />
attachTrailer (function: [[attachTrailerToVehicle]])<br />
blow (function: [[blowVehicle]])<br />
create (function: [[createVehicle]])<br />
detachTrailer (function: [[detachTrailerFromVehicle]])<br />
fix (function: [[fixVehicle]])<br />
getAllOfType (function: [[getVehiclesOfType]])<br />
getColor (function: [[getVehicleColor]])<br />
getCompatibleUpgrades (function: [[getVehicleCompatibleUpgrades]])<br />
getController (function: [[getVehicleController]])<br />
getDirection (function: [[getTrainDirection]])<br />
getDoorOpenRatio (function: [[getVehicleDoorOpenRatio]])<br />
getDoorState (function: [[getVehicleDoorState]])<br />
getEngineState (function: [[getVehicleEngineState]])<br />
getHandling (function: [[getVehicleHandling]])<br />
getHeadLightColor (function: [[getVehicleHeadLightColor]])<br />
getLandingGearDown (function: [[getVehicleLandingGearDown]])<br />
getLightState (function: [[getVehicleLightState]])<br />
getMaxPassengers (function: [[getVehicleMaxPassengers]])<br />
getModelFromName (function: [[getVehicleModelFromName]])<br />
getModelHandling (function: [[getModelHandling]])<br />
getName (function: [[getVehicleName]])<br />
getNameFromModel (function: [[getVehicleNameFromModel]])<br />
getOccupant (function: [[getVehicleOccupant]])<br />
getOccupants (function: [[getVehicleOccupants]])<br />
getOriginalHandling (function: [[getOriginalHandling]])<br />
getOverrideLights (function: [[getVehicleOverrideLights]])<br />
getPaintjob (function: [[getVehiclePaintjob]])<br />
getPanelState (function: [[getVehiclePanelState]])<br />
getPlateText (function: [[getVehiclePlateText]])<br />
getSirenParams (function: [[getVehicleSirenParams]])<br />
getSirens (function: [[getVehicleSirens]])<br />
getSpeed (function: [[getTrainSpeed]])<br />
getTowedByVehicle (function: [[getVehicleTowedByVehicle]])<br />
getTowingVehicle (function: [[getVehicleTowingVehicle]])<br />
getTurnVelocity (function: [[getVehicleTurnVelocity]])<br />
getTurretPosition (function: [[getVehicleTurretPosition]])<br />
getUpgradeOnSlot (function: [[getVehicleUpgradeOnSlot]])<br />
getUpgrades (function: [[getVehicleUpgrades]])<br />
getUpgradeSlotName (function: [[getVehicleUpgradeSlotName]])<br />
getVariant (function: [[getVehicleVariant]])<br />
getVehicleType (function: [[getVehicleType]])<br />
getWheelStates (function: [[getVehicleWheelStates]])<br />
isBlown (function: [[isVehicleBlown]])<br />
isDamageProof (function: [[isVehicleDamageProof]])<br />
isDerailable (function: [[isTrainDerailable]])<br />
isDerailed (function: [[isTrainDerailed]])<br />
isFuelTankExplodable (function: [[isVehicleFuelTankExplodable]])<br />
isLocked (function: [[isVehicleLocked]])<br />
isOnGround (function: [[isVehicleOnGround]])<br />
isTaxiLightOn (function: [[isVehicleTaxiLightOn]])<br />
removeSirens (function: [[removeVehicleSirens]])<br />
removeUpgrade (function: [[removeVehicleUpgrade]])<br />
resetExplosionTime (function: [[resetVehicleExplosionTime]])<br />
resetIdleTime (function: [[resetVehicleIdleTime]])<br />
respawn (function: [[respawnVehicle]])<br />
setColor (function: [[setVehicleColor]])<br />
setDamageProof (function: [[setVehicleDamageProof]])<br />
setDerailable (function: [[setTrainDerailable]])<br />
setDerailed (function: [[setTrainDerailed]])<br />
setDirection (function: [[setTrainDirection]])<br />
setDoorOpenRatio (function: [[setVehicleDoorOpenRatio]])<br />
setDoorState (function: [[setVehicleDoorState]])<br />
setDoorsUndamageable (function: [[setVehicleDoorsUndamageable]])<br />
setEngineState (function: [[setVehicleEngineState]])<br />
setFuelTankExplodable (function: [[setVehicleFuelTankExplodable]])<br />
setHandling (function: [[setVehicleHandling]])<br />
setHeadLightColor (function: [[setVehicleHeadLightColor]])<br />
setIdleRespawnDelay (function: [[setVehicleIdleRespawnDelay]])<br />
setLandingGearDown (function: [[setVehicleLandingGearDown]])<br />
setLightState (function: [[setVehicleLightState]])<br />
setLocked (function: [[setVehicleLocked]])<br />
setModelHandling (function: [[setModelHandling]])<br />
setOverrideLights (function: [[setVehicleOverrideLights]])<br />
setPaintJob (function: [[setVehiclePaintjob]])<br />
setPanelState (function: [[setVehiclePanelState]])<br />
setPlateText (function: [[setVehiclePlateText]])<br />
setRespawnDelay (function: [[setVehicleRespawnDelay]])<br />
setRespawnPosition (function: [[setVehicleRespawnPosition]])<br />
setSirens (function: [[setVehicleSirens]])<br />
setSirensOn (function: [[setVehicleSirensOn]])<br />
setSpeed (function: [[setTrainSpeed]])<br />
setTaxiLightOn (function: [[setVehicleTaxiLightOn]])<br />
setTurnVelocity (function: [[setVehicleTurnVelocity]])<br />
setTurretPosition (function: [[setVehicleTurretPosition]])<br />
setVariant (function: [[setVehicleVariant]])<br />
setWheelStates (function: [[setVehicleWheelStates]])<br />
spawn (function: [[spawnVehicle]])<br />
toggleRespawn (function: [[toggleVehicleRespawn]])<br />
<br />
==Water==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createWater]])<br />
getColor (function: [[getWaterColor]])<br />
getVertexPosition (function: [[getWaterVertexPosition]])<br />
getWaveHeight (function: [[getWaveHeight]])<br />
resetColor (function: [[resetWaterColor]])<br />
resetLevel (function: [[resetWaterLevel]])<br />
setColor (function: [[setWaterColor]])<br />
setLevel (function: [[setWaterLevel]])<br />
setVertexPosition (function: [[setWaterVertexPosition]])<br />
setWaveHeight (function: [[setWaveHeight]])<br />
<br />
==XML==<br />
<br />
copy (function: [[xmlCopyFile]])<br />
create (function: [[xmlCreateFile]])<br />
createChild (function: [[xmlCreateChild]])<br />
destroy (function: [[xmlDestroyNode]])<br />
findChild (function: [[xmlFindChild]])<br />
getAttribute (function: [[xmlNodeGetAttribute]])<br />
getAttributes (function: [[xmlNodeGetAttributes]])<br />
getChildren (function: [[xmlNodeGetChildren]])<br />
getName (function: [[xmlNodeGetName]])<br />
getParent (function: [[xmlNodeGetParent]])<br />
load (function: [[xmlLoadFile]])<br />
loadMapData (function: [[loadMapData]])<br />
saveFile (function: [[xmlSaveFile]])<br />
saveMapData (function: [[saveMapData]])<br />
setAttribute (function: [[xmlNodeSetAttribute]])<br />
setName (function: [[xmlNodeSetName]])<br />
setValue (function: [[xmlNodeGetValue]])<br />
setValue (function: [[xmlNodeSetValue]])<br />
unload (function: [[xmlUnloadFile]])<br />
<br />
==Timer==<br />
<br />
create (function: [[setTimer]])<br />
destroy (function: [[killTimer]])<br />
getDetails (function: [[getTimerDetails]])<br />
isValid (function: [[isTimer]])<br />
reset (function: [[resetTimer]])<br />
<br />
[[Category:OOP]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OOP_client&diff=66716OOP client2020-05-30T14:29:44Z<p>Patrick2562: /* XML */</p>
<hr />
<div>{{Needs Checking|This page is partially outdated.}}<br />
The new OOP in MTA allows for better code organization and readability. This is a list of [[Client_Scripting_Functions|client-side functions]].<br />
<br />
''See also: [[OOP]]''<br />
<br />
<br />
==Element==<br />
<br />
areCollisionsEnabled (function: [[getElementCollisionsEnabled]])<br />
attach (function: [[attachElements]])<br />
clearVisibleTo (function: [[clearElementVisibleTo]])<br />
clone (function: [[cloneElement]])<br />
create (function: [[createElement]])<br />
destroy (function: [[destroyElement]])<br />
detach (function: [[detachElements]])<br />
getAllByType (function: [[getElementsByType]])<br />
getAlpha (function: [[getElementAlpha]])<br />
getAttachedElements (function: [[getAttachedElements]])<br />
getAttachedOffsets (function: [[getElementAttachedOffsets]])<br />
getAttachedTo (function: [[getElementAttachedTo]])<br />
getBoundingBox (function: [[getElementBoundingBox]])<br />
getByID (function: [[getElementByID]])<br />
getByType (function: [[getElementsByType]])<br />
getChild (function: [[getElementChild]])<br />
getChildren (function: [[getElementChildren]])<br />
getChildrenCount (function: [[getElementChildrenCount]])<br />
getColShape (function: [[getElementColShape]])<br />
getData (function: [[getElementData]])<br />
getDimension (function: [[getElementDimension]])<br />
getDistanceFromCentreOfMassToBaseOfModel (function: [[GetElementDistanceFromCentreOfMassToBaseOfModel]])<br />
getHealth (function: [[getElementHealth]])<br />
getID (function: [[getElementID]])<br />
getInterior (function: [[getElementInterior]])<br />
getLowLOD (function: [[getLowLODElement]])<br />
getModel (function: [[getElementModel]])<br />
getParent (function: [[getElementParent]])<br />
getPosition (function: [[getElementPosition]], variable: position)<br />
getRotation (function: [[getElementRotation]], variable: rotation)<br />
getSyncer (function: [[getElementSyncer]])<br />
getType (function: [[getElementType]])<br />
getVelocity (function: [[getElementVelocity]])<br />
getWithinColShape (function: [[getElementsWithinColShape]])<br />
getZoneName (function: [[getElementZoneName]])<br />
isAttached (function: [[isElementAttached]])<br />
isCallPropagationEnabled (function: [[isElementCallPropagationEnabled]])<br />
isDoubleSided (function: [[isElementDoubleSided]])<br />
isFrozen (function: [[isElementFrozen]])<br />
isInWater (function: [[isElementInWater]])<br />
isLowLOD (function: [[isElementLowLOD]])<br />
isVisibleTo (function: [[isElementVisibleTo]])<br />
isWithinColShape (function: [[isElementWithinColShape]])<br />
isWithinMarker (function: [[isElementWithinMarker]])<br />
removeData (function: [[removeElementData]])<br />
setAlpha (function: [[setElementAlpha]])<br />
setAttachedOffsets (function: [[setElementAttachedOffsets]])<br />
setCallPropagationEnabled (function: [[setElementCallPropagationEnabled]])<br />
setCollisionsEnabled (function: [[setElementCollisionsEnabled]])<br />
setData (function: [[setElementData]])<br />
setDimension (function: [[setElementDimension]])<br />
setDoubleSided (function: [[setElementDoubleSided]])<br />
setFrozen (function: [[setElementFrozen]])<br />
setHealth (function: [[setElementHealth]])<br />
setID (function: [[setElementID]])<br />
setInterior (function: [[setElementInterior]])<br />
setLowLOD (function: [[setLowLODElement]])<br />
setMatrix (function: [[setElementMatrix]])<br />
setModel (function: [[setElementModel]])<br />
setParent (function: [[setElementParent]])<br />
setPosition (function: [[setElementPosition]])<br />
setRotation (function: [[setElementRotation]])<br />
setVelocity (function: [[setElementVelocity]])<br />
setVisibleTo (function: [[setElementVisibleTo]])<br />
<br />
==Vehicle==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
addUpgrade (function: [[addVehicleUpgrade]])<br />
attachTrailer (function: [[attachTrailerToVehicle]])<br />
blow (function: [[blowVehicle]])<br />
create (function: [[createVehicle]])<br />
detachTrailer (function: [[detachTrailerFromVehicle]])<br />
fix (function: [[fixVehicle]])<br />
getAdjustableProperty (function: [[getVehicleAdjustableProperty]])<br />
getColor (function: [[getVehicleColor]])<br />
getCompatibleUpgrades (function: [[getVehicleCompatibleUpgrades]])<br />
getComponentPosition (function: [[getVehicleComponentPosition]])<br />
getComponentRotation (function: [[getVehicleComponentRotation]])<br />
getComponents (function: [[getVehicleComponents]])<br />
getComponentVisible (function: [[getVehicleComponentVisible]])<br />
getController (function: [[getVehicleController]])<br />
getDoorOpenRatio (function: [[getVehicleDoorOpenRatio]])<br />
getDoorState (function: [[getVehicleDoorState]])<br />
getEngineState (function: [[getVehicleEngineState]])<br />
getGear (function: [[getVehicleCurrentGear]])<br />
getGravity (function: [[getVehicleGravity]])<br />
getHandling (function: [[getVehicleHandling]])<br />
getHeadLightColor (function: [[getVehicleHeadLightColor]])<br />
getHelicopterRotorSpeed (function: [[getHelicopterRotorSpeed]])<br />
getLandingGearDown (function: [[getVehicleLandingGearDown]])<br />
getLightState (function: [[getVehicleLightState]])<br />
getMaxPassengers (function: [[getVehicleMaxPassengers]])<br />
getName (function: [[getVehicleName]])<br />
getNitroCount (function: [[getVehicleNitroCount]])<br />
getNitroLevel (function: [[getVehicleNitroLevel]])<br />
getOccupant (function: [[getVehicleOccupant]])<br />
getOccupants (function: [[getVehicleOccupants]])<br />
getOverrideLights (function: [[getVehicleOverrideLights]])<br />
getPaintjob (function: [[getVehiclePaintjob]])<br />
getPanelState (function: [[getVehiclePanelState]])<br />
getPlateText (function: [[getVehiclePlateText]])<br />
getSirens (function: [[getVehicleSirens]])<br />
getSirensOn (function: [[getVehicleSirensOn]])<br />
getTowedByVehicle (function: [[getVehicleTowedByVehicle]])<br />
getTowingVehicle (function: [[getVehicleTowingVehicle]])<br />
getTrainDirection (function: [[getTrainDirection]])<br />
getTrainSpeed (function: [[getTrainSpeed]])<br />
getTurnVelocity (function: [[getVehicleTurnVelocity]])<br />
getTurretPosition (function: [[getVehicleTurretPosition]])<br />
getUpgrades (function: [[getVehicleUpgrades]])<br />
getUpgradeSlotName (function: [[getVehicleUpgradeSlotName]])<br />
getVariant (function: [[getVehicleVariant]])<br />
getVehicleType (function: [[getVehicleType]])<br />
getWheelStates (function: [[getVehicleWheelStates]])<br />
isBlown (function: [[isVehicleBlown]])<br />
isDamageProof (function: [[isVehicleDamageProof]])<br />
isFuelTankExplodable (function: [[isVehicleFuelTankExplodable]])<br />
isLocked (function: [[isVehicleLocked]])<br />
isNitroActivated (function: [[isVehicleNitroActivated]])<br />
isNitroRecharging (function: [[isVehicleNitroRecharging]])<br />
isOnGround (function: [[isVehicleOnGround]])<br />
isTaxiLightOn (function: [[isVehicleTaxiLightOn]])<br />
isTrainDerailable (function: [[setTrainDerailable]])<br />
isTrainDerailed (function: [[isTrainDerailed]])<br />
isWheelCollided (function: [[isVehicleWheelCollided]])<br />
removeUpgrade (function: [[removeVehicleUpgrade]])<br />
resetComponentPosition (function: [[resetVehicleComponentPosition]])<br />
resetComponentRotation (function: [[resetVehicleComponentRotation]])<br />
setAdjustableProperty (function: [[setVehicleAdjustableProperty]])<br />
setColor (function: [[setVehicleColor]])<br />
setComponentPosition (function: [[setVehicleComponentPosition]])<br />
setComponentRotation (function: [[setVehicleComponentRotation]])<br />
setComponentVisible (function: [[setVehicleComponentVisible]])<br />
setDamageProof (function: [[setVehicleDamageProof]])<br />
setDirtLevel (function: [[setVehicleDirtLevel]])<br />
setDoorOpenRatio (function: [[setVehicleDoorOpenRatio]])<br />
setDoorState (function: [[setVehicleDoorState]])<br />
setDoorsUndamageable (function: [[setVehicleDoorsUndamageable]])<br />
setEngineState (function: [[setVehicleEngineState]])<br />
setFuelTankExplodable (function: [[setVehicleFuelTankExplodable]])<br />
setGravity (function: [[setVehicleGravity]])<br />
setHeadLightColor (function: [[setVehicleHeadLightColor]])<br />
setHelicopterRotorSpeed (function: [[setHelicopterRotorSpeed]])<br />
setLandingGearDown (function: [[setVehicleLandingGearDown]])<br />
setLightState (function: [[setVehicleLightState]])<br />
setLocked (function: [[setVehicleLocked]])<br />
setNitroActivated (function: [[setVehicleNitroActivated]])<br />
setNitroCount (function: [[setVehicleNitroCount]])<br />
setNitroLevel (function: [[setVehicleNitroLevel]])<br />
setOverrideLights (function: [[setVehicleOverrideLights]])<br />
setPaintjob (function: [[setVehiclePaintjob]])<br />
setPanelState (function: [[setVehiclePanelState]])<br />
setSirens (function: [[setVehicleSirens]])<br />
setSirensOn (function: [[setVehicleSirensOn]])<br />
setTaxiLightOn (function: [[setVehicleTaxiLightOn]])<br />
setTrainDerailable (function: [[setTrainDerailable]])<br />
setTrainDerailed (function: [[setTrainDerailed]])<br />
setTrainDirection (function: [[setTrainDirection]])<br />
setTrainSpeed (function: [[setTrainSpeed]])<br />
setTurnVelocity (function: [[setVehicleTurnVelocity]])<br />
setTurretPosition (function: [[setVehicleTurretPosition]])<br />
setVariant (function: [[setVehicleVariant]])<br />
setWheelStates (function: [[setVehicleWheelStates]])<br />
<br />
==Ped==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
addClothes (function: [[addPedClothes]])<br />
canBeKnockedOffBike (function: [[canPedBeKnockedOffBike]])<br />
create (function: [[createPed]])<br />
doesHaveJetPack (function: [[doesPedHaveJetPack]])<br />
getAmmoInClip (function: [[getPedAmmoInClip]])<br />
getAnalogControlState (function: [[getPedAnalogControlState]])<br />
getAnimation (function: [[getPedAnimation]])<br />
getAnimationData (function: [[getPedAnimationData]])<br />
getArmor (function: [[getPedArmor]])<br />
getBodyPartName (function: [[getBodyPartName]])<br />
getBonePosition (function: [[getPedBonePosition]])<br />
getCameraRotation (function: [[getPedCameraRotation]])<br />
getClothes (function: [[getPedClothes]])<br />
getClothesByTypeIndex (function: [[getClothesByTypeIndex]])<br />
getClothesTypeName (function: [[getClothesTypeName]])<br />
getContactElement (function: [[getPedContactElement]])<br />
getControlState (function: [[getPedControlState]])<br />
getMoveState (function: [[getPedMoveState]])<br />
getOccupiedVehicle (function: [[GetPedOccupiedVehicle]])<br />
getOxygenLevel (function: [[getPedOxygenLevel]])<br />
getSimplestTask (function: [[getPedSimplestTask]])<br />
getStat (function: [[getPedStat]])<br />
getTarget (function: [[getPedTarget]])<br />
getTargetCollision (function: [[getPedTargetCollision]])<br />
getTargetEnd (function: [[getPedTargetEnd]])<br />
getTargetStart (function: [[getPedTargetStart]])<br />
getTask (function: [[getPedTask]])<br />
getTotalAmmo (function: [[getPedTotalAmmo]])<br />
getTypeIndexFromClothes (function: [[getTypeIndexFromClothes]])<br />
getValidModels (function: [[getValidPedModels]])<br />
getVoice (function: [[getPedVoice]])<br />
getWalkingStyle (function: [[getPedWalkingStyle]])<br />
getWeapon (function: [[getPedWeapon]])<br />
getWeaponMuzzlePosition (function: [[getPedWeaponMuzzlePosition]])<br />
isChocking (function: [[isPedChoking]])<br />
isDoingGangDriveby (function: [[isPedDoingGangDriveby]])<br />
isDoingTask (function: [[isPedDoingTask]])<br />
isDucked (function: [[isPedDucked]])<br />
isHeadless (function: [[isPedHeadless]])<br />
isInVehicle (function: [[isPedInVehicle]])<br />
isOnFire (function: [[isPedOnFire]])<br />
isOnGround (function: [[isPedOnGround]])<br />
isReloadingWeapon (function: [[isPedReloadingWeapon]])<br />
isTargetingMarkerEnabled (function: [[isPedTargetingMarkerEnabled]])<br />
removeClothes (function: [[removePedClothes]])<br />
removeFromVehicle (function: [[removePedFromVehicle]])<br />
setAimTarget (function: [[setPedAimTarget]])<br />
setAnalogControlState (function: [[setPedAnalogControlState]])<br />
setAnimation (function: [[setPedAnimation]])<br />
setAnimationProgress (function: [[setPedAnimationProgress]])<br />
setCameraRotation (function: [[setPedCameraRotation]])<br />
setCanBeKnockedOffBike (function: [[setPedCanBeKnockedOffBike]])<br />
setControlState (function: [[setPedControlState]])<br />
setDoingGangDriveby (function: [[setPedDoingGangDriveby]])<br />
setFootBloodEnabled (function: [[setPedFootBloodEnabled]])<br />
setHeadless (function: [[setPedHeadless]])<br />
setLookAt (function: [[setPedLookAt]])<br />
setOnFire (function: [[setPedOnFire]])<br />
setOxygenLevel (function: [[setPedOxygenLevel]])<br />
setTargetingMarkerEnabled (function: [[setPedTargetingMarkerEnabled]])<br />
setVoice (function: [[setPedVoice]])<br />
setWalkingStyle (function: [[setPedWalkingStyle]])<br />
setWeaponSlot (function: [[setPedWeaponSlot]])<br />
warpIntoVehicle (function: [[warpPedIntoVehicle]])<br />
<br />
==Player==<br />
''Inherited from [[#Ped|Ped]]''<br />
<br />
create (function: [[getPlayerFromName]])<br />
getBlurLevel (function: [[getPlayerBlurLevel]])<br />
getMapBoundingBox (function: [[getPlayerMapBoundingBox]])<br />
getMoney (function: [[getPlayerMoney]])<br />
getName (function: [[getPlayerName]])<br />
getNametagColor (function: [[getPlayerNametagColor]])<br />
getNametagText (function: [[getPlayerNametagText]])<br />
getPing (function: [[getPlayerPing]])<br />
getSerial (function: [[getPlayerSerial]])<br />
getTeam (function: [[getPlayerTeam]])<br />
getWantedLevel (function: [[getPlayerWantedLevel]])<br />
giveMoney (function: [[givePlayerMoney]])<br />
isHudComponentVisible (function: [[isPlayerHudComponentVisible]])<br />
isMapForced (function: [[isPlayerMapForced]])<br />
isMapVisible (function: [[isPlayerMapVisible]])<br />
isNametagShowing (function: [[isPlayerNametagShowing]])<br />
setBlurLevel (function: [[setPlayerBlurLevel]])<br />
setMoney (function: [[setPlayerMoney]])<br />
setNametagColor (function: [[setPlayerNametagColor]])<br />
setNametagShowing (function: [[setPlayerNametagShowing]])<br />
setNametagText (function: [[setPlayerNametagText]])<br />
showHudComponent (function: [[showPlayerHudComponent]])<br />
takeMoney (function: [[takePlayerMoney]])<br />
<br />
==Object==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
break (function: [[breakObject]])<br />
create (function: [[createObject]])<br />
getMass (function: [[getObjectMass]])<br />
getScale (function: [[getObjectScale]])<br />
isBreakable (function: [[isObjectBreakable]])<br />
move (function: [[moveObject]])<br />
respawn (function: [[respawnObject]])<br />
setBreakable (function: [[setObjectBreakable]])<br />
setMass (function: [[setObjectMass]])<br />
setScale (function: [[setObjectScale]])<br />
stop (function: [[stopObject]])<br />
toggleObjectRespawn (function: [[toggleObjectRespawn]])<br />
<br />
==Marker==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createMarker]])<br />
getColor (function: [[getMarkerColor]])<br />
getCount (function: [[getMarkerCount]])<br />
getIcon (function: [[getMarkerIcon]])<br />
getSize (function: [[getMarkerSize]])<br />
getTarget (function: [[getMarkerTarget]])<br />
getType (function: [[getMarkerType]])<br />
setColor (function: [[setMarkerColor]])<br />
setIcon (function: [[setMarkerIcon]])<br />
setSize (function: [[setMarkerSize]])<br />
setTarget (function: [[setMarkerTarget]])<br />
setType (function: [[setMarkerType]])<br />
<br />
==Blip==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createBlip]])<br />
createAttachedTo (function: [[createBlipAttachedTo]])<br />
getColor (function: [[getBlipColor]])<br />
getIcon (function: [[getBlipIcon]])<br />
getOrdering (function: [[getBlipOrdering]])<br />
getSize (function: [[getBlipSize]])<br />
getVisibleDistance (function: [[getBlipVisibleDistance]])<br />
setColor (function: [[setBlipColor]])<br />
setIcon (function: [[setBlipIcon]])<br />
setOrdering (function: [[setBlipOrdering]])<br />
setSize (function: [[setBlipSize]])<br />
setVisibleDistance (function: [[setBlipVisibleDistance]])<br />
<br />
==Pickup==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createPickup]])<br />
getAmmo (function: [[getPickupAmmo]])<br />
getAmount (function: [[getPickupAmount]])<br />
getType (function: [[getPickupType]])<br />
getWeapon (function: [[getPickupWeapon]])<br />
setType (function: [[setPickupType]])<br />
<br />
==ColShape==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
Circle (function: [[createColCircle]])<br />
Cuboid (function: [[createColCuboid]])<br />
getElementsWithin (function: [[getElementsWithinColShape]])<br />
getShapeType (function: [[getColShapeType]])<br />
isElementWithin (function: [[isElementWithinColShape]])<br />
Polygon (function: [[createColPolygon]])<br />
Rectangle (function: [[createColRectangle]])<br />
Sphere (function: [[createColSphere]])<br />
Tube (function: [[createColTube]])<br />
<br />
==Projectile==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createProjectile]])<br />
getCounter (function: [[getProjectileCounter]])<br />
getCreator (function: [[getProjectileCreator]])<br />
getForce (function: [[getProjectileForce]])<br />
getTarget (function: [[getProjectileTarget]])<br />
getType (function: [[getProjectileType]])<br />
setCounter (function: [[setProjectileCounter]])<br />
<br />
==RadarArea==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createRadarArea]])<br />
getColor (function: [[getRadarAreaColor]])<br />
getSize (function: [[getRadarAreaSize]])<br />
isFlashing (function: [[isRadarAreaFlashing]])<br />
isInside (function: [[isInsideRadarArea]])<br />
setColor (function: [[setRadarAreaColor]])<br />
setFlashing (function: [[setRadarAreaFlashing]])<br />
setSize (function: [[setRadarAreaSize]])<br />
<br />
==Team==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
countPlayers (function: [[countPlayersInTeam]])<br />
create (function: [[getTeamFromName]])<br />
getColor (function: [[getTeamColor]])<br />
getFriendlyFire (function: [[getTeamFriendlyFire]])<br />
getFromName (function: [[getTeamFromName]])<br />
getName (function: [[getTeamName]])<br />
<br />
==Water==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createWater]])<br />
getColor (function: [[getWaterColor]])<br />
getLevel (function: [[getWaterLevel]])<br />
getVertexPosition (function: [[getWaterVertexPosition]])<br />
getWaveHeight (function: [[getWaveHeight]])<br />
isDrawnLast (function: [[isWaterDrawnLast]])<br />
resetColor (function: [[resetWaterColor]])<br />
resetLevel (function: [[resetWaterLevel]])<br />
setColor (function: [[setWaterColor]])<br />
setDrawnLast (function: [[setWaterDrawnLast]])<br />
setLevel (function: [[setWaterLevel]])<br />
setVertexPosition (function: [[setWaterVertexPosition]])<br />
setWaveHeight (function: [[setWaveHeight]])<br />
testLineAgainst (function: [[testLineAgainstWater]])<br />
<br />
==Sound==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[playSound]])<br />
getBPM (function: [[getSoundBPM]])<br />
getEffects (function: [[getSoundEffects]])<br />
getFFTData (function: [[getSoundFFTData]])<br />
getLength (function: [[getSoundLength]])<br />
getLevelData (function: [[getSoundLevelData]])<br />
getMetaTags (function: [[getSoundMetaTags]])<br />
getPan (function: [[getSoundPan]])<br />
getPlaybackPosition (function: [[getSoundPosition]])<br />
getProperties (function: [[getSoundProperties]])<br />
getSpeed (function: [[getSoundSpeed]])<br />
getVolume (function: [[getSoundVolume]])<br />
getWaveData (function: [[getSoundWaveData]])<br />
isPaused (function: [[isSoundPaused]])<br />
setEffectEnabled (function: [[setSoundEffectEnabled]])<br />
setPan (function: [[setSoundPan]])<br />
setPaused (function: [[setSoundPaused]])<br />
setPlaybackPosition (function: [[setSoundPosition]])<br />
setProperties (function: [[setSoundProperties]])<br />
setSpeed (function: [[setSoundSpeed]])<br />
setVolume (function: [[setSoundVolume]])<br />
stop (function: [[stopSound]])<br />
<br />
==Sound3D==<br />
''Inherited from [[#Sound|Sound]]''<br />
<br />
create (function: [[playSound3D]])<br />
getMaxDistance (function: [[getSoundMaxDistance]])<br />
getMinDistance (function: [[getSoundMinDistance]])<br />
setMaxDistance (function: [[setSoundMaxDistance]])<br />
setMinDistance (function: [[setSoundMinDistance]])<br />
<br />
==Weapon==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[createWeapon]])<br />
fire (function: [[fireWeapon]])<br />
getAmmo (function: [[getWeaponAmmo]])<br />
getClipAmmo (function: [[getWeaponClipAmmo]])<br />
getFiringRate (function: [[getWeaponFiringRate]])<br />
getFlags (function: [[getWeaponFlags]])<br />
getOwner (function: [[getWeaponOwner]])<br />
getProperty (function: [[setWeaponProperty]])<br />
getState (function: [[getWeaponState]])<br />
getTarget (function: [[getWeaponTarget]])<br />
resetFiringRate (function: [[resetWeaponFiringRate]])<br />
setAmmo (function: [[setWeaponAmmo]])<br />
setClipAmmo (function: [[setWeaponClipAmmo]])<br />
setFiringRate (function: [[setWeaponFiringRate]])<br />
setFlags (function: [[setWeaponFlags]])<br />
setOwner (function: [[setWeaponOwner]])<br />
setProperty (function: [[setWeaponProperty]])<br />
setState (function: [[setWeaponState]])<br />
setTarget (function: [[setWeaponTarget]])<br />
<br />
==Effect==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
addBlood (function: [[fxAddBlood]])<br />
addBulletImpact (function: [[fxAddBulletImpact]])<br />
addBulletSplash (function: [[fxAddBulletSplash]])<br />
addDebris (function: [[fxAddDebris]])<br />
addFootSplash (function: [[fxAddFootSplash]])<br />
addGlass (function: [[fxAddGlass]])<br />
addGunshot (function: [[fxAddGunshot]])<br />
addPunchImpact (function: [[fxAddPunchImpact]])<br />
addSparks (function: [[fxAddSparks]])<br />
addTankFire (function: [[fxAddTankFire]])<br />
addTyreBurst (function: [[fxAddTyreBurst]])<br />
addWaterHydrant (function: [[fxAddWaterHydrant]])<br />
addWaterSplash (function: [[fxAddWaterSplash]])<br />
addWood (function: [[fxAddWood]])<br />
create (function: [[createEffect]])<br />
getDensity (function: [[getEffectDensity]])<br />
getSpeed (function: [[getEffectSpeed]])<br />
setDensity (function: [[setEffectDensity]])<br />
setSpeed (function: [[setEffectSpeed]])<br />
<br />
==GuiElement==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
bringToFront (function: [[guiBringToFront]])<br />
moveToBack (function: [[guiMoveToBack]])<br />
isChatBoxInputActive (function: [[isChatBoxInputActive]])<br />
isConsoleActive (function: [[isConsoleActive]])<br />
isDebugViewActive (function: [[isDebugViewActive]])<br />
isMainMenuActive (function: [[isMainMenuActive]])<br />
isMTAWindowActive (function: [[isMTAWindowActive]])<br />
isTransferBoxActive (function: [[isTransferBoxActive]])<br />
isInputEnabled (function: [[guiGetInputEnabled]])<br />
getInputMode (function: [[guiGetInputMode]])<br />
getScreenSize (function: [[guiGetScreenSize]])<br />
getProperties (function: [[guiGetProperties]])<br />
getAlpha (function: [[guiGetAlpha]])<br />
getFont (function: [[guiGetFont]])<br />
getEnabled (function: [[guiGetEnabled]])<br />
getVisible (function: [[guiGetVisible]])<br />
getText (function: [[guiGetText]])<br />
getPosition (function: [[guiGetPosition]])<br />
getSize (function: [[guiGetSize]])<br />
getProperty (function: [[guiGetProperty]])<br />
setInputEnabled (function: [[guiSetInputEnabled]])<br />
setAlpha (function: [[guiSetAlpha]])<br />
setEnabled (function: [[guiSetEnabled]])<br />
setFont (function: [[guiSetFont]])<br />
setVisible (function: [[guiSetVisible]])<br />
setText (function: [[guiSetText]])<br />
setInputMode (function: [[guiSetInputMode]])<br />
setProperty (function: [[guiSetProperty]])<br />
setPosition (function: [[guiSetPosition]])<br />
setSize (function: [[guiSetSize]])<br />
==GuiWindow==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateWindow]])<br />
setMovable (function: [[guiWindowSetMovable]])<br />
setSizable (function: [[guiWindowSetSizable]])<br />
==GuiButton==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateButton]])<br />
==GuiEdit==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateEdit]])<br />
getCaretIndex (function: [[guiEditGetCaretIndex]])<br />
setCaretIndex (function: [[guiEditSetCaretIndex]])<br />
setReadOnly (function: [[guiEditSetReadOnly]])<br />
setMasked (function: [[guiEditSetMasked]])<br />
setMaxLength (function: [[guiEditSetMaxLength]])<br />
==GuiLabel==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateLabel]])<br />
getFontHeight (function: [[guiLabelGetFontHeight]])<br />
getTextExtent (function: [[guiLabelGetTextExtent]])<br />
getColor (function: [[guiLabelGetColor]])<br />
setColor (function: [[guiLabelSetColor]])<br />
setHorizontalAlign (function: [[guiLabelSetHorizontalAlign]])<br />
setVerticalAlign (function: [[guiLabelSetVerticalAlign]])<br />
==GuiMemo==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateMemo]])<br />
getCaretIndex (function: [[guiMemoGetCaretIndex]])<br />
setCaretIndex (function: [[guiMemoSetCaretIndex]])<br />
setReadOnly (function: [[guiMemoSetReadOnly]])<br />
==GuiStaticImage==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateStaticImage]])<br />
loadImage (function: [[guiStaticImageLoadImage]])<br />
==GuiComboBox==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateComboBox]])<br />
addItem (function: [[guiComboBoxAddItem]])<br />
clear (function: [[guiComboBoxClear]])<br />
removeItem (function: [[guiComboBoxRemoveItem]])<br />
getSelected (function: [[guiComboBoxGetSelected]])<br />
getItemText (function: [[guiComboBoxGetItemText]])<br />
setItemText (function: [[guiComboBoxSetItemText]])<br />
setSelected (function: [[guiComboBoxSetSelected]])<br />
==GuiCheckBox==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateCheckBox]])<br />
getSelected (function: [[guiCheckBoxGetSelected]])<br />
setSelected (function: [[guiCheckBoxSetSelected]])<br />
==GuiRadioButton==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateRadioButton]])<br />
getSelected (function: [[guiRadioButtonGetSelected]])<br />
setSelected (function: [[guiRadioButtonSetSelected]])<br />
==GuiScrollPane==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateScrollPane]])<br />
getHorizontalScrollPosition (function: [[guiScrollPaneGetHorizontalScrollPosition]])<br />
getVerticalScrollPosition (function: [[guiScrollPaneGetVerticalScrollPosition]])<br />
setHorizontalScrollPosition (function: [[guiScrollPaneSetHorizontalScrollPosition]])<br />
setScrollBars (function: [[guiScrollPaneSetScrollBars]])<br />
setVerticalScrollPosition (function: [[guiScrollPaneSetVerticalScrollPosition]])<br />
==GuiScrollBar==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateScrollBar]])<br />
getScrollPosition (function: [[guiScrollBarGetScrollPosition]])<br />
setScrollPosition (function: [[guiScrollBarSetScrollPosition]])<br />
==GuiProgressBar==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateProgressBar]])<br />
getProgress (function: [[guiProgressBarGetProgress]])<br />
setProgress (function: [[guiProgressBarSetProgress]])<br />
==GuiGridList==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateGridList]])<br />
addColumn (function: [[guiGridListAddColumn]])<br />
addRow (function: [[guiGridListAddRow]])<br />
autoSizeColumn (function: [[guiGridListAutoSizeColumn]])<br />
clear (function: [[guiGridListClear]])<br />
insertRowAfter (function: [[guiGridListInsertRowAfter]])<br />
removeColumn (function: [[guiGridListRemoveColumn]])<br />
removeRow (function: [[guiGridListRemoveRow]])<br />
getItemData (function: [[guiGridListGetItemData]])<br />
getItemText (function: [[guiGridListGetItemText]])<br />
getRowCount (function: [[guiGridListGetRowCount]])<br />
getSelectedItem (function: [[guiGridListGetSelectedItem]])<br />
getItemColor (function: [[guiGridListGetItemColor]])<br />
getColumnTitle (function: [[guiGridListGetColumnTitle]])<br />
getHorizontalScrollPosition (function: [[guiGridListGetHorizontalScrollPosition]])<br />
getVerticalScrollPosition (function: [[guiGridListGetVerticalScrollPosition]])<br />
getSelectedCount (function: [[guiGridListGetSelectedCount]])<br />
getSelectedItems (function: [[guiGridListGetSelectedItems]])<br />
getColumnCount (function: [[guiGridListGetColumnCount]])<br />
setItemData (function: [[guiGridListSetItemData]])<br />
setItemText (function: [[guiGridListSetItemText]])<br />
setScrollBars (function: [[guiGridListSetScrollBars]])<br />
setSelectedItem (function: [[guiGridListSetSelectedItem]])<br />
setSelectionMode (function: [[guiGridListSetSelectionMode]])<br />
setSortingEnabled (function: [[guiGridListSetSortingEnabled]])<br />
setColumnWidth (function: [[guiGridListSetColumnWidth]])<br />
setItemColor (function: [[guiGridListSetItemColor]])<br />
setColumnTitle (function: [[guiGridListSetColumnTitle]])<br />
setHorizontalScrollPosition (function: [[guiGridListSetHorizontalScrollPosition]])<br />
setVerticalScrollPosition (function: [[guiGridListSetVerticalScrollPosition]])<br />
<br />
==GuiTabPanel==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateTabPanel]])<br />
getSelectedTab (function: [[guiGetSelectedTab]])<br />
setSelectedTab (function: [[guiSetSelectedTab]])<br />
==GuiTab==<br />
''Inherited from [[#GuiElement|GuiElement]]''<br />
<br />
create (function: [[guiCreateTab]])<br />
delete (function: [[guiDeleteTab]])<br />
==GuiFont==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[guiCreateFont]])<br />
==Resource==<br />
create (function: [[getResourceFromName]])<br />
fromName (function: [[getResourceFromName]])<br />
getGuiElement (function: [[getResourceGUIElement]])<br />
getRootElement (function: [[getResourceRootElement]])<br />
getName (function: [[getResourceName]])<br />
getThis (function: [[getThisResource]])<br />
getConfig (function: [[getResourceConfig]])<br />
getConfig (function: [[getResourceConfig]])<br />
getDynamicElementRoot (function: [[getResourceDynamicElementRoot]])<br />
getExportedFunctions (function: [[getResourceExportedFunctions]])<br />
getState (function: [[getResourceState]])<br />
==Timer==<br />
create (function: [[setTimer]])<br />
destroy (function: [[killTimer]])<br />
reset (function: [[resetTimer]])<br />
isValid (function: [[isTimer]])<br />
getDetails (function: [[getTimerDetails]])<br />
==File==<br />
create (function: [[fileOpen]])<br />
destroy (function: [[fileClose]])<br />
close (function: [[fileClose]])<br />
new (function: [[fileCreate]])<br />
delete (function: [[fileDelete]])<br />
exists (function: [[fileExists]])<br />
flush (function: [[fileFlush]])<br />
getPos (function: [[fileGetPos]])<br />
getSize (function: [[fileGetSize]])<br />
isEOF (function: [[fileIsEOF]])<br />
read (function: [[fileRead]])<br />
rename (function: [[fileRename]])<br />
setPos (function: [[fileSetPos]])<br />
write (function: [[fileWrite]])<br />
copy (function: [[fileCopy]])<br />
==XML==<br />
load (function: [[xmlLoadFile]])<br />
unload (function: [[xmlUnloadFile]])<br />
copy (function: [[xmlCopyFile]])<br />
create (function: [[xmlCreateFile]])<br />
destroy (function: [[xmlDestroyNode]])<br />
getValue (function: [[xmlNodeGetValue]])<br />
setAttribute (function: [[xmlNodeSetAttribute]])<br />
setValue (function: [[xmlNodeSetValue]])<br />
saveFile (function: [[xmlSaveFile]])<br />
createChild (function: [[xmlCreateChild]])<br />
findChild (function: [[xmlFindChild]])<br />
getAttributes (function: [[xmlNodeGetAttributes]])<br />
getChildren (function: [[xmlNodeGetChildren]])<br />
getName (function: [[xmlNodeGetName]])<br />
getParent (function: [[xmlNodeGetParent]])<br />
getAttribute (function: [[xmlNodeGetAttribute]])<br />
setName (function: [[xmlNodeSetName]])<br />
<br />
==Camera==<br />
fade (function: [[fadeCamera]])<br />
getTarget (function: [[getCameraTarget]])<br />
getInterior (function: [[getCameraInterior]])<br />
getViewMode (function: [[getCameraViewMode]])<br />
getGoggleEffect (function: [[getCameraGoggleEffect]])<br />
setInterior (function: [[setCameraInterior]])<br />
setTarget (function: [[setCameraTarget]])<br />
setViewMode (function: [[setCameraViewMode]])<br />
setGoggleEffect (function: [[setCameraGoggleEffect]])<br />
setClip (function: [[setCameraClip]])<br />
==Engine==<br />
restoreCOL (function: [[engineRestoreCOL]])<br />
restoreModel (function: [[engineRestoreModel]])<br />
setAsynchronousLoading (function: [[engineSetAsynchronousLoading]])<br />
setModelLODDistance (function: [[engineSetModelLODDistance]])<br />
getVisibleTextureName (function: [[engineGetVisibleTextureNames]])<br />
getModelLODDistance (function: [[engineGetModelLODDistance]])<br />
getModelTextureNames (function: [[engineGetModelTextureNames]])<br />
getModelIDFromName (function: [[engineGetModelIDFromName]])<br />
getModelNameFromID (function: [[engineGetModelNameFromID]])<br />
==EngineCOL==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[engineLoadCOL]])<br />
replace (function: [[engineReplaceCOL]])<br />
==EngineTXD==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[engineLoadTXD]])<br />
import (function: [[engineImportTXD]])<br />
==EngineDFF==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
create (function: [[engineLoadDFF]])<br />
replace (function: [[engineReplaceModel]])<br />
==DxMaterial==<br />
''Inherited from [[#Element|Element]]''<br />
<br />
getSize (function: [[dxGetMaterialSize]])<br />
==DxTexture==<br />
''Inherited from [[#DxMaterial|DxMaterial]]''<br />
<br />
create (function: [[dxCreateTexture]])<br />
setEdge (function: [[dxSetTextureEdge]])<br />
setPixels (function: [[dxSetTexturePixels]])<br />
getPixels (function: [[dxGetTexturePixels]])<br />
==DxFont==<br />
create (function: [[dxCreateFont]])<br />
getHeight (function: [[dxGetFontHeight]])<br />
getTextWidth (function: [[dxGetTextWidth]])<br />
==DxShader==<br />
''Inherited from [[#DxMaterial|DxMaterial]]''<br />
<br />
create (function: [[dxCreateShader]])<br />
setValue (function: [[dxSetShaderValue]])<br />
setTessellation (function: [[dxSetShaderTessellation]])<br />
setTransform (function: [[dxSetShaderTransform]])<br />
value (function: [[dxGetFontHeight]])<br />
==DxScreenSource==<br />
create (function: [[dxCreateScreenSource]])<br />
update (function: [[dxUpdateScreenSource]])<br />
==DxRenderTarget==<br />
create (function: [[dxCreateRenderTarget]])<br />
setAsTarget (function: [[dxSetRenderTarget]])<br />
<br />
[[Category:OOP]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=SetFPSLimit&diff=65852SetFPSLimit2020-04-15T12:50:07Z<p>Patrick2562: /* Issues when increasing FPS */</p>
<hr />
<div>{{Server client function}}<br />
__NOTOC__<br />
This function sets the maximum [http://en.wikipedia.org/wiki/Frame_rate FPS (Frames per second)] that players on the server can run their game at. <br />
{{Note|When set client side, the actual limit used is the lowest of both the server and client set values}}<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool setFPSLimit ( int fpsLimit ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''fpsLimit:''' An integer value representing the maximum FPS. This value may be between '''25''' and '''100''' FPS. You can also pass '''0''' or ''false'', in which case the FPS limit will be the one set in the client settings (by default, 100 FPS).<br />
<br />
===Returns===<br />
Returns ''true'' if successful, or ''false'' if it was not possible to set the limit or an invalid value was passed.<br />
<br />
==Issues when increasing FPS==<br />
It is also recommended to set a conservative FPS limit (between 30-60), because high FPS can break some GTA internal calculations. The higher the FPS the more of a problem these become:<br />
* Impossibility to move sideways while aiming certain weapons.<br />
* Speed of vehicles is effected, racers with a higher FPS will have an unfair advantage.<br />
* Pressing the horn button to turn on and off sirens gets really hard the higher the FPS.<br />
* Climbing over certain objects will result in instant death. Example at: 2520.108, -1681.407, 19.406, 266<br />
* Animations can randomly get messed up.<br />
* There were more issues like not being able to take off in Skimmer which MTA developers have fixed.<br />
* Satchels can be thrown ~10% less distance.<br />
<br />
==Example== <br />
This command sets the fps limit in a command handler.<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua">function fpsFunction( player, command, limit ) -- First define the function<br />
if hasObjectPermissionTo ( player, "function.setFPSLimit" ) and limit then <br />
-- If the player has permission to set FPS limit and limit is submitted...<br />
setFPSLimit ( limit ) -- Set the fps.<br />
end<br />
end <br />
<br />
addCommandHandler ( "setfps", fpsFunction ) -- Attach the setfps command to fpsFunction function.<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Server functions}}<br />
<br />
[[pl:setFPSLimit]]<br />
[[ru:setFPSLimit]]</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OnPlayerCommand&diff=65769OnPlayerCommand2020-04-08T14:29:05Z<p>Patrick2562: /* Result of cancelling this event */</p>
<hr />
<div>__NOTOC__<br />
{{Server event}}<br />
This event is triggered when a player issues a command.<br />
{{Note|This event triggers regardless of whether the command exists in a script or is hardcoded. Also, typing anything in chat will execute the internal command "say", so this event will be triggered on every chat message as well. Therefore you should avoid excessive use of this function on busy servers, out of performance considerations.}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string command<br />
</syntaxhighlight><br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[player]] who tried to execute a command.<br />
<br />
==Result of cancelling this event==<br />
The command will not be executed. (Only server-side commands can be canceled.)<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
This example implements an anti-flood protection timer for commands.<br />
'''Be sure to give the resource a function.kickPlayer right.<br />
Also, note, that if the server freezes for a frame and a player executes a command 2x he/she'll get kicked, because those 2 commands will be processed after each other, with very little delay'''<br />
<syntaxhighlight lang="lua"><br />
local CMD_INTERVAL = 200 --// The interval that needs to pass before the player can execute another cmd<br />
local KICK_AFTER_INTERVAL = 50 --// Kick the player if they execute more than 20 cmds/sec<br />
<br />
local executions = setmetatable({}, { --// Metatable for non-existing indexes<br />
__index = function(t, player)<br />
return getTickCount()-CMD_INTERVAL<br />
end<br />
})<br />
<br />
addEventHandler("onPlayerCommand", root,<br />
function()<br />
if (executions[source]-getTickCount()<=CMD_INTERVAL) then<br />
if (executions[source]-getTickCount()<=KICK_AFTER_INTERVAL) then <br />
kickPlayer(source, "Anti-Flood", "Don't flood")<br />
end <br />
cancelEvent()<br />
end<br />
executions[source] = getTickCount()<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
This example disables the hardcoded command 'whois'<br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onPlayerCommand",root,<br />
function(command)<br />
if (command == "whois") then<br />
cancelEvent()<br />
end<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
<br />
<section name="Server" class="server" show="true"><br />
Time limit specific commands.<br />
<syntaxhighlight lang="lua"><br />
local LIMITED_COMMANDS = {<br />
-- ["COMMAND_NAME"] = TIME_LIMIT_IN_SEC<br />
["something"] = 5, -- Can use this command only once in every 5 sec<br />
["spam"] = 10, -- Can use this command only once in every 10 sec<br />
}<br />
<br />
local EXEC = {}<br />
<br />
addEventHandler("onPlayerCommand", root, function(cmd)<br />
local limit_sec = LIMITED_COMMANDS[cmd]<br />
if not limit_sec then return end<br />
<br />
local tick = getTickCount()<br />
<br />
if not EXEC[source] then EXEC[source] = {} end<br />
if not EXEC[source][cmd] then EXEC[source][cmd] = 0 end<br />
<br />
if EXEC[source][cmd] + (limit_sec * 1000) > tick then<br />
cancelEvent()<br />
return outputChatBox("#FF0000[ANTISPAM]#FFFFFF You can use this command once, in every "..limit_sec.." sec.", source, 255, 255, 255, true)<br />
end<br />
EXEC[source][cmd] = tick<br />
end)<br />
<br />
addEventHandler("onPlayerQuit", root, function()<br />
EXEC[source] = nil<br />
end)<br />
</syntaxhighlight><br />
Author: !Patrick<br />
</section><br />
<br />
{{See also/Server event|Player events}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=OnPlayerCommand&diff=65716OnPlayerCommand2020-04-07T18:09:02Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__<br />
{{Server event}}<br />
This event is triggered when a player issues a command.<br />
{{Note|This event triggers regardless of whether the command exists in a script or is hardcoded. Also, typing anything in chat will execute the internal command "say", so this event will be triggered on every chat message as well. Therefore you should avoid excessive use of this function on busy servers, out of performance considerations.}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string command<br />
</syntaxhighlight><br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[player]] who tried to execute a command.<br />
<br />
==Result of cancelling this event==<br />
The command will not be executed.<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
This example implements an anti-flood protection timer for commands.<br />
'''Be sure to give the resource a function.kickPlayer right.<br />
Also, note, that if the server freezes for a frame and a player executes a command 2x he/she'll get kicked, because those 2 commands will be processed after each other, with very little delay'''<br />
<syntaxhighlight lang="lua"><br />
local CMD_INTERVAL = 200 --// The interval that needs to pass before the player can execute another cmd<br />
local KICK_AFTER_INTERVAL = 50 --// Kick the player if they execute more than 20 cmds/sec<br />
<br />
local executions = setmetatable({}, { --// Metatable for non-existing indexes<br />
__index = function(t, player)<br />
return getTickCount()-CMD_INTERVAL<br />
end<br />
})<br />
<br />
addEventHandler("onPlayerCommand", root,<br />
function()<br />
if (executions[source]-getTickCount()<=CMD_INTERVAL) then<br />
if (executions[source]-getTickCount()<=KICK_AFTER_INTERVAL) then <br />
kickPlayer(source, "Anti-Flood", "Don't flood")<br />
end <br />
cancelEvent()<br />
end<br />
executions[source] = getTickCount()<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
This example disables the hardcoded command 'whois'<br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onPlayerCommand",root,<br />
function(command)<br />
if (command == "whois") then<br />
cancelEvent()<br />
end<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
<br />
<section name="Server" class="server" show="true"><br />
Time limit specific commands.<br />
<syntaxhighlight lang="lua"><br />
local LIMITED_COMMANDS = {<br />
-- ["COMMAND_NAME"] = TIME_LIMIT_IN_SEC<br />
["something"] = 5, -- Can use this command only once in every 5 sec<br />
["spam"] = 10, -- Can use this command only once in every 10 sec<br />
}<br />
<br />
local EXEC = {}<br />
<br />
addEventHandler("onPlayerCommand", root, function(cmd)<br />
local limit_sec = LIMITED_COMMANDS[cmd]<br />
if not limit_sec then return end<br />
<br />
local tick = getTickCount()<br />
<br />
if not EXEC[source] then EXEC[source] = {} end<br />
if not EXEC[source][cmd] then EXEC[source][cmd] = 0 end<br />
<br />
if EXEC[source][cmd] + (limit_sec * 1000) > tick then<br />
cancelEvent()<br />
return outputChatBox("#FF0000[ANTISPAM]#FFFFFF You can use this command once, in every "..limit_sec.." sec.", source, 255, 255, 255, true)<br />
end<br />
EXEC[source][cmd] = tick<br />
end)<br />
<br />
addEventHandler("onPlayerQuit", root, function()<br />
EXEC[source] = nil<br />
end)<br />
</syntaxhighlight><br />
Author: !Patrick<br />
</section><br />
<br />
{{See also/Server event|Player events}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=FetchRemote&diff=65037FetchRemote2020-02-06T21:34:49Z<p>Patrick2562: /* Syntax */</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
This function allows you to post and receive data from HTTP servers. The calls are asynchronous so you do not get an immediate result from the call, instead a callback function you specify is called when the download completes.<br />
<br />
In the case when the call fails, a string containing "ERROR" followed by an integer containing the error reason will be passed to the callback function. The reason for failure will be similar to errors found with websites - file not found, server not found and timeouts.<br />
<br />
If you are using fetchRemote to connect to a PHP script, you can use ''file_get_contents("php://input")'' to read the '''postData''' sent from this function.<br />
{{Note|Client side function only works with the server the player is connected to unless the domain has been accepted with [[requestBrowserDomains]]}}<br />
{{ Warning| function won't trigger inside another fetchRemote function }}<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool fetchRemote ( string URL[, string queueName = "default" ][, int connectionAttempts = 10, int connectTimeout = 10000 ], function callbackFunction, [ string postData = "", bool postIsBinary = false, [ arguments... ] ] )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''URL:''' A full URL in the format ''<nowiki>http://hostname/path/file.ext</nowiki>''. A port can be specified with a colon followed by a port number appended to the hostname.<br />
*'''callbackFunction:''' This is the function that should receive the data returned from the remote server. The callback argument list should be:<br />
**'''''responseData''''' - A string containing the remote response or "ERROR" if there was a problem<br />
**'''''errno''''' - A number containing the error number or zero if there was no error. A list of possible error values are:<br />
{{Error_codes_for_callRemote_and_fetchRemote}}<br />
<div style="padding-left:19px;"><br />
*'''''arguments...''''' - The arguments that were passed into fetchRemote<br />
</div><br />
<br />
===Optional Arguments=== <br />
{{New items|4.0153|1.5.3-9.11270|<br />
*'''queueName:''' Name of the queue to use. Any name can be used. If not set, the queue name is "default". Requests in the same queue are processed in order, one at a time.<br />
}}<br />
*'''connectionAttempts:''' Number of times to retry if the remote host does not respond. ''In the case of a non-responding remote server, each connection attempt will timeout after 10 seconds. Therefore, the default setting of 10 connection attempts means it will be 100 seconds before your script gets a callback about the error. Reducing this value to 2 for example, will decrease that period to 20 seconds''<br />
*'''connectTimeout:''' Number of milliseconds each connection attempt will take before timing out<br />
*'''postData:''' A string specifying any data you want to send to the remote HTTP server.<br />
*'''postIsBinary :''' A boolean specifying if the data is text, or binary.<br />
*'''arguments:''' Any arguments you may want to pass to the callback.<br />
<br />
<br />
{{New items|5.0154|1.5.4-9.11342|<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool fetchRemote ( string URL[, table options ], callback callbackFunction[, table callbackArguments ] )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''URL:''' A full URL in the format ''<nowiki>http://hostname/path/file.ext</nowiki>''. A port can be specified with a colon followed by a port number appended to the hostname.<br />
*'''callbackFunction:''' This is the function that should receive the data returned from the remote server. The callback argument list should be:<br />
**'''''responseData''''' - A string containing the remote response<br />
**'''''responseInfo''''' - A table containing:<br />
***'''''success''''' - A boolean indicating if the request was successful.<br />
***'''''statusCode''''' - An integer status/error code<br />
***'''''headers''''' - A table containing the HTTP response headers<br />
**'''''arguments...''''' - The arguments that were passed into fetchRemote<br />
<br />
===Optional Arguments=== <br />
*'''options:''' A table containing any request options:<br />
**'''queueName:''' Name of the queue to use. Any name can be used. If not set, the queue name is "default". Requests in the same queue are processed in order, one at a time.<br />
**'''connectionAttempts:''' Number of times to retry if the remote host does not respond. ''(Defaults to 10)''<br />
**'''connectTimeout:''' Number of milliseconds each connection attempt will take before timing out. ''(Defaults to 10000)''<br />
**'''postData:''' A string specifying any data you want to send to the remote HTTP server.<br />
**'''postIsBinary :''' A boolean specifying if the data is text, or binary. ''(Defaults to false)''<br />
**'''method:''' A string specifying the request method. ''(Defaults to GET or POST)''<br />
**'''headers:''' A table containing HTTP request headers. ''e.g.{ Pragma&#61;"no-cache" }''<br />
**'''maxRedirects:''' An integer limiting the number of HTTP redirections to automatically follow. ''(Defaults to 8)''<br />
**'''username:''' A string specifying the username for protected pages.<br />
**'''password:''' A string specifying the password for protected pages.<br />
{{New items|5.0154|1.5.4-9.11413|<br />
**'''formFields:''' A table containing form items to submit. (for POST method only) ''e.g.{ name&#61;"bob", email&#61;"bob@example.com" }''<br />
}}<br />
*'''arguments:''' A table containing arguments you may want to pass to the callback.<br />
}}<br />
<br />
===Returns===<br />
{{New items|5.0154|1.5.7-9.20307|<br />
Returns a '''''request''''' value which can be used with [[GetRemoteRequestInfo|getRemoteRequestInfo]] or [[AbortRemoteRequest|abortRemoteRequest]]<br />
}}<br />
<br />
==Example==<br />
This example shows you how you can fetch an image from a web page, and transfer it to a particular client:<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
<br />
function startImageDownload( playerToReceive )<br />
fetchRemote ( "http://www.example.com/image.jpg", myCallback, "", false, playerToReceive )<br />
end<br />
<br />
function myCallback( responseData, errno, playerToReceive )<br />
if errno == 0 then<br />
triggerClientEvent( playerToReceive, "onClientGotImage", resourceRoot, responseData )<br />
end<br />
end<br />
</syntaxhighlight><br />
</section><br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEvent( "onClientGotImage", true )<br />
addEventHandler( "onClientGotImage", resourceRoot,<br />
function( pixels )<br />
if myTexture then<br />
destroyElement( myTexture )<br />
end<br />
myTexture = dxCreateTexture( pixels )<br />
end<br />
)<br />
<br />
addEventHandler("onClientRender", root,<br />
function()<br />
if myTexture then<br />
local w,h = dxGetMaterialSize( myTexture )<br />
dxDrawImage( 200, 100, w, h, myTexture )<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
</section><br />
<br/><br />
{{New items|5.0154|1.5.4-9.11413|<br />
Example sending email via a web service (adopted from examples on https://documentation.mailgun.com/user_manual.html)<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
sendOptions = {<br />
queueName = "My Mailgun queue",<br />
connectionAttempts = 3,<br />
connectTimeout = 5000,<br />
formFields = {<br />
from="Excited User <excited@samples.mailgun.org>",<br />
to="devs@mailgun.net",<br />
subject="Hello",<br />
text="Testing some Mailgun awesomness!",<br />
},<br />
username="api",<br />
password="key-3ax6xnjp29jd6fds4gc373sgvjxteol0",<br />
}<br />
fetchRemote( "https://api.mailgun.net/v3/samples.mailgun.org/messages", sendOptions, mailgunCompleteCallback )<br />
<br />
function mailgunCompleteCallback(data, info)<br />
outputDebugString( "mailgunComplete"<br />
.. " success:" .. tostring(info.success)<br />
.. " statusCode:" .. tostring(info.statusCode)<br />
.. " data:" .. tostring(data)<br />
)<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
Changing post content on IPS forum.<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
local apiKey = "12345678123456781234567812345678" -- key from ips admin panel<br />
local forumAddress = "https://yourForum.com"<br />
function setPostContent(postID,content)<br />
local sendOptions = {<br />
queueName = "updatePost",<br />
connectionAttempts = 1,<br />
connectTimeout = 50,<br />
formFields = {<br />
post = content,<br />
},<br />
}<br />
fetchRemote( forumAddress.."/api/forums/posts/"..postID.."?key="..apiKey, sendOptions, function()end)<br />
end<br />
<br />
setPostContent(1, "this is a first post on this forum")<br />
</syntaxhighlight><br />
</section><br />
}}<br />
<br />
==Requirements==<br />
{{Requirements|1.3.0-9.03739|1.3.2|}}<br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.3.1-9.04605|Added connectionAttempts argument}}<br />
{{ChangelogItem|1.3.2|Added client side}}<br />
{{ChangelogItem|1.5.3-9.11270|Added queueName argument}}<br />
{{ChangelogItem|1.5.4-9.11342|Added alternative syntax}}<br />
{{ChangelogItem|1.5.4-9.11413|Added formFields}}<br />
<br />
==See Also==<br />
{{Resource_functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=DecodeString&diff=64935DecodeString2020-01-26T16:44:39Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__<br />
{{Shared function}}<br />
{{New feature/item|3.0156|1.5.5|11849|<br />
This function decodes an encoded [[string]] using the specified algorithm. The counterpart of this function is [[encodeString]].<br />
}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
string decodeString ( string algorithm, string input, table options [, function callback ] ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''algorithm:''' The algorithm to use.<br />
*'''input:''' The input to decode.<br />
*'''options:''' A [[table]] with options and other neccessary data for the algorithm, as detailed below.<br />
<br />
===Options for each algorithm===<br />
* ''tea'' ([https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm Tiny Encryption Algorithm])<br />
** ''key'': A key to decode the input with.<br />
<br />
===Optional Arguments===<br />
{{New feature/item|3.0160|1.5.7|20394|<br />
*'''callback:''' providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.<br />
}}<br />
===Returns===<br />
Returns the decoded string if successful, ''false'' otherwise. If a callback was provided, the decoded string is argument to the callback.<br />
<br />
==Example== <br />
Adds an ''/decode'' command in which you can provide an algorithm, key and data to decode.<br />
<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("decode", <br />
function(player, _, algorithm, key, ...)<br />
if algorithm and key then<br />
local text = table.concat({...}, " ")<br />
if type(text) == "string" and text ~= "" then<br />
local decoded = decodeString(algorithm, text, { key = key })<br />
if decoded then<br />
outputChatBox("The result of " .. algorithm .. " decoding is: " .. decoded, player)<br />
else<br />
outputChatBox("Failed to decode. Make sure that all arguments are valid.", player, 255, 0, 0)<br />
end<br />
else<br />
outputChatBox("Please specify text in the command.", player, 255, 0, 0)<br />
end<br />
else<br />
outputChatBox("Invalid algorithm and/or key.", player, 255, 0, 0)<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Utility functions}}</div>Patrick2562https://wiki.multitheftauto.com/index.php?title=DecodeString&diff=64934DecodeString2020-01-26T16:44:08Z<p>Patrick2562: /* Example */</p>
<hr />
<div>__NOTOC__<br />
{{Shared function}}<br />
{{New feature/item|3.0156|1.5.5|11849|<br />
This function decodes an encoded [[string]] using the specified algorithm. The counterpart of this function is [[encodeString]].<br />
}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
string decodeString ( string algorithm, string input, table options [, function callback ] ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''algorithm:''' The algorithm to use.<br />
*'''input:''' The input to decode.<br />
*'''options:''' A [[table]] with options and other neccessary data for the algorithm, as detailed below.<br />
<br />
===Options for each algorithm===<br />
* ''tea'' ([https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm Tiny Encryption Algorithm])<br />
** ''key'': A key to decode the input with.<br />
<br />
===Optional Arguments===<br />
{{New feature/item|3.0160|1.5.7|20394|<br />
*'''callback:''' providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.<br />
}}<br />
===Returns===<br />
Returns the decoded string if successful, ''false'' otherwise. If a callback was provided, the decoded string is argument to the callback.<br />
<br />
==Example== <br />
Adds an ''/decode'' command in which you can provide an algorithm, key and data to decode.<br />
<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("decode", <br />
function(player, _, algorithm, key, ...)<br />
if algorithm and key then<br />
local text = table.concat({...}, " ")<br />
if type(text) == "string" and text ~= "" then<br />
local decoded = decodeString(algorithm, text, { key = key })<br />
if decoded then<br />
outputChatBox("The result of " .. algorithm .. " decoding is: " .. decoded, player)<br />
else<br />
outputChatBox("Failed to decode. Make sure that all arguments are valid.", player, 255, 0, 0)<br />
end<br />
else<br />
outputChatBox("Please specify text in the command.", player, 255, 0, 0)<br />
end<br />
else<br />
outputChatBox("Invalid algorithm and/or key.", player, 255, 0, 0)<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Utility functions}}</div>Patrick2562