https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=UniOnDennis&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-28T14:25:59ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=GuiGridListSetHorizontalScrollPosition&diff=36668GuiGridListSetHorizontalScrollPosition2013-07-14T16:51:23Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
This function is used to set the horizontal scroll position from a grid list<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool guiGridListSetHorizontalScrollPosition( element guiGridlist, float fPosition )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''guiGridlist''': The grid list you want to set the horizontal scroll position from<br />
*'''fPosition''': A float representing the horizontal scroll position<br />
<br />
===Returns===<br />
Returns ''true'' if the horizontal scroll position was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.2}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GuiGridListGetHorizontalScrollPosition&diff=36667GuiGridListGetHorizontalScrollPosition2013-07-14T16:51:09Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
This function is used to get the horizontal scroll position from a grid list<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float guiGridListGetHorizontalScrollPosition( element guiGridlist )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''guiGridlist''': The grid list you want to get the horizontal scroll position from<br />
<br />
===Returns===<br />
Returns a float indicating the horizontal scroll position, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.2}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GuiGridListGetVerticalScrollPosition&diff=36666GuiGridListGetVerticalScrollPosition2013-07-14T16:50:57Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
This function is used to get the vertical scroll position from a grid list<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float guiGridListGetVerticalScrollPosition( element guiGridlist )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''guiGridlist''': The grid list you want to get the vertical scroll position from<br />
<br />
===Returns===<br />
Returns a float indicating the vertical scroll position, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.2}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GuiGridListSetVerticalScrollPosition&diff=36665GuiGridListSetVerticalScrollPosition2013-07-14T16:50:44Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
This function is used to set the vertical scroll position from a grid list<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool guiGridListSetVerticalScrollPosition( element guiGridlist, float fPosition )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''guiGridlist''': The grid list you want to set the vertical scroll position from<br />
*'''fPosition''': A float representing the vertical scroll position<br />
<br />
===Returns===<br />
Returns ''true'' if the vertical scroll position was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.2}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetCursorAlpha&diff=36664SetCursorAlpha2013-07-14T16:49:30Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
This function is used to change alpha (transparency) from the client's cursor.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setCursorAlpha( float alpha )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''alpha ''': The alpha value to set. Value can be 0-255, where 255 is fully opaque and 0 is fully transparent.<br />
<br />
===Returns===<br />
Returns ''true'' if the new alpha value was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.2}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the setCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
-- Show the cursor if it is not showing or hide the cursor if it is<br />
showCursor( not isCursorShowing ( ) )<br />
-- Set the alpha to 100<br />
setCursorAlpha(100)<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetCursorAlpha&diff=36663GetCursorAlpha2013-07-14T16:49:18Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
This function is used to get alpha (transparency) from the client's cursor.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int getCursorAlpha( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a int, 0-255, where 255 is fully opaque and 0 is fully transparent.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.2}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the getCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
if ( isCursorShowing ( ) ) then<br />
outputChatBox( "The cursor alpha: "..getCursorAlpha( ) )<br />
else<br />
outputChatBox( "The cursor is not showing!" )<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=OnClientKey&diff=36662OnClientKey2013-07-14T16:44:44Z<p>UniOnDennis: </p>
<hr />
<div>{{Client event}}<br />
__NOTOC__ <br />
This event triggers whenever the user presses a button on their keyboard.<br />
This event can also be used to see if the client scrolls his mousewheel.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua">string button, bool pressOrRelease<br />
</syntaxhighlight><br />
* '''button''': This refers the button pressed.<br />
* '''pressOrRelease''': This refers to whether they were pressing or releasing the key, true when pressing, false when releasing.<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the client's [[root element]].<br />
<br />
==Cancel effect==<br />
{{New items|5620|1.4|<br />
If this event is [[Event system#Canceling|canceled]], then all GTA and MTA binds, bound to the canceled key, won't be triggerd.<br />
}}<br />
<br />
==Example== <br />
This example will say in chatbox every time the user presses down a a key.<br />
<syntaxhighlight lang="lua"><br />
function playerPressedKey(button, press)<br />
if (press) then -- Only output when they press it down<br />
outputChatBox("You pressed the "..button.." key!")<br />
end<br />
end<br />
addEventHandler("onClientKey", root, playerPressedKey)<br />
</syntaxhighlight><br />
<br />
This example outputs if the client moves his mousewheel.<br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "onClientKey", root, function(button,press) <br />
-- Since mouse_wheel_up and mouse_wheel_down cant return a release, we dont have to check the press.<br />
if button == "mouse_wheel_up" or button == "mouse_wheel_down" then<br />
outputDebugString( button .. " moved." )<br />
return true<br />
end<br />
return false<br />
end )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
===GUI events===<br />
{{GUI_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=OnClientRender&diff=36482OnClientRender2013-06-29T21:52:09Z<p>UniOnDennis: </p>
<hr />
<div>__NOTOC__<br />
{{Client event}} <br />
This event is triggered every time GTA renders a new frame. It is required for the DirectX drawing functions, and also useful for other clientside operations that have to be applied repeatedly with very short time differences between them.<br />
<br />
==Parameters==<br />
''None''<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the client's [[root element]].<br />
<br />
==Example==<br />
This example makes the camera follow the player in a GTA2-like way. This will be a little bit laggy. If you want the camera to follow something (eg. player or vehicle) then use [[onClientPreRender]] instead.<br />
<syntaxhighlight lang="lua"><br />
function updateCamera ()<br />
local x, y, z = getElementPosition ( localPlayer )<br />
setCameraMatrix ( x, y, z + 50, x, y, z )<br />
end<br />
addEventHandler ( "onClientRender", root, updateCamera )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
===[[Game_Processing_Order|Game Processing Order]]===<br />
===Other client events===<br />
{{Client_other_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=OnClientRender&diff=36481OnClientRender2013-06-29T21:51:36Z<p>UniOnDennis: </p>
<hr />
<div>__NOTOC__<br />
{{Client event}} <br />
This event is triggered every time GTA renders a new frame. It is required for the DirectX drawing functions, and also useful for other clientside operations that have to be applied repeatedly with very short time differences between them.<br />
<br />
==Parameters==<br />
''None''<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the client's [[root element]].<br />
<br />
==Example==<br />
This example makes the camera follow the player in a GTA2-like way. This will be a little bit laggy. If you want the camera to follow something (eg. player or vehicle) then use [[onClientPreRender]] instead.<br />
<syntaxhighlight lang="lua"><br />
function updateCamera ()<br />
local x, y, z = getElementPosition ( getLocalPlayer () )<br />
setCameraMatrix ( x, y, z + 50, x, y, z )<br />
end<br />
addEventHandler ( "onClientRender", root, updateCamera )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
===[[Game_Processing_Order|Game Processing Order]]===<br />
===Other client events===<br />
{{Client_other_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=User:UniOnDennis&diff=35997User:UniOnDennis2013-05-13T20:20:29Z<p>UniOnDennis: </p>
<hr />
<div>Founder, ex-leader and ex-developer from CSG (Community of Social Gaming)<br />
<br />
Former co-owner and developer from SAUR (SAUR Utopia RPG)<br />
<br />
<br />
<br />
==Wiki changes by me==<br />
'''13th May 2013''' Documented: [[setVehiclePlateText]]<br />
<br />
'''17th April 2013''' Added usefull function: [[mathNumber]]<br />
<br />
'''14th April 2013''' Documented: [[setCursorAlpha]], [[getCursorAlpha]]<br />
<br />
'''18th February 2013''' Documented: [[isPlayerHudComponentVisible]]<br />
<br />
'''30th January 2013''' Documented: [[GuiGridListGetColumnTitle]], [[GuiGridListSetColumnTitle]], [[GuiGridListGetHorizontalScrollPosition]], [[GuiGridListGetVerticalScrollPosition]], [[GuiGridListSetHorizontalScrollPosition]], [[GuiGridListSetVerticalScrollPosition]], [[ToggleObjectRespawn]], [[SetPlayerHudComponentVisible]], [[GetPedCameraRotation]], [[OnWeaponFire]]<br />
<br />
'''21th December 2012''' Documented: [[Sha256]]</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=Template:Vehicle_functions&diff=35996Template:Vehicle functions2013-05-13T20:19:17Z<p>UniOnDennis: </p>
<hr />
<div>*[[addVehicleUpgrade]]<br />
*[[attachTrailerToVehicle]]<br />
*[[blowVehicle]]<br />
*[[createVehicle]]<br />
*[[detachTrailerFromVehicle]]<br />
*[[fixVehicle]]<br />
*[[getVehicleColor]]<br />
*[[getVehicleCompatibleUpgrades]]<br />
*[[getVehicleController]]<br />
*[[getVehicleDoorState]]<br />
*[[getVehicleEngineState]]<br />
*[[getVehicleLandingGearDown]]<br />
*[[getVehicleLightState]]<br />
*[[getVehicleMaxPassengers]]<br />
*[[getVehicleName]]<br />
*[[getVehicleOccupant]]<br />
*[[getVehicleOccupants]]<br />
*[[getVehicleOverrideLights]]<br />
*[[getVehiclePaintjob]]<br />
*[[getVehiclePanelState]]<br />
*[[getVehicleSirensOn]]<br />
*[[getVehiclesOfType]]<br />
*[[getVehicleTowedByVehicle]]<br />
*[[getVehicleTowingVehicle]]<br />
*[[getVehicleTurnVelocity]]<br />
*[[getVehicleTurretPosition]]<br />
*[[getVehicleType]]<br />
*[[getVehicleUpgradeOnSlot]]<br />
*[[getVehicleUpgrades]]<br />
*[[getVehicleUpgradeSlotName]]<br />
*[[getVehicleWheelStates]]<br />
*[[getVehicleDoorOpenRatio]]<br />
*[[getVehicleHandling]]<br />
*[[getModelHandling]]<br />
*[[getOriginalHandling]]<br />
*[[isVehicleDamageProof]]<br />
*[[isVehicleFuelTankExplodable]]<br />
*[[isVehicleLocked]]<br />
*[[isVehicleOnGround]]<br />
*[[removeVehicleUpgrade]]<br />
*[[resetVehicleExplosionTime]]<br />
*[[resetVehicleIdleTime]]<br />
*[[respawnVehicle]]<br />
*[[setVehicleColor]]<br />
*[[setVehicleDamageProof]]<br />
*[[setVehicleDoorState]]<br />
*[[setVehicleDoorsUndamageable]]<br />
*[[setVehicleEngineState]]<br />
*[[setVehicleFuelTankExplodable]]<br />
*[[setVehicleIdleRespawnDelay]]<br />
*[[setVehicleLandingGearDown]]<br />
*[[setVehicleLightState]]<br />
*[[setVehicleLocked]]<br />
*[[setVehicleOverrideLights]]<br />
*[[setVehiclePaintjob]]<br />
*[[setVehiclePanelState]]<br />
*[[setVehicleRespawnDelay]]<br />
*[[setVehicleRespawnPosition]]<br />
*[[setVehicleSirensOn]]<br />
*[[setVehicleTurretPosition]]<br />
*[[setVehicleDoorOpenRatio]]<br />
*[[setVehicleHandling]]<br />
*[[setModelHandling]]<br />
*[[setVehicleTurnVelocity]]<br />
*[[setVehicleWheelStates]]<br />
*[[spawnVehicle]]<br />
*[[toggleVehicleRespawn]]<br />
*[[getTrainDirection]]<br />
*[[getTrainSpeed]]<br />
*[[getVehicleHeadLightColor]]<br />
*[[getVehicleModelFromName]]<br />
*[[getVehicleNameFromModel]]<br />
*[[isTrainDerailable]]<br />
*[[isTrainDerailed]]<br />
*[[isVehicleBlown]]<br />
*[[isVehicleTaxiLightOn]]<br />
*[[setTrainDerailable]]<br />
*[[setTrainDerailed]]<br />
*[[setTrainDirection]]<br />
*[[setTrainSpeed]]<br />
*[[setVehicleHeadLightColor]]<br />
*[[setVehicleTaxiLightOn]]<br />
*[[getVehicleVariant]]<br />
*[[setVehicleVariant]]<br />
{{New feature/item|3.0132|1.3.1|3968|<br />
*[[getVehicleSirenParams]]<br />
*[[removeVehicleSirens]]<br />
*[[getVehicleSirens]]<br />
*[[addVehicleSirens]]<br />
*[[setVehicleSirens]]<br />
{{New feature/item|4.0132|1.3.3|5394|<br />
*[[setVehiclePlateText]]<br />
}}<br />
}}<br />
<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetVehiclePlateText&diff=35995SetVehiclePlateText2013-05-13T20:17:51Z<p>UniOnDennis: Created page with "{{Server client function}} __NOTOC__ {{New feature/item|3.0140|1.3.3|5394| This function can be used to change/set the numberplate text from a car. }} ==Syntax== <syntaxhighlight lang="lua"> f..."</p>
<hr />
<div>{{Server client function}}<br />
__NOTOC__<br />
{{New feature/item|3.0140|1.3.3|5394|<br />
This function can be used to change/set the numberplate text from a car.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float setVehiclePlateText( element theVehicle, string numberplate )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''theVehicle:''' The [[vehicle]] whose numberplate you want to change.<br />
*'''numberplate:''' A string that will go on the number plate of the car (max 8 characters).<br />
<br />
===Returns===<br />
Returns ''true'' if the numberplate was changed successfully, or ''false'' if invalid arguments were passed<br />
<br />
==Requirements==<br />
{{Requirements|1.3.3|1.3.3|}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo<br />
</syntaxhighlight><br />
==See Also==<br />
{{Vehicle_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=User:UniOnDennis&diff=35994User:UniOnDennis2013-05-13T20:07:54Z<p>UniOnDennis: </p>
<hr />
<div>Founder, ex-leader and ex-developer from CSG (Community of Social Gaming)<br />
<br />
Former co-owner and developer from SAUR (SAUR Utopia RPG)<br />
<br />
<br />
<br />
==Wiki changes by me==<br />
'''17th April 2013''' Added usefull function: [[mathNumber]]<br />
<br />
'''14th April 2013''' Documented: [[setCursorAlpha]], [[getCursorAlpha]]<br />
<br />
'''18th February 2013''' Documented: [[isPlayerHudComponentVisible]]<br />
<br />
'''30th January 2013''' Documented: [[GuiGridListGetColumnTitle]], [[GuiGridListSetColumnTitle]], [[GuiGridListGetHorizontalScrollPosition]], [[GuiGridListGetVerticalScrollPosition]], [[GuiGridListSetHorizontalScrollPosition]], [[GuiGridListSetVerticalScrollPosition]], [[ToggleObjectRespawn]], [[SetPlayerHudComponentVisible]], [[GetPedCameraRotation]], [[OnWeaponFire]]<br />
<br />
'''21th December 2012''' Documented: [[Sha256]]</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=Talk:IsThePedDead&diff=35993Talk:IsThePedDead2013-05-13T20:07:18Z<p>UniOnDennis: Forgot to use the '~~~~' in the talk</p>
<hr />
<div>Doubt this would work. Health is a floating point variable and thus comparing it to 0 may not always work as it might return 0.000001<br />
<br />
--[[User:Arran Fortuna|Arran Fortuna]] 16:53, 13 May 2013 (UTC)<br />
<br />
Using math.floor should fix this I guess, players die when their health becomes (under) 0.<br />
<br />
--[[User:UniOnDennis|UniOnDennis]] 20:03, 13 May 2013 (UTC)</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=Talk:IsThePedDead&diff=35992Talk:IsThePedDead2013-05-13T20:03:48Z<p>UniOnDennis: </p>
<hr />
<div>Doubt this would work. Health is a floating point variable and thus comparing it to 0 may not always work as it might return 0.000001<br />
<br />
--[[User:Arran Fortuna|Arran Fortuna]] 16:53, 13 May 2013 (UTC)<br />
<br />
Using math.floor should fix this I guess, players die when their health becomes (under) 0.<br />
<br />
--[[User:UniOnDennis|UniOnDennis]] 22:03, 13 May 2013 (UTC)</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=Talk:IsThePedDead&diff=35991Talk:IsThePedDead2013-05-13T20:03:10Z<p>UniOnDennis: </p>
<hr />
<div>Doubt this would work. Health is a floating point variable and thus comparing it to 0 may not always work as it might return 0.000001<br />
<br />
--[[User:Arran Fortuna|Arran Fortuna]] 16:53, 13 May 2013 (UTC)<br />
<br />
Using math.floor should fix this I guess, players die when their health becomes (under) 0.</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetCursorAlpha&diff=35684SetCursorAlpha2013-05-02T15:00:41Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0140|1.3.2|5340|<br />
This function is used to change alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setCursorAlpha( float alpha )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''alpha ''': The alpha value to set. Value can be 0-255, where 255 is fully opaque and 0 is fully transparent.<br />
<br />
===Returns===<br />
Returns ''true'' if the new alpha value was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.2}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the setCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
-- Show the cursor if it is not showing or hide the cursor if it is<br />
showCursor( not isCursorShowing ( ) )<br />
-- Set the alpha to 100<br />
setCursorAlpha(100)<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetObjectMass&diff=35678GetObjectMass2013-05-02T00:02:47Z<p>UniOnDennis: </p>
<hr />
<div>{{Needs_Example}}<br />
__NOTOC__<br />
{{client_function}}<br />
{{New feature/item|3.0140|1.3.2|5170|<br />
This function returns the mass of a specified object.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float getObjectMass ( object theObject )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''theObject:''' The object whose mass you want to get.<br />
<br />
===Returns===<br />
Returns a [[float]] representing the mass of the object, ''false'' if invalid arguments were passed.<br />
<br />
==Example==<br />
<br />
==See Also==<br />
{{Client_object_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetObjectMass&diff=35677SetObjectMass2013-05-02T00:02:39Z<p>UniOnDennis: </p>
<hr />
<div>{{Needs_Example}}<br />
__NOTOC__<br />
{{client_function}}<br />
{{New feature/item|3.0140|1.3.2|5170|<br />
This function sets the mass of a specified object. Changing the mass leads to a different movement behavior for especially dynamic objects.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setObjectMass ( object theObject, float mass )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''theObject:''' The object whose mass will be set.<br />
*'''mass:''' The new mass.<br />
<br />
===Returns===<br />
Returns ''true'' if the new mass value has been set, ''false'' otherwise.<br />
<br />
==Example==<br />
<br />
==See Also==<br />
{{Client_object_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=FetchRemote&diff=35676FetchRemote2013-05-02T00:01:34Z<p>UniOnDennis: </p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
{{New feature/item|3.0140|1.3.2|5304|<br />
From version 1.3.2 onwards this functions can be used clientside too!<br />
<br />
However this only works with the server the player is connected with.<br />
}}<br />
<br />
<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 />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool fetchRemote ( string URL[, int connectionAttempts = 10 ], callback 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 />
*'''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 />
{{New_feature|3.0139|1.3.1|<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 6 seconds. Therefore, the default setting of 10 connection attempts means it will be 60 seconds before your script gets a callback about the error. Reducing this value to 2 for example, will decrease that period to 12 seconds''<br />
}}<br />
<br />
===Returns===<br />
Returns ''true'' if the arguments are correct, ''false'' otherwise.<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 />
<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 />
==Requirements==<br />
{{Requirements|1.3.0-9.03739|n/a|}}<br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.3.1-9.04605|Added connectionAttempts argument}}<br />
<br />
==See Also==<br />
{{Resource_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetCursorAlpha&diff=35675SetCursorAlpha2013-05-02T00:01:08Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0140|1.3.2|5340|<br />
This function is used to change alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setCursorAlpha( float alpha )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''alpha ''': The alpha value to set. Value can be 0-255, where 255 is fully opaque and 0 is fully transparent.<br />
<br />
===Returns===<br />
Returns ''true'' if the new alpha value was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.2}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the setCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
-- Show the cursor if it is not showing or hide the cursor if it is<br />
showCursor( not isCursorShowing ( ) )<br />
-- Set the alpha to 100<br />
setCursorAlpha( 100 )<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetCursorAlpha&diff=35674GetCursorAlpha2013-05-02T00:00:41Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0140|1.3.2|5340|<br />
This function is used to get alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int getCursorAlpha( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a int, 0-255, where 255 is fully opaque and 0 is fully transparent.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.2}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the getCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
if ( isCursorShowing ( ) ) then<br />
outputChatBox( "The cursor alpha: "..getCursorAlpha( ) )<br />
else<br />
outputChatBox( "The cursor is not showing!" )<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetCursorAlpha&diff=35673SetCursorAlpha2013-05-01T23:58:47Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0140|1.3.2|5340|<br />
This function is used to change alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setCursorAlpha( float alpha )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''alpha ''': The alpha value to set. Value can be 0-255, where 255 is fully opaque and 0 is fully transparent.<br />
<br />
===Returns===<br />
Returns ''true'' if the new alpha value was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the setCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
-- Show the cursor if it is not showing or hide the cursor if it is<br />
showCursor( not isCursorShowing ( ) )<br />
-- Set the alpha to 100<br />
setCursorAlpha( 100 )<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=FetchRemote&diff=35563FetchRemote2013-04-25T18:05:51Z<p>UniOnDennis: </p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
{{New feature/item|3.0140|1.4|5304|<br />
From version 1.4 onwards this functions can be used clientside too!<br />
<br />
However this only works with the server the player is connected with.<br />
}}<br />
<br />
<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 />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool fetchRemote ( string URL[, int connectionAttempts = 10 ], callback 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 error codes can be found on the [http://curl.haxx.se/libcurl/c/libcurl-errors.html cURL website].<br />
**'''''arguments...''''' - The arguments that were passed into fetchRemote<br />
<br />
===Optional Arguments=== <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 />
{{New_feature|3.0139|1.3.1|<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 6 seconds. Therefore, the default setting of 10 connection attempts means it will be 60 seconds before your script gets a callback about the error. Reducing this value to 2 for example, will decrease that period to 12 seconds''<br />
}}<br />
<br />
===Returns===<br />
Returns ''true'' if the arguments are correct, ''false'' otherwise.<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 />
<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 />
==Requirements==<br />
{{Requirements|1.3.0-9.03739|n/a|}}<br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.3.1-9.04605|Added connectionAttempts argument}}<br />
<br />
==See Also==<br />
{{Resource_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetFPSLimit&diff=35470SetFPSLimit2013-04-18T14:50:50Z<p>UniOnDennis: </p>
<hr />
<div>{{Server client function}}<br />
__NOTOC__<br />
{{New feature/item|3.0132|1.4|r5264|<br />
<b>The clientside version of this function does only work from version 1.4 onwards</b><br />
}}<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 />
<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 disabled.<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 />
==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}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=MathNumber&diff=35458MathNumber2013-04-17T18:23:47Z<p>UniOnDennis: </p>
<hr />
<div>{{Useful Function}}<br />
__NOTOC__<br />
This function can be used to take or add a number from a lage number.<br />
<br />
MTA clients do only support 24-bits numbers, therefore you can't take or add a single digit from large numbers like '1364576384'.<br />
<br />
This function is only needed clientside since the server runs with a floating-point precision of 56-bits, however this works also serverside.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">number mathNumber ( int num, int integer, string type )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''num''': The number you want to edit<br />
* '''integer''': The amount you want to add or take from the number<br />
* '''type ''': Can be either '-' or '+'<br />
<br />
===Returns===<br />
Returns a number if everything went good, ''false'' otherwise.<br />
<br />
==Code==<br />
<syntaxhighlight lang="lua"><br />
-- Function that takes a digit from a larger number<br />
function mathNumber ( num, integer, type )<br />
if not ( num ) or not ( integer ) then return false end<br />
<br />
local function formatNumber( numb )<br />
if not ( numb ) then return false end<br />
local fn = string.sub( tostring( numb ), ( #tostring( numb ) -6 ) )<br />
return tonumber( fn )<br />
end<br />
<br />
if not ( type ) or ( type == "+" ) then<br />
local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) + integer<br />
return tonumber( fn )<br />
else<br />
local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) - integer<br />
return tonumber( fn )<br />
end<br />
end<br />
</syntaxhighlight><br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
mathNumber ( 1364576384, 1, '-' )<br />
-- Returns: 1364576383<br />
<br />
1364576384 - 1<br />
-- Returns: 1364576384<br />
<br />
mathNumber ( 1364576384, 1, '+' )<br />
-- Returns: 1364576385<br />
<br />
1364576384 + 1<br />
-- Returns: 1364576384<br />
</syntaxhighlight><br />
<br />
<br />
Author: DennisUniOn<br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=MathNumber&diff=35457MathNumber2013-04-17T18:18:38Z<p>UniOnDennis: </p>
<hr />
<div>{{Useful Function}}<br />
__NOTOC__<br />
This function can be used to take or add a number from a lage number.<br />
<br />
MTA clients do only support 24-bits numbers, therefore you can't take or add a single digit from large numbers like '1364576384'.<br />
<br />
This function is only needed clientside since the server runs with a floating-point precision of 56-bits, however this works also serverside.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">number mathNumber ( int num, int integer, string type )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''num''': The number you want to edit<br />
* '''integer''': The amount you want to add or take from the number<br />
* '''type ''': Can be either '-' or '+'<br />
<br />
==Code==<br />
<syntaxhighlight lang="lua"><br />
-- Function that takes a digit from a larger number<br />
function mathNumber ( num, integer, type )<br />
if not ( num ) or not ( integer ) then return end<br />
<br />
local function formatNumber( numb )<br />
if not ( numb ) then return end<br />
local fn = string.sub( tostring( numb ), ( #tostring( numb ) -6 ) )<br />
return tonumber( fn )<br />
end<br />
<br />
if not ( type ) or ( type == "+" ) then<br />
local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) + integer<br />
return tonumber( fn )<br />
else<br />
local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) - integer<br />
return tonumber( fn )<br />
end<br />
end<br />
</syntaxhighlight><br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
mathNumber ( 1364576384, 1, '-' )<br />
-- Returns: 1364576383<br />
<br />
1364576384 - 1<br />
-- Returns: 1364576384<br />
<br />
mathNumber ( 1364576384, 1, '+' )<br />
-- Returns: 1364576385<br />
<br />
1364576384 + 1<br />
-- Returns: 1364576384<br />
</syntaxhighlight><br />
<br />
<br />
Author: DennisUniOn<br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetPlayerCount&diff=35456GetPlayerCount2013-04-17T18:16:00Z<p>UniOnDennis: /* Clientside Example */</p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function returns the number of players currently connected to the server.<br />
{{Note|#getElementsByType("player") works the same as this function but also works client side unlike this function.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int getPlayerCount ( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns the number of players connected to the server as an [[int]].<br />
<br />
==Example==<br />
This example displays a chat message with the number of players connected to the server when a player joins or quits.<br />
<syntaxhighlight lang="lua"><br />
function playerCount ( )<br />
outputChatBox ( "There are now " .. getPlayerCount() .. " players on this server!" )<br />
end<br />
addEventHandler ( "onPlayerJoin", getRootElement(), playerCount )<br />
addEventHandler ( "onPlayerQuit", getRootElement(), playerCount )<br />
</syntaxhighlight><br />
<br />
==Clientside Example (Doesn't user getPlayerCount!)==<br />
This example uses the getElementsByType function to display the player count, same result but also works clientside!<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "playercount",<br />
function ()<br />
outputChatBox ( "There are now " .. #getElementsByType( "player" ) .. " players on this server!" )<br />
end<br />
)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Player functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetPlayerCount&diff=35455GetPlayerCount2013-04-17T18:15:35Z<p>UniOnDennis: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function returns the number of players currently connected to the server.<br />
{{Note|#getElementsByType("player") works the same as this function but also works client side unlike this function.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int getPlayerCount ( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns the number of players connected to the server as an [[int]].<br />
<br />
==Example==<br />
This example displays a chat message with the number of players connected to the server when a player joins or quits.<br />
<syntaxhighlight lang="lua"><br />
function playerCount ( )<br />
outputChatBox ( "There are now " .. getPlayerCount() .. " players on this server!" )<br />
end<br />
addEventHandler ( "onPlayerJoin", getRootElement(), playerCount )<br />
addEventHandler ( "onPlayerQuit", getRootElement(), playerCount )<br />
</syntaxhighlight><br />
<br />
==Clientside Example==<br />
This example uses the getElementsByType function to display the player count, same result but also works clientside!<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "playercount",<br />
function ()<br />
outputChatBox ( "There are now " .. #getElementsByType( "player" ) .. " players on this server!" )<br />
end<br />
)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Player functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetFPSLimit&diff=35454SetFPSLimit2013-04-17T17:34:37Z<p>UniOnDennis: </p>
<hr />
<div>{{Server client function}}<br />
__NOTOC__<br />
{{New feature/item|3.0132|1.4|r5264|<br />
<b>The clientside version of this function does only work from version 1.4 onwards</b><br />
}}<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 />
<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 disabled.<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 />
==Example== <br />
This command sets the fps limit in a command handler.<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 />
<br />
==See Also==<br />
{{Server functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=User:UniOnDennis&diff=35453User:UniOnDennis2013-04-17T17:25:45Z<p>UniOnDennis: </p>
<hr />
<div>Founder, ex-leader and ex-developer from CSG (Community of Social Gaming)<br />
<br />
Former co-owner and developer from SAUR (SAUR Utopia RPG)<br />
<br />
Currently working as leader and developer on NEG (Network of Entertainment and Gaming)<br />
<br />
<br />
<br />
==Wiki changes by me==<br />
'''17th April 2013''' Added usefull function: [[mathNumber]]<br />
<br />
'''14th April 2013''' Documented: [[setCursorAlpha]], [[getCursorAlpha]]<br />
<br />
'''18th February 2013''' Documented: [[isPlayerHudComponentVisible]]<br />
<br />
'''30th January 2013''' Documented: [[GuiGridListGetColumnTitle]], [[GuiGridListSetColumnTitle]], [[GuiGridListGetHorizontalScrollPosition]], [[GuiGridListGetVerticalScrollPosition]], [[GuiGridListSetHorizontalScrollPosition]], [[GuiGridListSetVerticalScrollPosition]], [[ToggleObjectRespawn]], [[SetPlayerHudComponentVisible]], [[GetPedCameraRotation]], [[OnWeaponFire]]<br />
<br />
'''21th December 2012''' Documented: [[Sha256]]</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=MathNumber&diff=35452MathNumber2013-04-17T17:24:55Z<p>UniOnDennis: </p>
<hr />
<div>{{Useful Function}}<br />
__NOTOC__<br />
This function can be used to take or add a number from a lage number.<br />
<br />
MTA clients do only support 24-bits numbers, therefore you can't take or add a single digit from large numbers like '1364576384'.<br />
<br />
This function is only needed clientside since the server runs with a floating-point precision of 56-bits<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">number mathNumber ( int num, int integer, string type )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''num''': The number you want to edit<br />
* '''integer''': The amount you want to add or take from the number<br />
* '''type ''': Can be either '-' or '+'<br />
<br />
==Code==<br />
<syntaxhighlight lang="lua"><br />
-- Function that takes a digit from a larger number<br />
function mathNumber ( num, integer, type )<br />
if not ( num ) or not ( integer ) then return end<br />
<br />
local function formatNumber( numb )<br />
if not ( numb ) then return end<br />
local fn = string.sub( tostring( numb ), ( #tostring( numb ) -6 ) )<br />
return tonumber( fn )<br />
end<br />
<br />
if not ( type ) or ( type == "+" ) then<br />
local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) + integer<br />
return tonumber( fn )<br />
else<br />
local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) - integer<br />
return tonumber( fn )<br />
end<br />
end<br />
</syntaxhighlight><br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
mathNumber ( 1364576384, 1, '-' )<br />
-- Returns: 1364576383<br />
<br />
1364576384 - 1<br />
-- Returns: 1364576384<br />
<br />
mathNumber ( 1364576384, 1, '+' )<br />
-- Returns: 1364576385<br />
<br />
1364576384 + 1<br />
-- Returns: 1364576384<br />
</syntaxhighlight><br />
<br />
<br />
Author: DennisUniOn<br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&diff=35451Template:Useful Functions2013-04-17T17:23:59Z<p>UniOnDennis: </p>
<hr />
<div>*[[callClientFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to call any clientside function from the server's side.</span><br />
*[[callServerFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to call any server-side function from the client's side.</span><br />
*[[centerWindow]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function center the window in any resolution.</span><br />
*[[Check]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if it's arguments are of the right types and calls the error-function if one isn't.</span><br />
*[[coroutine.resume]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Fix for hidden coroutine error messages</span><br />
*[[dxDrawColorText]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a dx text with #RRGGBB color codes support.</span><br />
*[[dxDrawGifImage]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function simulates the effect of a GIF image by using image sprites.</span><br />
*[[dxDrawImage3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D image.</span><br />
*[[dxDrawRectangle3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D rectangle.</span><br />
*[[dxGetFontSizeFromHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculate a font size from given height for dxDraw.</span><br />
*[[dxGetRealFontHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Accurately measures the pixel height of a font.</span><br />
*[[findRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Takes two points and returns the direction from point A to point B.</span><br />
*[[FormatDate]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Formats a date on the basis of a format string and returns it.</span><br />
*[[GenerateString]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» With this function you can generate a random string with any characters.</span><br />
*[[getAge]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculates the age of a birthday.</span><br />
*[[getAlivePlayers (Client)|getAlivePlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns all the alive players by a client side, so you can store them into a Gridlist or something like that, faster.</span><br />
*[[getAlivePlayersInTeam]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the alive players in a team.</span><br />
*[[getCursorMoveOn]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks in which way the cursor is currently moving.</span><br />
*[[getDistanceBetweenPointAndSegment2D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.</span><br />
*[[getElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get element speed in kph or mph units.</span><br />
*[[getJetpackWeaponsEnabled]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of enabled weapons usable on a jetpack.</span><br />
*[[getOffsetFromXYZ]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.</span><br />
*[[getOnlineAdmins]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function will give the online admins.</span><br />
*[[getOnlineStaff]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns all online staff, names separated by two spaces.</span><br />
*[[getPlayerFromNamePart]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get player From his Name part.</span><br />
*[[getPlayersInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gets all the players in a photograph.</span><br />
*[[getPointFromDistanceRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Finds a point based on a starting point, direction and distance.</span><br />
*[[getResourceSettings]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the resource settings.</span><br />
*[[getTimestamp]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» With this function you can get the UNIX timestamp.</span><br />
*[[getXMLNodes]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns all children of a node</span><br />
*[[getVehicleRespawnPosition]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get the spawn position of a vehicle.</span><br />
*[[guiComboBoxAdjustHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Adjusts the combobox to have a correct height.</span><br />
*[[guiEditSetActive]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Puts the caret of an editbox to the gived position.</span><br />
*[[IfElse]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns one of two values based on a boolean expression.</span><br />
*[[isElementInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element was in the player's camera picture.</span><br />
*[[isElementInRange]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.</span><br />
*[[isElementMoving]]<span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element is moving.</span><br />
*[[isPedAiming]]<span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a ped is aiming.</span><br />
*[[isPlayerInTeam]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function check if the player in the team.</span><br />
*[[isLeapYear]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Checks if the given year is a leap year.</span><br />
*[[isVehicleOnRoof]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether vehicle is on roof.</span><br />
*[[iterElements]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).</span><br />
*[[math.round]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Rounds a number whereas the number of decimals to keep and the method may be set.</span><br />
*[[multi_check]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks one element to many, handy and clean.</span><br />
*[[onVehicleWeaponFire]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.</span><br />
*[[setElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to set moving element speed in kph or mph units.</span><br />
*[[setTableProtected]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Protects a table and makes it read-only.</span><br />
*[[setVehicleGravityPoint]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This clientside function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.</span><br />
*[[smoothMoveCamera]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This clientside function allows you to create a cinematic camera flight.<br />
*[[string.count]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function counts a text from a text.</span><br />
*[[string.explode]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function splits a string at a given separator pattern and returns a table with the pieces.</span><br />
*[[switch]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allow the value of a variable or expression to control the flow of program execution via a multiway branch.</span><br />
*[[table.copy]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function copies a whole table and all the tables in that table.</span><br />
*[[table.compare]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function check if both tables is equal. </span><br />
*[[table.empty]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function check is empty table or not.</span><br />
*[[table.map]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.</span><br />
*[[table.random]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function retrieves a random variable from a table.</span><br />
*[[table.size]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Finds the absolute size of a table.</span><br />
*[[var dump]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function outputs information about one or more variables using outputConsole()</span><br />
*[[RGBToHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a string representing the color in hexadecimal.</span><br />
*[[toHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.</span><br />
*[[wavelengthToRGBA]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a phisical wavelength of light to a RGBA color.</span><br />
*[[convertNumber]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts large numbers and adds commas to it. (Example: 100000 -> 100,000)</span><br />
*[[getPlayerFromSerial]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gets an online player from their serial.</span><br />
*[[isPlayerInACL]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns true, if the player is in the given ACL, if they're not, it will return false.</span><br />
*[[mathNumber]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function is a workaround for the clientside floating-point precision of 24-bits</span><br />
[[Category:Useful Functions]]</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=MathNumber&diff=35450MathNumber2013-04-17T17:20:32Z<p>UniOnDennis: Created page with "{{Useful Function}} __NOTOC__ This function can be used to take or add a number from a lage number. MTA clients do only support 24-bits numbers, therefore you can't take or add ..."</p>
<hr />
<div>{{Useful Function}}<br />
__NOTOC__<br />
This function can be used to take or add a number from a lage number.<br />
<br />
MTA clients do only support 24-bits numbers, therefore you can't take or add a single digit from large numbers like '1364576384'.<br />
<br />
This function is only needed client-side since the server runs with a floating-point precision of 56-bits<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">number mathNumber ( int num, int integer, string type )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''num''': The number you want to edit<br />
* '''integer''': The amount you want to add or take from the number<br />
* '''type ''': Can be either '-' or '+'<br />
<br />
==Code==<br />
<syntaxhighlight lang="lua"><br />
-- Function that takes a digit from a larger number<br />
function mathNumber ( num, integer, type )<br />
if not ( num ) or not ( integer ) then return end<br />
<br />
local function formatNumber( numb )<br />
if not ( numb ) then return end<br />
local fn = string.sub( tostring( numb ), ( #tostring( numb ) -6 ) )<br />
return tonumber( fn )<br />
end<br />
<br />
if not ( type ) or ( type == "+" ) then<br />
local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) + integer<br />
return tonumber( fn )<br />
else<br />
local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) - integer<br />
return tonumber( fn )<br />
end<br />
end<br />
</syntaxhighlight><br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
mathNumber ( 1364576384, 1, '-' )<br />
-- Returns: 1364576383<br />
<br />
1364576384 - 1<br />
-- Returns: 1364576384<br />
<br />
mathNumber ( 1364576384, 1, '+' )<br />
-- Returns: 1364576385<br />
<br />
1364576384 + 1<br />
-- Returns: 1364576384<br />
</syntaxhighlight><br />
<br />
<br />
Author: DennisUniOn<br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=User:UniOnDennis&diff=35384User:UniOnDennis2013-04-14T18:49:23Z<p>UniOnDennis: </p>
<hr />
<div>Founder, ex-leader and ex-developer from CSG (Community of Social Gaming)<br />
<br />
Former co-owner and developer from SAUR (SAUR Utopia RPG)<br />
<br />
Currently working as leader and developer on NEG (Network of Entertainment and Gaming)<br />
<br />
<br />
<br />
==Wiki changes by me==<br />
'''14th April 2013''' Documented: [[setCursorAlpha]], [[getCursorAlpha]]<br />
<br />
'''18th February 2013''' Documented: [[isPlayerHudComponentVisible]]<br />
<br />
'''30th January 2013''' Documented: [[GuiGridListGetColumnTitle]], [[GuiGridListSetColumnTitle]], [[GuiGridListGetHorizontalScrollPosition]], [[GuiGridListGetVerticalScrollPosition]], [[GuiGridListSetHorizontalScrollPosition]], [[GuiGridListSetVerticalScrollPosition]], [[ToggleObjectRespawn]], [[SetPlayerHudComponentVisible]], [[GetPedCameraRotation]], [[OnWeaponFire]]<br />
<br />
'''21th December 2012''' Documented: [[Sha256]]</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=User:UniOnDennis&diff=35383User:UniOnDennis2013-04-14T18:49:10Z<p>UniOnDennis: </p>
<hr />
<div>Founder, ex-leader and ex-developer from CSG (Community of Social Gaming)<br />
Former co-owner and developer from SAUR (SAUR Utopia RPG)<br />
Currently working as leader and developer on NEG (Network of Entertainment and Gaming)<br />
<br />
<br />
==Wiki changes by me==<br />
'''14th April 2013''' Documented: [[setCursorAlpha]], [[getCursorAlpha]]<br />
<br />
'''18th February 2013''' Documented: [[isPlayerHudComponentVisible]]<br />
<br />
'''30th January 2013''' Documented: [[GuiGridListGetColumnTitle]], [[GuiGridListSetColumnTitle]], [[GuiGridListGetHorizontalScrollPosition]], [[GuiGridListGetVerticalScrollPosition]], [[GuiGridListSetHorizontalScrollPosition]], [[GuiGridListSetVerticalScrollPosition]], [[ToggleObjectRespawn]], [[SetPlayerHudComponentVisible]], [[GetPedCameraRotation]], [[OnWeaponFire]]<br />
<br />
'''21th December 2012''' Documented: [[Sha256]]</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=Template:Client_cursor_functions&diff=35382Template:Client cursor functions2013-04-14T14:42:16Z<p>UniOnDennis: </p>
<hr />
<div>*[[getCursorPosition]]<br />
*[[setCursorPosition]]<br />
*[[isCursorShowing]]<br />
*[[showCursor]]<br />
{{New feature/item|4.0140|1.4|5248|<br />
* [[getCursorAlpha]]<br />
}}<br />
{{New feature/item|4.0140|1.4|5242|<br />
* [[setCursorAlpha]]<br />
}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=Undocumented_Items&diff=35381Undocumented Items2013-04-14T14:34:47Z<p>UniOnDennis: /* Other undocumented pages */</p>
<hr />
<div>This page lists all MTA SA functions and events which don't have the necessary documentation for scripters to allow them to use the functions or events. Documenting these will require looking through [http://code.google.com/p/mtasa-blue/source/browse/ mtasa-blue source] changes to get the necessary parameters.<br />
__NOTOC__<br />
== Client functions that need documenting ==<br />
* [[setSoundPanningEnabled]]<br />
* [[getSoundWaveData]]<br />
* [[getPedAnalogControlState]]<br />
<br />
== Server functions that need documenting ==<br />
(None)<br />
<br />
== Client Events that need documenting ==<br />
* [[onClientSoundBeat]]<br />
<br />
== Server Events that need documenting ==<br />
(None)<br />
<br />
== Other undocumented pages ==</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=User:UniOnDennis&diff=35380User:UniOnDennis2013-04-14T14:14:38Z<p>UniOnDennis: /* Wiki changes by me */</p>
<hr />
<div>Founder, ex-leader and ex-developer from CSG (Community of Social Gaming).<br />
<br />
SAUR Co-owner and Developer.<br />
<br />
==Wiki changes by me==<br />
'''14th April 2013''' Documented: [[setCursorAlpha]], [[getCursorAlpha]]<br />
<br />
'''18th February 2013''' Documented: [[isPlayerHudComponentVisible]]<br />
<br />
'''30th January 2013''' Documented: [[GuiGridListGetColumnTitle]], [[GuiGridListSetColumnTitle]], [[GuiGridListGetHorizontalScrollPosition]], [[GuiGridListGetVerticalScrollPosition]], [[GuiGridListSetHorizontalScrollPosition]], [[GuiGridListSetVerticalScrollPosition]], [[ToggleObjectRespawn]], [[SetPlayerHudComponentVisible]], [[GetPedCameraRotation]], [[OnWeaponFire]]<br />
<br />
'''21th December 2012''' Documented: [[Sha256]]</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetCursorAlpha&diff=35379GetCursorAlpha2013-04-14T14:09:23Z<p>UniOnDennis: /* Returns */</p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5248|<br />
This function is used to get alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float getCursorAlpha( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a float (0-1) indicating the cursor's alpha<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the getCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
if ( isCursorShowing ( ) ) then<br />
outputChatBox( "The cursor alpha: "..getCursorAlpha( ) )<br />
else<br />
outputChatBox( "The cursor is not showing!" )<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetCursorAlpha&diff=35378SetCursorAlpha2013-04-14T14:09:06Z<p>UniOnDennis: /* Example */</p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5242|<br />
This function is used to change alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setCursorAlpha( float alpha )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''alpha ''': The alpha value to set. Value can be 0-1, where 1 is fully opaque and 0 is fully transparent.<br />
<br />
===Returns===<br />
Returns ''true'' if the new alpha value was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the setCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
-- Show the cursor if it is not showing or hide the cursor if it is<br />
showCursor( not isCursorShowing ( ) )<br />
-- Set the alpha to 0.5<br />
setCursorAlpha( 0.5 )<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetCursorAlpha&diff=35377SetCursorAlpha2013-04-14T14:08:51Z<p>UniOnDennis: /* Required Arguments */</p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5242|<br />
This function is used to change alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setCursorAlpha( float alpha )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''alpha ''': The alpha value to set. Value can be 0-1, where 1 is fully opaque and 0 is fully transparent.<br />
<br />
===Returns===<br />
Returns ''true'' if the new alpha value was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the setCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
-- Show the cursor if it is not showing or hide the cursor if it is<br />
showCursor( not isCursorShowing ( ) )<br />
-- Set the alpha to 150<br />
setCursorAlpha( 150 )<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetCursorAlpha&diff=35376SetCursorAlpha2013-04-14T14:03:43Z<p>UniOnDennis: /* Example */</p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5242|<br />
This function is used to change alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setCursorAlpha( float alpha )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''alpha ''': The alpha value to set. Value can be 0-255, where 255 is fully opaque and 0 is fully transparent.<br />
<br />
===Returns===<br />
Returns ''true'' if the new alpha value was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the setCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
-- Show the cursor if it is not showing or hide the cursor if it is<br />
showCursor( not isCursorShowing ( ) )<br />
-- Set the alpha to 150<br />
setCursorAlpha( 150 )<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetCursorAlpha&diff=35375GetCursorAlpha2013-04-14T14:02:48Z<p>UniOnDennis: /* Example */</p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5248|<br />
This function is used to get alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float getCursorAlpha( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a float (0-255) indicating the cursor's alpha<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test the getCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
if ( isCursorShowing ( ) ) then<br />
outputChatBox( "The cursor alpha: "..getCursorAlpha( ) )<br />
else<br />
outputChatBox( "The cursor is not showing!" )<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetCursorAlpha&diff=35374GetCursorAlpha2013-04-14T14:02:18Z<p>UniOnDennis: Example added</p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5248|<br />
This function is used to get alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float getCursorAlpha( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a float (0-255) indicating the cursor's alpha<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test setCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
if ( isCursorShowing ( ) ) then<br />
outputChatBox( "The cursor alpha: "..getCursorAlpha( ) )<br />
else<br />
outputChatBox( "The cursor is not showing!" )<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetCursorAlpha&diff=35373SetCursorAlpha2013-04-14T13:58:59Z<p>UniOnDennis: Example added</p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5242|<br />
This function is used to change alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setCursorAlpha( float alpha )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''alpha ''': The alpha value to set. Value can be 0-255, where 255 is fully opaque and 0 is fully transparent.<br />
<br />
===Returns===<br />
Returns ''true'' if the new alpha value was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Simple command to test setCursorAlpha function<br />
addCommandHandler( "cursorAlpha", <br />
function ()<br />
-- Show the cursor if it is not showing or hide the cursor if it is<br />
showCursor( not isCursorShowing ( ) )<br />
-- Set the alpha to 150<br />
setCursorAlpha( 150 )<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=SetCursorAlpha&diff=35372SetCursorAlpha2013-04-14T13:56:04Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5242|<br />
This function is used to change alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setCursorAlpha( float alpha )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''alpha ''': The alpha value to set. Value can be 0-255, where 255 is fully opaque and 0 is fully transparent.<br />
<br />
===Returns===<br />
Returns ''true'' if the new alpha value was set, or ''false'' otherwise.<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetCursorAlpha&diff=35371GetCursorAlpha2013-04-14T13:55:24Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5248|<br />
This function is used to get alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float getCursorAlpha( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a float (0-255) indicating the cursor's alpha<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetCursorAlpha&diff=35370GetCursorAlpha2013-04-14T13:55:09Z<p>UniOnDennis: </p>
<hr />
<div>{{client function}}<br />
{{New feature/item|3.0132|1.4|5242|<br />
This function is used to get alpha (transparency) from the client's cursor.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float getCursorAlpha( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a float (0-255) indicating the cursor's alpha<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennishttps://wiki.multitheftauto.com/index.php?title=GetCursorAlpha&diff=35369GetCursorAlpha2013-04-14T13:53:23Z<p>UniOnDennis: Created page with "{{client function}} This function is used to get alpha (transparency) from the client's cursor. ==Syntax== <syntaxhighlight lang="lua"> float getCursorAlpha( ) </syntaxhighlight> ===Returns=== Returns a..."</p>
<hr />
<div>{{client function}}<br />
This function is used to get alpha (transparency) from the client's cursor.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float getCursorAlpha( )<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a float (0-255) indicating the cursor's alpha<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.4}}<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- Todo<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>UniOnDennis