https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=AlexTMjugador&feedformat=atom
Multi Theft Auto: Wiki - User contributions [en]
2024-03-29T08:59:43Z
User contributions
MediaWiki 1.39.3
https://wiki.multitheftauto.com/index.php?title=DecodeString&diff=71949
DecodeString
2021-08-22T15:18:18Z
<p>AlexTMjugador: Specify that the AES-128 cipher exposed by this function uses CTR mode</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 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 decode the input with.<br />
* ''aes128'' ([https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard] in CTR mode)<br />
** '''key''': a key to decode the input with.<br />
** '''iv''': the initialization vector that was generated by [[encodeString]] for this combination of data and encryption algorithm.<br />
<br />
===Optional Arguments===<br />
{{New items|3.0158|1.5.7|<br />
*'''callback:''' providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.<br />
|20394}}<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>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=EncodeString&diff=71948
EncodeString
2021-08-22T15:17:46Z
<p>AlexTMjugador: Specify that the AES-128 cipher exposed by this function uses CTR mode</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 />
==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 />
{{New items|3.0159|1.5.8|<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 />
<br />
===Optional Arguments===<br />
{{New items|3.0158|1.5.7|<br />
*'''callback:''' providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.<br />
|20394}}<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 />
<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>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=EncodeString&diff=71581
EncodeString
2021-08-06T22:56:29Z
<p>AlexTMjugador: Fix typo</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 />
==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 />
{{New items|3.0159|1.5.8|<br />
* ''aes128'' ([https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard])<br />
** '''key''': a key to encode the input with (must be 16 characters long).<br />
|20898}}<br />
<br />
===Optional Arguments===<br />
{{New items|3.0158|1.5.7|<br />
*'''callback:''' providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.<br />
|20394}}<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 />
<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>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=DecodeString&diff=71580
DecodeString
2021-08-06T22:54:50Z
<p>AlexTMjugador: Fix link in AES section and do some other cosmetic tweaks</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 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 decode the input with.<br />
* ''aes128'' ([https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard])<br />
** '''key''': a key to decode the input with.<br />
** '''iv''': the initialization vector that was generated by [[encodeString]] for this combination of data and encryption algorithm.<br />
<br />
===Optional Arguments===<br />
{{New items|3.0158|1.5.7|<br />
*'''callback:''' providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.<br />
|20394}}<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>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=EncodeString&diff=71579
EncodeString
2021-08-06T22:51:11Z
<p>AlexTMjugador: Tweak some unneeded external links and other minor cosmetic changes</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 />
==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 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 encode the input with.<br />
{{New items|3.0159|1.5.8|<br />
* ''aes128'' ([https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard])<br />
** '''key''': a key to encode the input with (must be 16 characters long).<br />
|20898}}<br />
<br />
===Optional Arguments===<br />
{{New items|3.0158|1.5.7|<br />
*'''callback:''' providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.<br />
|20394}}<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 />
<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>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=SetVehicleWheelScale&diff=67386
SetVehicleWheelScale
2020-09-06T18:04:39Z
<p>AlexTMjugador: Grammar nitpick</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0158|1.5.7|20642|This function sets the scale of all the wheels of a [[vehicle]]. The wheel scale multiplies the visible height and length (but not width) of all the wheels in a vehicle, without affecting their collisions or the handling, similarly to [[setVehicleComponentScale]]. The wheel scale is applied after the [[setVehicleModelWheelSize|model wheel size]].}}<br />
{{Note|Installing or removing a wheel upgrade from a vehicle resets the wheel scale to the default value.}}<br />
{{Tip|The default value for vehicles without wheel upgrades is 1, which renders the wheels in the model as usual. On the other hand, the default value for vehicles with a wheel upgrade is the [[setVehicleModelWheelSize|size of the wheels in the front axle]] of the vehicle model.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setVehicleWheelScale ( vehicle theVehicle, float wheelScale )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:setWheelScale|wheelScale|getVehicleWheelScale}}<br />
<br />
===Required Arguments===<br />
*'''theVehicle''': The [[vehicle]] whose wheel scale you wish to modify.<br />
*'''wheelScale''': The wheel scale value to set.<br />
<br />
===Returns===<br />
Returns ''true'' if the wheel scale has been set successfully, or an error if some parameter is invalid.<br />
<br />
==Example==<br />
[[File:Wheel scale example preview.png|thumb|Preview of the results of invoking the ''shrinkwheels'' command]]<br />
This example adds a ''shrinkwheels'' command that reduces the wheel scale of a vehicle in half each time it is invoked.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("shrinkwheels", function()<br />
local veh = getPedOccupiedVehicle(localPlayer)<br />
if veh then<br />
local newScale = getVehicleWheelScale(veh) * 0.5<br />
setVehicleWheelScale(veh, newScale)<br />
outputChatBox("Vehicle wheel scale set to " .. newScale .. ".", 0, 255, 0)<br />
else<br />
outputChatBox("You must be in a vehicle to use this command.", 255, 0, 0)<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=GetVehicleModelWheelSize&diff=67383
GetVehicleModelWheelSize
2020-09-04T12:46:10Z
<p>AlexTMjugador: /* Examples */: consistent indentation</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0158|1.5.7|20642|This function gets the size of a group of wheels for a [[Vehicle IDs|vehicle model]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float|table getVehicleModelWheelSize ( int vehicleModel [, string wheelGroup ] )<br />
</syntaxhighlight><br />
{{OOP||[[Vehicle]].getModelWheelSize||setVehicleModelWheelSize}}<br />
<br />
===Required Arguments===<br />
*'''vehicleModel''': The [[Vehicle IDs|vehicle model]] ID.<br />
<br />
===Optional Arguments===<br />
*'''wheelGroup''': The group of wheels of the vehicle model to retrieve their size value. If not specified, it defaults to ''all_wheels''. The following values are supported:<br />
**''front_axle'': Represents the wheels in the front axle.<br />
**''rear_axle'': Represents the wheels in the rear axle.<br />
**''all_wheels'': Convenience group that returns all the wheel sizes in a table of the following format:<br />
<syntaxhighlight lang="lua">{ front_axle = 0.8, rear_axle = 0.7 }</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a decimal number or a table, depending on the specified wheel group. If the specified vehicle model ID or wheel group are not valid, an error is raised instead. The meaning of the wheel size values is documented in [[setVehicleModelWheelSize]].<br />
<br />
==Example==<br />
This example adds a ''hoverme'' command that exploits the fact that the wheel size changes the ground clearance of a vehicle model to make it hover over the ground.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("hoverme", function()<br />
local veh = getPedOccupiedVehicle(localPlayer)<br />
if veh then<br />
local vehicleId = getElementModel(veh)<br />
local currentSizes = getVehicleModelWheelSize(vehicleId)<br />
setVehicleModelWheelSize(vehicleId, "front_axle", currentSizes.front_axle * 2)<br />
setVehicleModelWheelSize(vehicleId, "rear_axle", currentSizes.rear_axle * 2)<br />
outputChatBox("Vehicle model wheel size doubled!", 0, 255, 0)<br />
else<br />
outputChatBox("You must be in a vehicle to use this command.", 255, 0, 0)<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=SetVehicleWheelScale&diff=67382
SetVehicleWheelScale
2020-09-04T11:58:05Z
<p>AlexTMjugador: Define the default wheel scale for vehicles with wheel upgrades more precisely</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0158|1.5.7|20642|This function sets the scale of all the wheels of a [[vehicle]]. The wheel scale multiplies the visible height and length (but not width) of all the wheels in a vehicle, without affecting their collisions or the handling, similarly to [[setVehicleComponentScale]]. The wheel scale is applied after the [[setVehicleModelWheelSize|model wheel size]].}}<br />
{{Note|Installing or removing a wheel upgrade in a vehicle resets the wheel scale to the default value.}}<br />
{{Tip|The default value for vehicles without wheel upgrades is 1, which renders the wheels in the model as usual. On the other hand, the default value for vehicles with a wheel upgrade is the [[setVehicleModelWheelSize|size of the wheels in the front axle]] of the vehicle model.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setVehicleWheelScale ( vehicle theVehicle, float wheelScale )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:setWheelScale|wheelScale|getVehicleWheelScale}}<br />
<br />
===Required Arguments===<br />
*'''theVehicle''': The [[vehicle]] whose wheel scale you wish to modify.<br />
*'''wheelScale''': The wheel scale value to set.<br />
<br />
===Returns===<br />
Returns ''true'' if the wheel scale has been set successfully, or an error if some parameter is invalid.<br />
<br />
==Example==<br />
[[File:Wheel scale example preview.png|thumb|Preview of the results of invoking the ''shrinkwheels'' command]]<br />
This example adds a ''shrinkwheels'' command that reduces the wheel scale of a vehicle in half each time it is invoked.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("shrinkwheels", function()<br />
local veh = getPedOccupiedVehicle(localPlayer)<br />
if veh then<br />
local newScale = getVehicleWheelScale(veh) * 0.5<br />
setVehicleWheelScale(veh, newScale)<br />
outputChatBox("Vehicle wheel scale set to " .. newScale .. ".", 0, 255, 0)<br />
else<br />
outputChatBox("You must be in a vehicle to use this command.", 255, 0, 0)<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&diff=67381
Template:Client vehicle functions
2020-09-03T23:52:15Z
<p>AlexTMjugador: Add functions introduced in r20642</p>
<hr />
<div>*[[addVehicleUpgrade]]<br />
{{New items|3.0158|1.5.7|<br />
*[[areVehicleLightsOn]]<br />
|19626}}<br />
*[[attachTrailerToVehicle]]<br />
*[[blowVehicle]]<br />
*[[createVehicle]]<br />
*[[detachTrailerFromVehicle]]<br />
*[[fixVehicle]]<br />
*[[getHeliBladeCollisionsEnabled]]<br />
*[[getHelicopterRotorSpeed]]<br />
*[[getOriginalHandling]]<br />
*[[getTrainDirection]]<br />
*[[getTrainPosition]]<br />
*[[getTrainSpeed]]<br />
{{New items|3.0160|1.6|<br />
*[[getTrainTrack]]<br />
|7485}}<br />
*[[getVehicleAdjustableProperty]]<br />
*[[getVehicleColor]]<br />
*[[getVehicleCompatibleUpgrades]]<br />
*[[getVehicleComponentPosition]]<br />
*[[getVehicleComponentRotation]]<br />
*[[getVehicleComponentScale]]<br />
*[[getVehicleComponentVisible]]<br />
*[[getVehicleComponents]]<br />
*[[getVehicleController]]<br />
*[[getVehicleCurrentGear]]<br />
*[[getVehicleDoorOpenRatio]]<br />
*[[getVehicleDoorState]]<br />
*[[getVehicleEngineState]]<br />
*[[getVehicleGravity]]<br />
*[[getVehicleHandling]]<br />
*[[getVehicleHeadLightColor]]<br />
*[[getVehicleLandingGearDown]]<br />
*[[getVehicleLightState]]<br />
*[[getVehicleMaxPassengers]]<br />
{{New items|3.0157|1.5.6|<br />
*[[getVehicleModelDummyPosition]]<br />
|14403}}<br />
*[[getVehicleModelExhaustFumesPosition]]<br />
*[[getVehicleModelFromName]]<br />
{{New items|3.0158|1.5.7|<br />
*[[getVehicleModelWheelSize]]<br />
|20642}}<br />
*[[getVehicleName]]<br />
*[[getVehicleNameFromModel]]<br />
*[[getVehicleNitroCount]]<br />
*[[getVehicleNitroLevel]]<br />
*[[getVehicleOccupant]]<br />
*[[getVehicleOccupants]]<br />
*[[getVehicleOverrideLights]]<br />
*[[getVehiclePaintjob]]<br />
*[[getVehiclePanelState]]<br />
*[[getVehiclePlateText]]<br />
*[[getVehicleSirens]]<br />
*[[getVehicleSirensOn]]<br />
*[[getVehicleSirenParams]]<br />
*[[getVehicleTowedByVehicle]]<br />
*[[getVehicleTowingVehicle]]<br />
{{Deprecated items|3.0156|1.5.6|<br />
*[[getVehicleTurnVelocity]]<br />
}}<br />
*[[getVehicleTurretPosition]]<br />
*[[getVehicleType]]<br />
*[[getVehicleUpgradeOnSlot]]<br />
*[[getVehicleUpgradeSlotName]]<br />
*[[getVehicleUpgrades]]<br />
*[[getVehicleVariant]]<br />
{{New items|3.0158|1.5.7|<br />
*[[getVehicleWheelScale]]<br />
|20642}}<br />
*[[getVehicleWheelStates]]<br />
*[[isTrainChainEngine]]<br />
*[[isTrainDerailable]]<br />
*[[isTrainDerailed]]<br />
*[[isVehicleBlown]]<br />
*[[isVehicleDamageProof]]<br />
*[[isVehicleFuelTankExplodable]]<br />
*[[isVehicleLocked]]<br />
*[[isVehicleNitroActivated]]<br />
*[[isVehicleNitroRecharging]]<br />
*[[isVehicleOnGround]]<br />
*[[isVehicleTaxiLightOn]]<br />
{{New items|3.0156|1.5.5|<br />
*[[isVehicleWheelOnGround]]<br />
|11854}}<br />
*[[isVehicleWindowOpen]]<br />
*[[removeVehicleUpgrade]]<br />
*[[resetVehicleComponentPosition]]<br />
*[[resetVehicleComponentRotation]]<br />
*[[resetVehicleComponentScale]]<br />
*[[setHeliBladeCollisionsEnabled]]<br />
*[[setHelicopterRotorSpeed]]<br />
*[[setTrainDerailable]]<br />
*[[setTrainDerailed]]<br />
*[[setTrainDirection]]<br />
*[[setTrainPosition]]<br />
*[[setTrainSpeed]]<br />
{{New items|3.0160|1.6|<br />
*[[setTrainTrack]]<br />
|7485}}<br />
*[[setVehicleAdjustableProperty]]<br />
*[[setVehicleColor]]<br />
*[[setVehicleComponentPosition]]<br />
*[[setVehicleComponentRotation]]<br />
*[[setVehicleComponentScale]]<br />
*[[setVehicleComponentVisible]]<br />
*[[setVehicleDamageProof]]<br />
*[[setVehicleDirtLevel]]<br />
*[[setVehicleDoorOpenRatio]]<br />
*[[setVehicleDoorState]]<br />
*[[setVehicleDoorsUndamageable]]<br />
*[[setVehicleEngineState]]<br />
*[[setVehicleFuelTankExplodable]]<br />
*[[setVehicleGravity]]<br />
{{New items|3.0156|1.5.5|<br />
*[[setVehicleHandling]]<br />
|12009}}<br />
*[[setVehicleHeadLightColor]]<br />
*[[setVehicleLandingGearDown]]<br />
*[[setVehicleLightState]]<br />
*[[setVehicleLocked]]<br />
{{New items|3.0157|1.5.6|<br />
*[[setVehicleModelDummyPosition]]<br />
|14403}}<br />
*[[setVehicleModelExhaustFumesPosition]]<br />
{{New items|3.0158|1.5.7|<br />
*[[setVehicleModelWheelSize]]<br />
|20642}}<br />
*[[setVehicleNitroActivated]]<br />
*[[setVehicleNitroCount]]<br />
*[[setVehicleNitroLevel]]<br />
*[[setVehicleOverrideLights]]<br />
*[[setVehiclePaintjob]]<br />
*[[setVehiclePanelState]]<br />
*[[setVehiclePlateText]]<br />
*[[setVehicleSirens]]<br />
*[[setVehicleSirensOn]]<br />
*[[setVehicleTaxiLightOn]]<br />
{{Deprecated items|3.0156|1.5.6|<br />
*[[setVehicleTurnVelocity]]<br />
}}<br />
*[[setVehicleTurretPosition]]<br />
{{New items|3.0158|1.5.7|<br />
*[[setVehicleWheelScale]]<br />
|20642}}<br />
*[[setVehicleWheelStates]]<br />
*[[setVehicleWindowOpen]]<br />
<br />
<noinclude>[[ru:Template:RU/Client_vehicle_functions]]<br />
[[Category:Functions templates]]</noinclude></div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=GetVehicleModelWheelSize&diff=67380
GetVehicleModelWheelSize
2020-09-03T23:47:46Z
<p>AlexTMjugador: Document function introduced in r20642</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0158|1.5.7|20642|This function gets the size of a group of wheels for a [[Vehicle IDs|vehicle model]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float|table getVehicleModelWheelSize ( int vehicleModel [, string wheelGroup ] )<br />
</syntaxhighlight><br />
{{OOP||[[Vehicle]].getModelWheelSize||setVehicleModelWheelSize}}<br />
<br />
===Required Arguments===<br />
*'''vehicleModel''': The [[Vehicle IDs|vehicle model]] ID.<br />
<br />
===Optional Arguments===<br />
*'''wheelGroup''': The group of wheels of the vehicle model to retrieve their size value. If not specified, it defaults to ''all_wheels''. The following values are supported:<br />
**''front_axle'': Represents the wheels in the front axle.<br />
**''rear_axle'': Represents the wheels in the rear axle.<br />
**''all_wheels'': Convenience group that returns all the wheel sizes in a table of the following format:<br />
<syntaxhighlight lang="lua">{ front_axle = 0.8, rear_axle = 0.7 }</syntaxhighlight><br />
<br />
===Returns===<br />
Returns a decimal number or a table, depending on the specified wheel group. If the specified vehicle model ID or wheel group are not valid, an error is raised instead. The meaning of the wheel size values is documented in [[setVehicleModelWheelSize]].<br />
<br />
==Examples==<br />
This example adds a ''hoverme'' command that exploits the fact that the wheel size changes the ground clearance of a vehicle model to make it hover over the ground.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("hoverme", function()<br />
local veh = getPedOccupiedVehicle(localPlayer)<br />
if veh then<br />
local vehicleId = getElementModel(veh)<br />
local currentSizes = getVehicleModelWheelSize(vehicleId)<br />
setVehicleModelWheelSize(vehicleId, "front_axle", currentSizes.front_axle * 2)<br />
setVehicleModelWheelSize(vehicleId, "rear_axle", currentSizes.rear_axle * 2)<br />
outputChatBox("Vehicle model wheel size doubled!", 0, 255, 0)<br />
else<br />
outputChatBox("You must be in a vehicle to use this command.", 255, 0, 0)<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=SetVehicleModelWheelSize&diff=67379
SetVehicleModelWheelSize
2020-09-03T23:46:30Z
<p>AlexTMjugador: Document function introduced in r20642</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0158|1.5.7|20642|This function sets the size of a group of wheels for a [[Vehicle IDs|vehicle model]]. The wheel size mainly determines their width, collision box (used to check if a bullet hits a tire, for example) and the ground clearance of vehicles with that model (i.e., the minimum distance from the center of the car geometry to the ground). It also changes the visual scale and rotation of the wheels, if not all the wheel groups have equal size. The visual scaling is applied before the per-vehicle [[setVehicleWheelScale|wheel scale]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setVehicleModelWheelSize ( int vehicleModel, string wheelGroup, float wheelSize )<br />
</syntaxhighlight><br />
{{OOP||[[Vehicle]].setModelWheelSize||getVehicleModelWheelSize}}<br />
<br />
===Required Arguments===<br />
*'''vehicleModel''': The [[Vehicle IDs|vehicle model]] ID.<br />
*'''wheelGroup''': The group of wheels of the vehicle model that will have its size set by this function. The following values are supported:<br />
**''front_axle'': Represents the wheels in the front axle. The default value for this group is read by GTA from the ''WheelScale_Front'' field of the ''vehicles.ide'' data file.<br />
**''rear_axle'': Represents the wheels in the rear axle. The default value for this group is read by GTA from the ''WheelScale_Rear'' field of the ''vehicles.ide'' data file.<br />
**''all_wheels'': Convenience group that contains the other wheel groups: ''front_axle'' and ''rear_axle''.<br />
*'''wheelSize''': The wheel size value to set. Default GTA values for automobiles usually are around 0.7. It must be greater than 0.<br />
<br />
===Returns===<br />
Returns ''true'' if the size for the specified wheel group and vehicle model has been set successfully, or an error if some parameter is invalid.<br />
<br />
==Example==<br />
This example replaces the Infernus model with a Huntley model and sets the intended wheel scale for the new model accordingly, so that the vehicle does not look sunken into the ground.<br />
<syntaxhighlight lang="lua"><br />
engineImportTXD(engineLoadTXD("huntley.txd"), 411)<br />
engineReplaceModel(engineLoadDFF("huntley.txd"), 411)<br />
setVehicleModelWheelSize(411, "all_wheels", 0.9) -- Default Huntley model wheel size, from default vehicles.ide<br />
</syntaxhighlight><br />
<br />
[[File:Wheel size example preview.png|thumb|Preview of the funky Bandito example]]<br />
This example sets the rear axle size of the Bandito to a high value, to showcase its effect and make it more funky.<br />
<syntaxhighlight lang="lua"><br />
setVehicleModelWheelSize(568, "rear_axle", 1.8) -- 0.7 is the usual value<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=SetVehicleWheelScale&diff=67378
SetVehicleWheelScale
2020-09-03T23:44:14Z
<p>AlexTMjugador: Remove unneeded link tags from OOP syntax</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0158|1.5.7|20642|This function sets the scale of all the wheels of a [[vehicle]]. The wheel scale multiplies the visible height and length (but not width) of all the wheels in a vehicle, without affecting their collisions or the handling, similarly to [[setVehicleComponentScale]]. The wheel scale is applied after the [[setVehicleModelWheelSize|model wheel size]].}}<br />
{{Note|Installing or removing a wheel upgrade in a vehicle resets the wheel scale to the default value.}}<br />
{{Tip|The default value for vehicles without wheel upgrades is 1, which renders the wheels in the model as usual. On the other hand, the default value for vehicles with a wheel upgrade depends on the [[setVehicleModelWheelSize|wheel size]] of the model.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setVehicleWheelScale ( vehicle theVehicle, float wheelScale )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:setWheelScale|wheelScale|getVehicleWheelScale}}<br />
<br />
===Required Arguments===<br />
*'''theVehicle''': The [[vehicle]] whose wheel scale you wish to modify.<br />
*'''wheelScale''': The wheel scale value to set.<br />
<br />
===Returns===<br />
Returns ''true'' if the wheel scale has been set successfully, or an error if some parameter is invalid.<br />
<br />
==Example==<br />
[[File:Wheel scale example preview.png|thumb|Preview of the results of invoking the ''shrinkwheels'' command]]<br />
This example adds a ''shrinkwheels'' command that reduces the wheel scale of a vehicle in half each time it is invoked.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("shrinkwheels", function()<br />
local veh = getPedOccupiedVehicle(localPlayer)<br />
if veh then<br />
local newScale = getVehicleWheelScale(veh) * 0.5<br />
setVehicleWheelScale(veh, newScale)<br />
outputChatBox("Vehicle wheel scale set to " .. newScale .. ".", 0, 255, 0)<br />
else<br />
outputChatBox("You must be in a vehicle to use this command.", 255, 0, 0)<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=GetVehicleWheelScale&diff=67377
GetVehicleWheelScale
2020-09-03T23:43:35Z
<p>AlexTMjugador: Document function introduced in r20642</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0158|1.5.7|20642|This function gets the scale of all the wheels of a [[vehicle]].}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
float getVehicleWheelScale ( vehicle theVehicle )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:getWheelScale|wheelScale|setVehicleWheelScale}}<br />
<br />
===Required Arguments=== <br />
*'''theVehicle''': The [[vehicle]] to get its wheel scale of.<br />
<br />
===Returns===<br />
Returns the wheel scale of the specified vehicle as a decimal number, or an error if the vehicle is invalid. For more information about the returned number, see [[setVehicleWheelScale]].<br />
<br />
==Example==<br />
[[File:Wheel scale example preview.png|thumb|Preview of the results of invoking the ''shrinkwheels'' command]]<br />
This example adds a ''shrinkwheels'' command that reduces the wheel scale of a vehicle in half each time it is invoked.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("shrinkwheels", function()<br />
local veh = getPedOccupiedVehicle(localPlayer)<br />
if veh then<br />
local newScale = getVehicleWheelScale(veh) * 0.5<br />
setVehicleWheelScale(veh, newScale)<br />
outputChatBox("Vehicle wheel scale set to " .. newScale .. ".", 0, 255, 0)<br />
else<br />
outputChatBox("You must be in a vehicle to use this command.", 255, 0, 0)<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=SetVehicleWheelScale&diff=67376
SetVehicleWheelScale
2020-09-03T23:42:08Z
<p>AlexTMjugador: Document function introduced in r20642</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0158|1.5.7|20642|This function sets the scale of all the wheels of a [[vehicle]]. The wheel scale multiplies the visible height and length (but not width) of all the wheels in a vehicle, without affecting their collisions or the handling, similarly to [[setVehicleComponentScale]]. The wheel scale is applied after the [[setVehicleModelWheelSize|model wheel size]].}}<br />
{{Note|Installing or removing a wheel upgrade in a vehicle resets the wheel scale to the default value.}}<br />
{{Tip|The default value for vehicles without wheel upgrades is 1, which renders the wheels in the model as usual. On the other hand, the default value for vehicles with a wheel upgrade depends on the [[setVehicleModelWheelSize|wheel size]] of the model.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setVehicleWheelScale ( vehicle theVehicle, float wheelScale )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:setWheelScale|wheelScale|[[getVehicleWheelScale]]}}<br />
<br />
===Required Arguments===<br />
*'''theVehicle''': The [[vehicle]] whose wheel scale you wish to modify.<br />
*'''wheelScale''': The wheel scale value to set.<br />
<br />
===Returns===<br />
Returns ''true'' if the wheel scale has been set successfully, or an error if some parameter is invalid.<br />
<br />
==Example==<br />
[[File:Wheel scale example preview.png|thumb|Preview of the results of invoking the ''shrinkwheels'' command]]<br />
This example adds a ''shrinkwheels'' command that reduces the wheel scale of a vehicle in half each time it is invoked.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("shrinkwheels", function()<br />
local veh = getPedOccupiedVehicle(localPlayer)<br />
if veh then<br />
local newScale = getVehicleWheelScale(veh) * 0.5<br />
setVehicleWheelScale(veh, newScale)<br />
outputChatBox("Vehicle wheel scale set to " .. newScale .. ".", 0, 255, 0)<br />
else<br />
outputChatBox("You must be in a vehicle to use this command.", 255, 0, 0)<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=File:Wheel_size_example_preview.png&diff=67375
File:Wheel size example preview.png
2020-09-03T23:40:09Z
<p>AlexTMjugador: </p>
<hr />
<div></div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=File:Wheel_scale_example_preview.png&diff=67374
File:Wheel scale example preview.png
2020-09-03T23:39:59Z
<p>AlexTMjugador: </p>
<hr />
<div></div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&diff=66724
Server mtaserver.conf
2020-06-01T13:14:14Z
<p>AlexTMjugador: Improved precision of /* serverip */ description even more</p>
<hr />
<div>This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.<br />
<br />
<br />
====servername====<br />
:''<servername>Default MTA Server</servername>''<br />
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter. <br />
<br />
====owner_email_address====<br />
:''<owner_email_address></owner_email_address>''<br />
:This parameter specifies the contact email addresses for the owner(s) of this server. <br />
:The email addresses will not be publicly available, and only used by MTA administrators to contact the server owner. <br />
:Note: Missing or incorrect owner_email_address can affect visibility in the master server list. <br />
:Values: Comma separated list of email addresses<br />
<br />
====serverip====<br />
:''<serverip>auto</serverip><br />
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - it is generally only needed for complex network topologies and should be left at the default value otherwise.<br />
: This parameter specifies the public IP address that the server will announce to the MTA servers, for the purposes of registering itself in the master server list and receiving some internal status updates. Usually, setting this parameter is only useful for some specialized scenarios, like servers that can be reached by multiple public addresses, or when a firewall is used for controlling incoming connections. If set to auto, the public IP address the requests originate from will be used as the server IP for communicating with MTA servers, which works fine in most cases.<br />
:Values: auto or x.x.x.x ; default value: auto<br />
:SERVERIP SHOULD BE LEFT SET TO auto UNLESS YOU ARE SURE OF WHAT YOU ARE DOING<br />
:WARNING: SETTING serverip AND THEN ASKING FOR SUPPORT CAN CAUSE DEATH OR INJURY<br />
<br />
====serverport====<br />
:''<serverport>22003</serverport> <br />
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;<br />
:default value: 22003. It is a required parameter.<br />
<br />
====maxplayers====<br />
:''<maxplayers>32</maxplayers><br />
:This parameter specifies the number of maximum player slots available on the server;<br />
:default value: 32. It is a required parameter.<br />
<br />
====httpserver====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<httpserver>1</httpserver><br />
:This parameter specifies whether the built-in http server will be used.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.<br />
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]<br />
<br />
====httpport====<br />
:''<httpport>22005</httpport><br />
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as <serverport>. It is a required parameter if <httpserver> is set to 1.<br />
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]<br />
<br />
====httpdownloadurl====<br />
:''<httpdownloadurl></httpdownloadurl><br />
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.<br />
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]<br />
<br />
====httpmaxconnectionsperclient====<br />
:''<httpmaxconnectionsperclient>5</httpmaxconnectionsperclient><br />
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.<br />
:Available range: 1 to 8.<br />
<br />
====httpdosthreshold====<br />
:''<httpdosthreshold>20</httpdosthreshold><br />
:This parameter limits the number http connections that an IP can initiate over a short period of time.<br />
:Available range: 1 to 100. default value: 20<br />
<br />
====http_dos_exclude====<br />
:''<http_dos_exclude></http_dos_exclude><br />
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.<br />
:e.g. 88.11.22.33,101.2.3.4<br />
<br />
====allow_gta3_img_mods====<br />
:''<allow_gta3_img_mods>none</allow_gta3_img_mods><br />
:By default, the server will block the use of locally customized gta3.img player skins<br />
:This setting can be used to allow such mods. Not recommended for competitive servers.<br />
:Values: none, peds ; default value: none<br />
<br />
====client_file====<br />
:''<nowiki><!-- <client_file name="data/carmods.dat" verify="0" /> --></nowiki><br />
:By default, the server will block the use of customized GTA:SA data files.<br />
:To allow specific client files, add one or more of the above lines.<br />
:More information: [[Anti-cheat_guide#.3Cclient_file_name.3D.22data.2Fcarmods.dat.22_verify.3D.220.22.2F.3E|Anti-cheat guide]]<br />
<br />
====disableac====<br />
:''<disableac></disableac><br />
:Comma separated list of disabled anti-cheats.<br />
:e.g. To disable anti-cheat #2 and #3, use: 2,3<br />
:More information: [[Anti-cheat_guide#.3Cdisableac.3E.3C.2Fdisableac.3E|Anti-cheat guide]]<br />
<br />
====enablesd====<br />
:''<enablesd>31,32</enablesd><br />
:Comma separated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. <br />
:Competitive servers may wish to enable certain special detections, but most servers should leave this setting on its default.<br />
:Values: special detection (SD) codes ; default value: 31,32 (e.g. enables special detections #31 and #32)<br />
:More information: [[Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E|Anti-cheat guide]]<br />
<br />
====minclientversion====<br />
:''<minclientversion></minclientversion><br />
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.1.0-9.03100.0<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''<br />
<br />
====minclientversion_auto_update====<br />
:''<minclientversion_auto_update>1</minclientversion_auto_update><br />
:This parameter specifies if/when the <minclientversion> setting is automatically updated.<br />
:Keeping <minclientversion> updated can help reduce cheating.<br />
:Note: The instant setting (2) is only recommended for competitive servers.<br />
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.<br />
<br />
====recommendedclientversion====<br />
:''<recommendedclientversion></recommendedclientversion><br />
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''<br />
<br />
====ase====<br />
:''<ase>1</ase><br />
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the in-game server browser. An additional UDP port needs to be available for this to work (value from <serverport> + 123 , so on a default <serverport> value 22003 the right port will be 22126 ).<br />
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.<br />
<br />
====donotbroadcastlan====<br />
:''<donotbroadcastlan>0</donotbroadcastlan><br />
:This parameter allows you to disable LAN broadcasting. <br />
<br />
====password====<br />
:''<password></password> <br />
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.<br />
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]<br />
<br />
====bandwidth_reduction====<br />
:''<bandwidth_reduction>medium</bandwidth_reduction> <br />
:This parameter reduces the server's bandwidth usage by using various optimizations.<br />
:Values: none, medium or maximum ; default value: medium<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====unoccupied_vehicle_syncer_distance====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<unoccupied_vehicle_syncer_distance>130</unoccupied_vehicle_syncer_distance><br />
:This parameter determines the distance limit for remote synced unoccupied vehicles<br />
:Available range: 50 - 400; default value: 130<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====ped_syncer_distance====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<ped_syncer_distance>100</ped_syncer_distance><br />
:This parameter determines the distance limit for remote synced peds<br />
:Available range: 50 - 400; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====player_sync_interval====<br />
:''<player_sync_interval>100</player_sync_interval> <br />
:This parameter determines the time in milliseconds between player sync packets.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====lightweight_sync_interval====<br />
:''<lightweight_sync_interval>1500</lightweight_sync_interval> <br />
:This parameter determines the time in milliseconds between lightweight (player) sync packets.<br />
:Available range: 200 - 4000; default value: 1500<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====camera_sync_interval====<br />
:''<camera_sync_interval>500</camera_sync_interval> <br />
:This parameter determines the time in milliseconds between camera sync packets.<br />
:Available range: 200 - 400; default value: 500<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====ped_sync_interval====<br />
:''<ped_sync_interval>400</ped_sync_interval> <br />
:This parameter determines the time in milliseconds between ped sync packets.<br />
:Available range: 200 - 4000; default value: 400<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====unoccupied_vehicle_sync_interval====<br />
:''<unoccupied_vehicle_sync_interval>1000</unoccupied_vehicle_sync_interval> <br />
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.<br />
:Available range: 200 - 4000; default value: 1000<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====keysync_mouse_sync_interval====<br />
:''<keysync_mouse_sync_interval>100</keysync_mouse_sync_interval> <br />
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====keysync_analog_sync_interval====<br />
:''<keysync_analog_sync_interval>100</keysync_analog_sync_interval> <br />
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====bullet_sync====<br />
:''<bullet_sync>1</bullet_sync> <br />
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.<br />
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====vehext_percent====<br />
:''<vehext_percent>0</vehext_percent><br />
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. <br />
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.<br />
:Depending on the gamemode, an incorrect prediction may have a negative effect. <br />
:Therefore this setting should be considered experimental.<br />
:Available range: 0 to 100. Default - 0<br />
<br />
====vehext_ping_limit====<br />
:''<vehext_ping_limit>150</vehext_ping_limit><br />
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.<br />
:Only relevant if <vehext_percent> is greater than zero.<br />
:Available range: 50 to 500. Default - 150<br />
<br />
====latency_reduction====<br />
:''<latency_reduction>0</latency_reduction><br />
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).<br />
:Due to the impact this may have on shot lag compensation, it should be considered experimental.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 0.<br />
:Bugs caused by enabling latency_reduction: http://bugs.mtasa.com/view.php?id=8191 + http://bugs.mtasa.com/view.php?id=8226<br />
<br />
====threadnet====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<threadnet>1</threadnet><br />
:This parameter specifies whether or not to run the network synchronization on another thread.<br />
:Enabling will make the sync smoother, but may increase CPU usage slightly.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====idfile====<br />
:''<idfile>server-id.keys</idfile> <br />
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. <br />
:Keep a backup of this file in a safe place. Default value: server-id.keys<br />
:More information about client private files: [[Filepath]]<br />
<br />
====logfile====<br />
:''<logfile>logs/server.log</logfile><br />
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.<br />
<br />
====authfile====<br />
:''<authfile>logs/server_auth.log</authfile><br />
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used<br />
<br />
====dbfile====<br />
:''<dbfile>logs/db.log</dbfile><br />
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.<br />
<br />
====loadstringfile====<br />
:''<nowiki><!-- <loadstringfile>logs/loadstring.log</loadstringfile> --></nowiki><br />
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.<br />
<br />
====acl====<br />
:''<acl>acl.xml</acl> <br />
:This parameter specifies the location and name of the Access Control List settings file. If left<br />
:blank, server will use acl.xml file, located in the same folder as this configuration file.<br />
<br />
====scriptdebuglogfile====<br />
:''<scriptdebuglogfile>logs/scripts.log</scriptdebuglogfile> <br />
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.<br />
<br />
====scriptdebugloglevel====<br />
:''<scriptdebugloglevel>0</scriptdebugloglevel><br />
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.<br />
<br />
====htmldebuglevel====<br />
:''<htmldebuglevel>0</htmldebuglevel><br />
:Specifies the level of the html debug. Available values: 0, 1, 2, 3. When not set, defaults to 0.<br />
<br />
====filter_duplicate_log_lines====<br />
:''<filter_duplicate_log_lines>1</filter_duplicate_log_lines><br />
:Specifies whether or not duplicate log lines should be filtered. Available values: 0 or 1, defaults to 1.<br />
<br />
====fpslimit====<br />
:''<fpslimit>36</fpslimit><br />
:Specifies the frame rate limit that will be applied to connecting clients.<br />
:Available range: 25 to 100. Default: 36.<br />
:When running the map editor locally (i.e. from the client), the default FPS limit is 50.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====voice====<br />
:''<voice>0</voice><br />
:This parameter specifies whether or not to enable player voice chat in-game<br />
:Values: 0 - disabled , 1 - enabled<br />
<br />
====voice_samplerate====<br />
:''<voice_samplerate>1</voice_samplerate><br />
:This parameter specifies the sample rate for voice chat. 'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat<br />
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz). Default - 1<br />
<br />
====voice_quality====<br />
:''<voice_quality>4</voice_quality><br />
:This parameter specifies the voice quality for voice chat. 'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat<br />
:Available range: 0 to 10. Default - 4<br />
<br />
====voice_bitrate====<br />
:''<nowiki><!-- <voice_bitrate>24600</voice_bitrate> --></nowiki><br />
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically. Use with care.<br />
<br />
====backup_path====<br />
:''<backup_path>backups</backup_path><br />
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups<br />
<br />
====backup_interval====<br />
:''<backup_interval>3</backup_interval><br />
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups<br />
:Available range: 0 to 30. Default - 3<br />
<br />
====backup_copies====<br />
:''<backup_copies>10</backup_copies><br />
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups<br />
:Available range: 0 to 100. Default - 10<br />
<br />
====compact_internal_databases====<br />
:''<compact_internal_databases>1</compact_internal_databases><br />
:This parameter specifies when the internal sqlite databases should be defragmented.<br />
:For more info see: http://www.sqlite.org/lang_vacuum.html<br />
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always. Default - 1<br />
<br />
====crash_dump_upload====<br />
:''<crash_dump_upload>1</crash_dump_upload><br />
:This parameter specifies whether server crash dump files should be sent to MTA HQ.<br />
:Values: 0 - Off, 1 - On. Default - 1<br />
<br />
====fakelag====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<fakelag>0</fakelag><br />
:This parameter specifies whether the [[Command fakelag|fakelag and sfakelag]] commands are enabled<br />
:Values: 0 - Off, 1 - On. Default - 0<br />
<br />
====auth_serial_groups====<br />
:''<auth_serial_groups>Admin</auth_serial_groups><br />
:This parameter lists the ACL groups that are protected by serial authorization.<br />
:Login attempts to a protected account from a second serial are blocked until the serial is manually authorized via the authserial command.<br />
:For more info see: https://mtasa.com/authserial<br />
:Note: This is security critical feature and disabling auth_serial_groups can affect visibility in the master server list.<br />
:Values: Comma separated list of ACL groups. Default - Admin<br />
<br />
====auth_serial_http====<br />
:''<auth_serial_http>1</auth_serial_http><br />
:This parameter specifies if the authorized serial login checks should also apply to the http interface.<br />
:Protected account login attempts to the http interface will only succeed if the IP address matches one recently used by the account holder in-game.<br />
:For more info see: https://mtasa.com/authserialhttp<br />
:Note: This is security critical feature and disabling auth_serial_http can affect visibility in the master server list.<br />
:Values: 0 - Off, 1 - Enabled. Default - 1<br />
<br />
====auth_serial_http_ip_exceptions====<br />
:''<auth_serial_http_ip_exceptions>127.0.0.1</auth_serial_http_ip_exceptions><br />
:This parameter specifies which IP addresses should always pass auth_serial_http checks.<br />
:Values: Comma separated list of IP addresses<br />
<br />
====database_credentials_protection====<br />
:''<database_credentials_protection>1</database_credentials_protection><br />
:This parameter specifies if extra security measures are applied to resources which use [[dbConnect]] with MySQL.<br />
:The extra measures are:<br />
: - script files cannot be accessed with [[fileOpen]]<br />
: - [[meta.xml]] is read-only<br />
:'''NOTE:''' This only protects resources which use [[dbConnect]] with MySQL.<br />
:Values: 0 - Off, 1 - Enabled. Default - 1<br />
<br />
====module====<br />
:''<nowiki><!-- <module src="sample_win32.dll" /> --></nowiki><br />
:''<nowiki><!-- <module src="sample_linux.so" /> --></nowiki><br />
:Specifies the module(s) which are loaded with the server. To load several modules, add more <module> parameter(s). Optional parameter.<br />
<br />
====resource====<br />
:''<resource src="admin" startup="1" protected="0" /><br />
:''<resource src="defaultstats" startup="1" protected="0" /><br />
:''<resource src="helpmanager" startup="1" protected="0" /><br />
:''<resource src="joinquit" startup="1" protected="0" /><br />
:''<resource src="mapcycler" startup="1" protected="0" /><br />
:''<resource src="mapmanager" startup="1" protected="0" /><br />
:''<resource src="parachute" startup="1" protected="0" /><br />
:''<resource src="resourcebrowser" startup="1" protected="1" default="true" /><br />
:''<resource src="resourcemanager" startup="1" protected="1" /><br />
:''<resource src="scoreboard" startup="1" protected="0" /><br />
:''<resource src="spawnmanager" startup="1" protected="0" /><br />
:''<resource src="voice" startup="1" protected="0" /><br />
:''<resource src="votemanager" startup="1" protected="0" /><br />
:''<resource src="webadmin" startup="1" protected="0" /><br />
:''<resource src="play" startup="1" protected="0" /><br />
<br />
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more <resource> parameters.<br />
<br />
:In addition, there are several flags which control how the server deals with each resource:<br />
<br />
:* '''src''': the resource name. This is the only mandatory flag.<br />
:* '''startup''': controls whether the resource will be started with the server or not. If "1", "true" or "yes", the resource will be started. If not specified, defaults to not starting the resource.<br />
:* '''protected''': if "1", "true" or "yes", the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.<br />
:* '''default''': if given a "1", "true" or "yes" value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.<br />
<br />
==Deprecated settings==<br />
<br />
The following settings have been deprecated in the production version of MTA:SA and no longer work.<br />
<br />
====networkencryption====<br />
<!-- no longer present in mtaserver.conf - also seems to be deprecated in code --><br />
:''<networkencryption>1</networkencryption><br />
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====autologin====<br />
<!-- removed from MTA:SA at https://github.com/multitheftauto/mtasa-blue/commit/e392c417da03b295c7f8342a7f6c1467d094db12#diff-b828bcbfff7135920f9a1179be3e3617 --><br />
:''<autologin>0</autologin><br />
:Specifies whether or not players should automatically be logged in based on their IP adresses.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 0.<br />
<br />
[[Category: Support]]<br />
[[ru:Server mtaserver.conf]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&diff=66723
Server mtaserver.conf
2020-06-01T12:34:37Z
<p>AlexTMjugador: Tried to explain more precisely what /* serverip */ actually does, apart from scaring people away from touching it - please correct if wrong</p>
<hr />
<div>This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.<br />
<br />
<br />
====servername====<br />
:''<servername>Default MTA Server</servername>''<br />
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter. <br />
<br />
====owner_email_address====<br />
:''<owner_email_address></owner_email_address>''<br />
:This parameter specifies the contact email addresses for the owner(s) of this server. <br />
:The email addresses will not be publicly available, and only used by MTA administrators to contact the server owner. <br />
:Note: Missing or incorrect owner_email_address can affect visibility in the master server list. <br />
:Values: Comma separated list of email addresses<br />
<br />
====serverip====<br />
:''<serverip>auto</serverip><br />
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - it is generally only needed for complex network topologies and should be left at the default value otherwise.<br />
: This parameter specifies the public IP address that the server will advertise for registering itself in the MTA master server list. Setting this parameter is only useful for servers that can be reached by multiple public addresses. If set to auto, the public IP address the request originates on will be used as the server IP for the master server list.<br />
:Values: auto or x.x.x.x ; default value: auto<br />
:SERVERIP SHOULD BE LEFT SET TO auto UNLESS YOU ARE SURE OF WHAT YOU ARE DOING<br />
:WARNING: SETTING serverip AND THEN ASKING FOR SUPPORT CAN CAUSE DEATH OR INJURY<br />
<br />
====serverport====<br />
:''<serverport>22003</serverport> <br />
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;<br />
:default value: 22003. It is a required parameter.<br />
<br />
====maxplayers====<br />
:''<maxplayers>32</maxplayers><br />
:This parameter specifies the number of maximum player slots available on the server;<br />
:default value: 32. It is a required parameter.<br />
<br />
====httpserver====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<httpserver>1</httpserver><br />
:This parameter specifies whether the built-in http server will be used.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.<br />
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]<br />
<br />
====httpport====<br />
:''<httpport>22005</httpport><br />
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as <serverport>. It is a required parameter if <httpserver> is set to 1.<br />
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]<br />
<br />
====httpdownloadurl====<br />
:''<httpdownloadurl></httpdownloadurl><br />
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.<br />
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]<br />
<br />
====httpmaxconnectionsperclient====<br />
:''<httpmaxconnectionsperclient>5</httpmaxconnectionsperclient><br />
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.<br />
:Available range: 1 to 8.<br />
<br />
====httpdosthreshold====<br />
:''<httpdosthreshold>20</httpdosthreshold><br />
:This parameter limits the number http connections that an IP can initiate over a short period of time.<br />
:Available range: 1 to 100. default value: 20<br />
<br />
====http_dos_exclude====<br />
:''<http_dos_exclude></http_dos_exclude><br />
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.<br />
:e.g. 88.11.22.33,101.2.3.4<br />
<br />
====allow_gta3_img_mods====<br />
:''<allow_gta3_img_mods>none</allow_gta3_img_mods><br />
:By default, the server will block the use of locally customized gta3.img player skins<br />
:This setting can be used to allow such mods. Not recommended for competitive servers.<br />
:Values: none, peds ; default value: none<br />
<br />
====client_file====<br />
:''<nowiki><!-- <client_file name="data/carmods.dat" verify="0" /> --></nowiki><br />
:By default, the server will block the use of customized GTA:SA data files.<br />
:To allow specific client files, add one or more of the above lines.<br />
:More information: [[Anti-cheat_guide#.3Cclient_file_name.3D.22data.2Fcarmods.dat.22_verify.3D.220.22.2F.3E|Anti-cheat guide]]<br />
<br />
====disableac====<br />
:''<disableac></disableac><br />
:Comma separated list of disabled anti-cheats.<br />
:e.g. To disable anti-cheat #2 and #3, use: 2,3<br />
:More information: [[Anti-cheat_guide#.3Cdisableac.3E.3C.2Fdisableac.3E|Anti-cheat guide]]<br />
<br />
====enablesd====<br />
:''<enablesd>31,32</enablesd><br />
:Comma separated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. <br />
:Competitive servers may wish to enable certain special detections, but most servers should leave this setting on its default.<br />
:Values: special detection (SD) codes ; default value: 31,32 (e.g. enables special detections #31 and #32)<br />
:More information: [[Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E|Anti-cheat guide]]<br />
<br />
====minclientversion====<br />
:''<minclientversion></minclientversion><br />
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.1.0-9.03100.0<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''<br />
<br />
====minclientversion_auto_update====<br />
:''<minclientversion_auto_update>1</minclientversion_auto_update><br />
:This parameter specifies if/when the <minclientversion> setting is automatically updated.<br />
:Keeping <minclientversion> updated can help reduce cheating.<br />
:Note: The instant setting (2) is only recommended for competitive servers.<br />
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.<br />
<br />
====recommendedclientversion====<br />
:''<recommendedclientversion></recommendedclientversion><br />
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''<br />
<br />
====ase====<br />
:''<ase>1</ase><br />
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the in-game server browser. An additional UDP port needs to be available for this to work (value from <serverport> + 123 , so on a default <serverport> value 22003 the right port will be 22126 ).<br />
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.<br />
<br />
====donotbroadcastlan====<br />
:''<donotbroadcastlan>0</donotbroadcastlan><br />
:This parameter allows you to disable LAN broadcasting. <br />
<br />
====password====<br />
:''<password></password> <br />
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.<br />
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]<br />
<br />
====bandwidth_reduction====<br />
:''<bandwidth_reduction>medium</bandwidth_reduction> <br />
:This parameter reduces the server's bandwidth usage by using various optimizations.<br />
:Values: none, medium or maximum ; default value: medium<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====unoccupied_vehicle_syncer_distance====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<unoccupied_vehicle_syncer_distance>130</unoccupied_vehicle_syncer_distance><br />
:This parameter determines the distance limit for remote synced unoccupied vehicles<br />
:Available range: 50 - 400; default value: 130<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====ped_syncer_distance====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<ped_syncer_distance>100</ped_syncer_distance><br />
:This parameter determines the distance limit for remote synced peds<br />
:Available range: 50 - 400; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====player_sync_interval====<br />
:''<player_sync_interval>100</player_sync_interval> <br />
:This parameter determines the time in milliseconds between player sync packets.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====lightweight_sync_interval====<br />
:''<lightweight_sync_interval>1500</lightweight_sync_interval> <br />
:This parameter determines the time in milliseconds between lightweight (player) sync packets.<br />
:Available range: 200 - 4000; default value: 1500<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====camera_sync_interval====<br />
:''<camera_sync_interval>500</camera_sync_interval> <br />
:This parameter determines the time in milliseconds between camera sync packets.<br />
:Available range: 200 - 400; default value: 500<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====ped_sync_interval====<br />
:''<ped_sync_interval>400</ped_sync_interval> <br />
:This parameter determines the time in milliseconds between ped sync packets.<br />
:Available range: 200 - 4000; default value: 400<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====unoccupied_vehicle_sync_interval====<br />
:''<unoccupied_vehicle_sync_interval>1000</unoccupied_vehicle_sync_interval> <br />
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.<br />
:Available range: 200 - 4000; default value: 1000<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====keysync_mouse_sync_interval====<br />
:''<keysync_mouse_sync_interval>100</keysync_mouse_sync_interval> <br />
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====keysync_analog_sync_interval====<br />
:''<keysync_analog_sync_interval>100</keysync_analog_sync_interval> <br />
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====bullet_sync====<br />
:''<bullet_sync>1</bullet_sync> <br />
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.<br />
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====vehext_percent====<br />
:''<vehext_percent>0</vehext_percent><br />
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. <br />
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.<br />
:Depending on the gamemode, an incorrect prediction may have a negative effect. <br />
:Therefore this setting should be considered experimental.<br />
:Available range: 0 to 100. Default - 0<br />
<br />
====vehext_ping_limit====<br />
:''<vehext_ping_limit>150</vehext_ping_limit><br />
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.<br />
:Only relevant if <vehext_percent> is greater than zero.<br />
:Available range: 50 to 500. Default - 150<br />
<br />
====latency_reduction====<br />
:''<latency_reduction>0</latency_reduction><br />
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).<br />
:Due to the impact this may have on shot lag compensation, it should be considered experimental.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 0.<br />
:Bugs caused by enabling latency_reduction: http://bugs.mtasa.com/view.php?id=8191 + http://bugs.mtasa.com/view.php?id=8226<br />
<br />
====threadnet====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<threadnet>1</threadnet><br />
:This parameter specifies whether or not to run the network synchronization on another thread.<br />
:Enabling will make the sync smoother, but may increase CPU usage slightly.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====idfile====<br />
:''<idfile>server-id.keys</idfile> <br />
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. <br />
:Keep a backup of this file in a safe place. Default value: server-id.keys<br />
:More information about client private files: [[Filepath]]<br />
<br />
====logfile====<br />
:''<logfile>logs/server.log</logfile><br />
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.<br />
<br />
====authfile====<br />
:''<authfile>logs/server_auth.log</authfile><br />
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used<br />
<br />
====dbfile====<br />
:''<dbfile>logs/db.log</dbfile><br />
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.<br />
<br />
====loadstringfile====<br />
:''<nowiki><!-- <loadstringfile>logs/loadstring.log</loadstringfile> --></nowiki><br />
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.<br />
<br />
====acl====<br />
:''<acl>acl.xml</acl> <br />
:This parameter specifies the location and name of the Access Control List settings file. If left<br />
:blank, server will use acl.xml file, located in the same folder as this configuration file.<br />
<br />
====scriptdebuglogfile====<br />
:''<scriptdebuglogfile>logs/scripts.log</scriptdebuglogfile> <br />
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.<br />
<br />
====scriptdebugloglevel====<br />
:''<scriptdebugloglevel>0</scriptdebugloglevel><br />
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.<br />
<br />
====htmldebuglevel====<br />
:''<htmldebuglevel>0</htmldebuglevel><br />
:Specifies the level of the html debug. Available values: 0, 1, 2, 3. When not set, defaults to 0.<br />
<br />
====filter_duplicate_log_lines====<br />
:''<filter_duplicate_log_lines>1</filter_duplicate_log_lines><br />
:Specifies whether or not duplicate log lines should be filtered. Available values: 0 or 1, defaults to 1.<br />
<br />
====fpslimit====<br />
:''<fpslimit>36</fpslimit><br />
:Specifies the frame rate limit that will be applied to connecting clients.<br />
:Available range: 25 to 100. Default: 36.<br />
:When running the map editor locally (i.e. from the client), the default FPS limit is 50.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====voice====<br />
:''<voice>0</voice><br />
:This parameter specifies whether or not to enable player voice chat in-game<br />
:Values: 0 - disabled , 1 - enabled<br />
<br />
====voice_samplerate====<br />
:''<voice_samplerate>1</voice_samplerate><br />
:This parameter specifies the sample rate for voice chat. 'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat<br />
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz). Default - 1<br />
<br />
====voice_quality====<br />
:''<voice_quality>4</voice_quality><br />
:This parameter specifies the voice quality for voice chat. 'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat<br />
:Available range: 0 to 10. Default - 4<br />
<br />
====voice_bitrate====<br />
:''<nowiki><!-- <voice_bitrate>24600</voice_bitrate> --></nowiki><br />
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically. Use with care.<br />
<br />
====backup_path====<br />
:''<backup_path>backups</backup_path><br />
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups<br />
<br />
====backup_interval====<br />
:''<backup_interval>3</backup_interval><br />
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups<br />
:Available range: 0 to 30. Default - 3<br />
<br />
====backup_copies====<br />
:''<backup_copies>10</backup_copies><br />
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups<br />
:Available range: 0 to 100. Default - 10<br />
<br />
====compact_internal_databases====<br />
:''<compact_internal_databases>1</compact_internal_databases><br />
:This parameter specifies when the internal sqlite databases should be defragmented.<br />
:For more info see: http://www.sqlite.org/lang_vacuum.html<br />
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always. Default - 1<br />
<br />
====crash_dump_upload====<br />
:''<crash_dump_upload>1</crash_dump_upload><br />
:This parameter specifies whether server crash dump files should be sent to MTA HQ.<br />
:Values: 0 - Off, 1 - On. Default - 1<br />
<br />
====fakelag====<br />
<!-- no longer present in mtaserver.conf --><br />
:''<fakelag>0</fakelag><br />
:This parameter specifies whether the [[Command fakelag|fakelag and sfakelag]] commands are enabled<br />
:Values: 0 - Off, 1 - On. Default - 0<br />
<br />
====auth_serial_groups====<br />
:''<auth_serial_groups>Admin</auth_serial_groups><br />
:This parameter lists the ACL groups that are protected by serial authorization.<br />
:Login attempts to a protected account from a second serial are blocked until the serial is manually authorized via the authserial command.<br />
:For more info see: https://mtasa.com/authserial<br />
:Note: This is security critical feature and disabling auth_serial_groups can affect visibility in the master server list.<br />
:Values: Comma separated list of ACL groups. Default - Admin<br />
<br />
====auth_serial_http====<br />
:''<auth_serial_http>1</auth_serial_http><br />
:This parameter specifies if the authorized serial login checks should also apply to the http interface.<br />
:Protected account login attempts to the http interface will only succeed if the IP address matches one recently used by the account holder in-game.<br />
:For more info see: https://mtasa.com/authserialhttp<br />
:Note: This is security critical feature and disabling auth_serial_http can affect visibility in the master server list.<br />
:Values: 0 - Off, 1 - Enabled. Default - 1<br />
<br />
====auth_serial_http_ip_exceptions====<br />
:''<auth_serial_http_ip_exceptions>127.0.0.1</auth_serial_http_ip_exceptions><br />
:This parameter specifies which IP addresses should always pass auth_serial_http checks.<br />
:Values: Comma separated list of IP addresses<br />
<br />
====database_credentials_protection====<br />
:''<database_credentials_protection>1</database_credentials_protection><br />
:This parameter specifies if extra security measures are applied to resources which use [[dbConnect]] with MySQL.<br />
:The extra measures are:<br />
: - script files cannot be accessed with [[fileOpen]]<br />
: - [[meta.xml]] is read-only<br />
:'''NOTE:''' This only protects resources which use [[dbConnect]] with MySQL.<br />
:Values: 0 - Off, 1 - Enabled. Default - 1<br />
<br />
====module====<br />
:''<nowiki><!-- <module src="sample_win32.dll" /> --></nowiki><br />
:''<nowiki><!-- <module src="sample_linux.so" /> --></nowiki><br />
:Specifies the module(s) which are loaded with the server. To load several modules, add more <module> parameter(s). Optional parameter.<br />
<br />
====resource====<br />
:''<resource src="admin" startup="1" protected="0" /><br />
:''<resource src="defaultstats" startup="1" protected="0" /><br />
:''<resource src="helpmanager" startup="1" protected="0" /><br />
:''<resource src="joinquit" startup="1" protected="0" /><br />
:''<resource src="mapcycler" startup="1" protected="0" /><br />
:''<resource src="mapmanager" startup="1" protected="0" /><br />
:''<resource src="parachute" startup="1" protected="0" /><br />
:''<resource src="resourcebrowser" startup="1" protected="1" default="true" /><br />
:''<resource src="resourcemanager" startup="1" protected="1" /><br />
:''<resource src="scoreboard" startup="1" protected="0" /><br />
:''<resource src="spawnmanager" startup="1" protected="0" /><br />
:''<resource src="voice" startup="1" protected="0" /><br />
:''<resource src="votemanager" startup="1" protected="0" /><br />
:''<resource src="webadmin" startup="1" protected="0" /><br />
:''<resource src="play" startup="1" protected="0" /><br />
<br />
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more <resource> parameters.<br />
<br />
:In addition, there are several flags which control how the server deals with each resource:<br />
<br />
:* '''src''': the resource name. This is the only mandatory flag.<br />
:* '''startup''': controls whether the resource will be started with the server or not. If "1", "true" or "yes", the resource will be started. If not specified, defaults to not starting the resource.<br />
:* '''protected''': if "1", "true" or "yes", the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.<br />
:* '''default''': if given a "1", "true" or "yes" value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.<br />
<br />
==Deprecated settings==<br />
<br />
The following settings have been deprecated in the production version of MTA:SA and no longer work.<br />
<br />
====networkencryption====<br />
<!-- no longer present in mtaserver.conf - also seems to be deprecated in code --><br />
:''<networkencryption>1</networkencryption><br />
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====autologin====<br />
<!-- removed from MTA:SA at https://github.com/multitheftauto/mtasa-blue/commit/e392c417da03b295c7f8342a7f6c1467d094db12#diff-b828bcbfff7135920f9a1179be3e3617 --><br />
:''<autologin>0</autologin><br />
:Specifies whether or not players should automatically be logged in based on their IP adresses.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 0.<br />
<br />
[[Category: Support]]<br />
[[ru:Server mtaserver.conf]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=SetPedStat&diff=52591
SetPedStat
2017-10-13T16:54:39Z
<p>AlexTMjugador: 150 health doesn't have a special activation flag, actually. It's achieved by raising stat 24</p>
<hr />
<div>{{Server client function}}<br />
{{Needs_Checking|<br />
*Things like infinite run, fire proof CJ, 150 armor have special activation flags. They need a way to be triggered on/off.<br />
}}<br />
<br />
__NOTOC__<br />
This function allows you to set the value of a specific statistic for a [[ped]]. '''Visual stats (FAT and BODY_MUSCLE) can only be used on the CJ skin''', they have no effect on other skins.<br />
<br />
When this function is used client side, it can only be used on client side created peds.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setPedStat ( ped thePed, int stat, float value )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''thePed''': the [[ped]] whose statistic you want to modify.<br />
*'''stat''': the stat ID. <br />
{{Stats}}<br />
<br />
*'''value''': the new value of the stat. It must be between 0 and 1000.<br />
<br />
===Returns===<br />
Returns ''true'' if the statistic was changed succesfully. Returns ''false'' if an invalid player is specified, if the stat-id/value is out of acceptable range or if the FAT or BODY_MUSCLE stats are used on non-CJ players.<br />
<br />
==Examples==<br />
This example allows a player to type the command 'beefcake' to change his player's BODY_MUSCLE stat (#23) to the maximum value of 1000. This will result in him looking really muscular.<br />
<syntaxhighlight lang="lua">function changeBodyStrength(thePlayer, commandName)<br />
-- Output whether the setPlayerStat was successful in changing the BODY_MUSCLE STAT <br />
if setPedStat(thePlayer, 23, 1000) then<br />
outputChatBox("Your player looks really muscular")<br />
else<br />
outputChatBox("Failed to make your player look muscular.")<br />
end<br />
end<br />
addCommandHandler("beefcake", changeBodyStrength)<br />
</syntaxhighlight><br />
<br />
This example adds a ''/upgradeskills'' command to give the player who types it the maximum skill with every weapon and maximum health.<br />
<syntaxhighlight lang="lua"><br />
--[[<br />
<br />
Skills to upgrade:<br />
<br />
24 = Max Player Health<br />
69 = Weapon Type Pistol Skill<br />
70 = Weapon Type Pistol Silenced Skill<br />
71 = Weapon Type Desert Eagle Skill<br />
72 = Weapon Type Shotgun Skill<br />
73 = Weapon Type Sawn off Shotgun Skill<br />
74 = Weapon Type Spas 12 Shotgun Skill<br />
76 = Weapon Type MP5 Skill<br />
77 = Weapon Type AK47 Skill<br />
78 = Weapon Type M4 Skill<br />
79 = Weapon Type Sniper Rifle Skill<br />
<br />
--]]<br />
<br />
addCommandHandler("upgradeskills", function(thePlayer)<br />
-- Set every stat to 1000 (the maximum value)<br />
for _, stat in ipairs({ 24, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79 }) do<br />
setPedStat(thePlayer, stat, 1000)<br />
outputChatBox("Your game stats upgraded to maximum!", thePlayer, 0, 255, 0, false)<br />
end<br />
-- Set player health to the maximum, as changing the stat keeps the current one<br />
if (isPedDead (thePlayer) ~= true) then<br />
setElementHealth(thePlayer, 100 + (getPedStat(ped, 24) - 569) / 4.31 return math.max(1, maxhealth))<br />
-- Tell the player what we did<br />
outputChatBox("And your health upgraded to maximum!", thePlayer, 0, 255, 0, false)<br />
else<br />
outputChatBox("Your health can't be restored because you are already dead!", thePlayer, 0, 255, 0, false)<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Ped functions}}<br />
[[ru:setPedStat]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=GetPlayerSerial&diff=52590
GetPlayerSerial
2017-10-13T16:51:47Z
<p>AlexTMjugador: Typo at /* Serverside examples */</p>
<hr />
<div>__NOTOC__<br />
{{Server function}}<br />
This function returns the [[serial]] for a specified [[player]].<br />
{{Note|The client side version of [[getPlayerSerial]] has been deprecated as it can return the wrong value for some players, and is potentially insecure. The following article assumes that the function is serverside only.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
string getPlayerSerial ( player thePlayer )<br />
</syntaxhighlight><br />
{{OOP||[[player]]:getSerial|serial|}}<br />
===Required Arguments===<br />
*'''thePlayer:''' A [[player]] object referencing the specified player.<br />
<br />
==Returns==<br />
Returns the serial as a ''string'' if it was found, ''false'' otherwise.<br />
<br />
==Serverside examples==<br />
This example creates a command with which player can check their own serial.<br />
<syntaxhighlight lang="lua"><br />
function checkMySerial( thePlayer, command )<br />
local theSerial = getPlayerSerial( thePlayer )<br />
if theSerial then<br />
outputChatBox( "Your serial is: " .. theSerial, thePlayer )<br />
else<br />
outputChatBox( "Sorry, you have no serial. =(", thePlayer )<br />
end<br />
end<br />
addCommandHandler( "myserial", checkMySerial )<br />
</syntaxhighlight><br />
<br />
This example adds a command to ban a player's serial.<br />
<syntaxhighlight lang="lua"><br />
local function banSerialCommand ( source, command, playerName, reason )<br />
if playerName then<br />
local player, serial = getPlayerFromName ( playerName ), getPlayerSerial ( playerName )<br />
if player then<br />
addBan ( serial, source, reason )<br />
end<br />
end<br />
end<br />
addCommandHandler ( "banplayerserial", banSerialCommand )<br />
</syntaxhighlight><br />
<br />
This example only allows clients with a certain serial to log in into an account.<br />
<syntaxhighlight lang="lua"><br />
local allowedAccountSerials = <br />
{<br />
-- List of allowed serials to log in into an account. Format:<br />
-- [ Account name ] = { Allowed serial array }<br />
[ "3ash8" ] = { "9C9F3B55D9D7BB7135FF274D3BF444E4" },<br />
[ "test5" ] = { "1D6F76CF8D7193792D13789849498452" },<br />
}<br />
<br />
addEventHandler("onPlayerLogin", root,<br />
function(_, account)<br />
-- Get the player serial and the allowed serial list for that account<br />
-- (If no serial is allowed for the account, do not allow the player to log in as a safety measure)<br />
local playerSerial, allowedSerials = getPlayerSerial(source), allowedAccountSerials[getAccountName(account)] or {}<br />
-- Check whether the client has an allowed serial or not<br />
for i = 1, #allowedSerials do<br />
if allowedSerials[i] == playerSerial then<br />
-- The serial is allowed. Proceed with the normal log in proccess<br />
return<br />
end<br />
end<br />
-- If we reach this point the serial is not allowed. Do not let the player log in<br />
cancelEvent(true, "Client serial not allowed to log in into the account")<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Player functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=User_talk:7soOoD&diff=51717
User talk:7soOoD
2017-07-24T13:50:29Z
<p>AlexTMjugador: /* About your scripting issue */ new section</p>
<hr />
<div>i have proplem with my server i upload a roleplay mods and the mysql is connected but when i start server the mods running prefeclty but the login pannel didn`t came and just black screen i buy another server same proplem how i can fix it ? please help me<br />
<br />
== About your scripting issue ==<br />
<br />
First of all, hello and welcome to the MTA: SA Wiki! I hope you spend a good time here and I look forward to see some cool contributions from yours :) Regarding your scripting problem with that Roleplay gamemode you're trying to set up, I'm afraid to tell you that this Wiki is not a place designed to ask for that kind of help, because your user page can get lost among all the others and it's more designed as a personal place. Instead, I'd tell you to user the MTA forums, where you can get quicker and more effective support. In particular, your inquiry should go in the scripting subforum, which you can access from [https://forum.mtasa.com/forum/71-scripting/ this link]. Moreover, if you think you can't wait for fellow scripters to answer you in the forums, you can also join our [irc://irc.gtanet.com/mta IRC chat] or [https://forum.mtasa.com/topic/95008-multi-theft-autos-official-discord-server/ Discord server]. Good luck! --[[User:AlexTMjugador|AlexTMjugador]] ([[User talk:AlexTMjugador|talk]]) 13:50, 24 July 2017 (UTC)</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Template:World_functions&diff=51692
Template:World functions
2017-07-18T14:05:37Z
<p>AlexTMjugador: Added set/getVehiclesLODDistance</p>
<hr />
<div>*[[areTrafficLightsLocked]]<br />
*[[getCloudsEnabled]]<br />
*[[getGameSpeed]]<br />
*[[getGravity]]<br />
*[[getHeatHaze]]<br />
*[[getJetpackMaxHeight]]<br />
*[[getMinuteDuration]]<br />
*[[getSkyGradient]]<br />
*[[getTime]]<br />
*[[getTrafficLightState]]<br />
*[[getVehiclesLODDistance]]<br />
*[[getWeather]]<br />
*[[getZoneName]]<br />
*[[isGarageOpen]]<br />
*[[resetSkyGradient]]<br />
*[[resetHeatHaze]]<br />
*[[setCloudsEnabled]]<br />
*[[setGameSpeed]]<br />
*[[setGarageOpen]]<br />
*[[setGravity]]<br />
*[[setHeatHaze]]<br />
*[[setMinuteDuration]]<br />
*[[setSkyGradient]]<br />
*[[setTime]]<br />
*[[setTrafficLightState]]<br />
*[[setTrafficLightsLocked]]<br />
*[[setVehiclesLODDistance]]<br />
*[[setWeather]]<br />
*[[setWeatherBlended]]<br />
*[[setInteriorSoundsEnabled]]<br />
*[[getInteriorSoundsEnabled]]<br />
*[[setRainLevel]]<br />
*[[getRainLevel]]<br />
*[[resetRainLevel]]<br />
*[[setSunSize]]<br />
*[[getSunSize]]<br />
*[[resetSunSize]]<br />
*[[setSunColor]]<br />
*[[getSunColor]]<br />
*[[resetSunColor]]<br />
*[[setWindVelocity]]<br />
*[[getWindVelocity]]<br />
*[[resetWindVelocity]]<br />
*[[setFarClipDistance]]<br />
*[[getFarClipDistance]]<br />
*[[resetFarClipDistance]]<br />
*[[setFogDistance]]<br />
*[[getFogDistance]]<br />
*[[resetFogDistance]]<br />
*[[removeWorldModel]]<br />
*[[restoreWorldModel]]<br />
*[[restoreAllWorldModels]]<br />
*[[setOcclusionsEnabled]]<br />
*[[getOcclusionsEnabled]]<br />
*[[setJetpackWeaponEnabled]]<br />
*[[getJetpackWeaponEnabled]]<br />
*[[setAircraftMaxVelocity]]<br />
*[[getAircraftMaxVelocity]]<br />
*[[setMoonSize]]<br />
*[[getMoonSize]]<br />
*[[resetMoonSize]]<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=GetVehicleComponentRotation&diff=51584
GetVehicleComponentRotation
2017-07-05T14:06:30Z
<p>AlexTMjugador: Grammar fixes</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
This function gets the component rotation of a [[vehicle]].<br />
{{Note|Before r6974 the component rotations went the wrong way (i.e. opposite to the vehicle rotations). This has been corrected, so you'll have to modify any scripts written before r6974 that use this function.}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
float, float, float getVehicleComponentRotation ( vehicle theVehicle, string theComponent [, string base = "parent"] )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:getComponentRotation||setVehicleComponentRotation}}<br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The [[vehicle]] you wish to get component rotation of.<br />
*'''theComponent:''' A [[Vehicle_Components|vehicle component]] (this is the frame name from the model file of the component you wish to modify)<br />
<br />
===Optional Arguments=== <br />
{{New feature/item|3.0141|1.4.0|7013|<br />
*'''base:''' A string representing what the returned rotation is relative to. It can be one of the following values:<br />
**'''parent''' (default if not specified): The rotation is relative to the parent component.<br />
**'''root''': The rotation is relative to the root component.<br />
**'''world''': The rotation is a world rotation, relative to the world's coordinates axes.<br />
}}<br />
<br />
===Returns=== <br />
Returns three ''floats'' indicating the rotation of the component, ''x'', ''y'' and ''z'' respectively.<br />
<br />
==Example== <br />
'''Example 1:''' This example would get the name and the position of the components and output it in the chat.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("vcr", -- short for 'vehicle component rotation'<br />
function()<br />
local theVeh = getPedOccupiedVehicle(localPlayer)<br />
if (theVeh) then<br />
local getComponent = getVehicleComponents(theVeh) -- returns table with all the components of the vehicle<br />
for k in pairs (getComponent) do<br />
local rx, ry, rz = getVehicleComponentRotation(theVeh, k)<br />
outputChatBox("Rotation of "..k.." is "..rx.." "..ry.." "..rz)<br />
end<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.4.0-9.07013|Added '''base''' argument}}<br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentRotation&diff=51583
SetVehicleComponentRotation
2017-07-05T14:04:56Z
<p>AlexTMjugador: Grammar fixes</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
This function sets the component rotation of a [[vehicle]].<br />
{{Note|Before r6974 the component rotations went the wrong way (i.e. opposite to the vehicle rotations). This has been corrected, so you'll have to modify any scripts written before r6974 that use this function.}}<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool setVehicleComponentRotation ( vehicle theVehicle, string theComponent, float rotX, float rotY, float rotZ [, string base = "parent"] )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:setComponentRotation||getVehicleComponentRotation}}<br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The [[vehicle]] you wish to set component rotation of.<br />
*'''theComponent:''' A [[Vehicle_Components|vehicle component]] (this is the frame name from the model file of the component you wish to modify) <br />
*'''rotX:''' The component's rotation around the x axis in degrees.<br />
*'''rotY:''' The component's rotation around the y axis in degrees.<br />
*'''rotZ:''' The component's rotation around the z axis in degrees.<br />
<br />
===Optional Arguments=== <br />
{{New feature/item|3.0141|1.4.0|7013|<br />
*'''base:''' A string representing what the supplied rotation (''rotX'', ''rotY'', ''rotZ'') is relative to. It can be one of the following values:<br />
**'''parent''' (default if not specified): The rotation is relative to the parent component.<br />
**'''root''': The rotation is relative to the root component.<br />
**'''world''': The rotation is a world rotation, relative to the world's coordinates axes.<br />
}}<br />
<br />
===Returns=== <br />
Returns ''true'' if the component rotation was set successfully, ''false'' otherwise.<br />
<br />
==Example== <br />
'''Example 1:''' This example would change the roatation of the component when the player enters a vehicle. <br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onClientVehicleEnter", getRootElement(),<br />
function()<br />
local theVeh = getPedOccupiedVehicle(localPlayer)<br />
local getComponent = getVehicleComponents(theVeh) -- returns table with all the components of the vehicle<br />
if (theVeh) then<br />
for k in pairs (getComponent) do<br />
local rx, ry, rz = getVehicleComponentRotation(theVeh, k) --get the rotation of the component<br />
setVehicleComponentRotation(theVeh, k, rx+10, ry+10, rz+10) -- increases by 10 unit<br />
end<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.4.0-9.07013|Added '''base''' argument}}<br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentPosition&diff=51582
SetVehicleComponentPosition
2017-07-05T13:59:53Z
<p>AlexTMjugador: Grammar fixes</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|3.0131|1.3.1|4715|<br />
This function sets the component position of a [[vehicle]].<br />
}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool setVehicleComponentPosition ( vehicle theVehicle, string theComponent, float posX, float posY, float posZ [, string base = "root"] )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:setComponentPosition||getVehicleComponentPosition}}<br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The [[vehicle]] you wish to set component position.<br />
*'''theComponent:''' A [[Vehicle_Components|vehicle component]] (this is the frame name from the model file of the component you wish to modify)<br />
*'''posX:''' The new x position of this component.<br />
*'''posY:''' The new y position of this component.<br />
*'''posZ:''' The new z position of this component.<br />
<br />
===Optional Arguments=== <br />
{{New feature/item|3.0141|1.4.0|7013|<br />
*'''base''': A string representing what the supplied position (''posX'', ''posY'', ''posZ'') is relative to. It can be one of the following values:<br />
**'''parent''': The position is relative to the parent component.<br />
**'''root''' (default if not specified): The position is relative to the root component.<br />
**'''world''': The position is a world position, relative to the world's center of coordinates.<br />
}}<br />
<br />
===Returns=== <br />
Returns ''true'' if component position was set successfully, ''false'' otherwise.<br />
<br />
==Example== <br />
'''Example 1:''' This example would set the position of the component. <br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("scp", -- short for 'set component position'<br />
function()<br />
local theVeh = getPedOccupiedVehicle(localPlayer)<br />
local getComponent = getVehicleComponents(theVeh) -- returns table with all the components of the vehicle<br />
if (theVeh) then<br />
for k in pairs (getComponent) do<br />
local x, y, z = getVehicleComponentPosition(theVeh, k) --get the position of the component<br />
setVehicleComponentPosition(theVeh, k, x+1, y+1, z+1) -- increases by 1 unit<br />
end<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.4.0-9.07013|Added '''base''' argument}}<br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=GetVehicleComponentPosition&diff=51581
GetVehicleComponentPosition
2017-07-05T13:56:04Z
<p>AlexTMjugador: Grammar fixes</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
This function gets the component position of a [[vehicle]].<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
float, float, float getVehicleComponentPosition ( vehicle theVehicle, string theComponent [, string base = "root"] )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:getComponentPosition||setVehicleComponentPosition}}<br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The [[vehicle]] you wish to get component position of.<br />
*'''theComponent:''' A [[Vehicle_Components|vehicle component]] (this is the frame name from the model file of the component you wish to modify)<br />
<br />
===Optional Arguments=== <br />
{{New feature/item|3.0141|1.4.0|7013|<br />
*'''base:''' A string representing what the returned position is relative to. It can be one of the following values:<br />
**'''parent:''' The position is relative to the parent component.<br />
**'''root:''' The position is relative to the root component.<br />
**'''world:''' The position is a world position.<br />
}}<br />
<br />
===Returns=== <br />
Returns three ''floats'' indicating the position of the component, ''x'', ''y'' and ''z'' respectively.<br />
<br />
==Example==<br />
This example gets the name and the position of the components and outputs it in the chat.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("vcp", -- short for 'vehicle component position'<br />
function()<br />
local theVeh = getPedOccupiedVehicle(localPlayer)<br />
local getComponent = getVehicleComponents(theVeh) -- returns table with all the components of the vehicle<br />
if (theVeh) then<br />
for k in pairs (getComponent) do<br />
local x, y, z = getVehicleComponentPosition(theVeh, k)<br />
outputChatBox("Position of "..k.." is"..x.." "..y.." "..z)<br />
end<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.4.0-9.07013|Added '''base''' argument}}<br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=EngineSetFrameRotation&diff=51580
EngineSetFrameRotation
2017-07-05T13:49:12Z
<p>AlexTMjugador: Redirect to setVehicleComponentRotation. I guess that model frames were renamed to components</p>
<hr />
<div>#REDIRECT [[SetVehicleComponentRotation]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=EngineSetFramePosition&diff=51579
EngineSetFramePosition
2017-07-05T13:48:26Z
<p>AlexTMjugador: Redirect to setVehicleComponentPosition. I guess that model frames were renamed to components</p>
<hr />
<div>#REDIRECT [[SetVehicleComponentPosition]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=EngineGetFrameRotation&diff=51578
EngineGetFrameRotation
2017-07-05T13:48:03Z
<p>AlexTMjugador: Redirect to getVehicleComponentRotation. I guess that model frames were renamed to components</p>
<hr />
<div>#REDIRECT [[GetVehicleComponentRotation]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=EngineGetFramePosition&diff=51577
EngineGetFramePosition
2017-07-05T13:47:33Z
<p>AlexTMjugador: Redirect to getVehicleComponentPosition. I guess that model frames were renamed to components</p>
<hr />
<div>#REDIRECT [[GetVehicleComponentPosition]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=SetWorldSpecialPropertyEnabled&diff=51321
SetWorldSpecialPropertyEnabled
2017-06-22T16:30:02Z
<p>AlexTMjugador: All the special properties are no longer cheats</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
Enables or disables a special world property.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">bool setWorldSpecialPropertyEnabled ( string propname, bool enable )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''propname:''' the name of the property to set. Possible values are:<br />
**'''hovercars''' - equivalent of the JBGVNB cheat, and allows cars to drive on water.<br />
**'''aircars''' - equivalent of the RIPAZHA cheat, and allows cars to fly.<br />
**'''extrabunny''' - equivalent of the CJPHONEHOME or JHJOECW cheat, and allows you to bunny hop on bicycles much higher.<br />
**'''extrajump''' - equivalent of the KANGAROO cheat, and allows you to jump on foot much higher.<br />
**'''randomfoliage''' - toggle randomly generated foliage on the GTA:SA map (default: true)<br />
**'''snipermoon''' - toggle the GTA:SA easter egg, which increases the size of the moon every time you shoot it with a sniper rifle (default: false)<br />
**'''extraairresistance''' - toggle the vehicle speed limit on cross-country roads (default: true)<br />
*'''enable:''' whether or not to enable the property.<br />
<br />
===Returns===<br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Example==<br />
<br />
Function which allow cars to fly.<br />
<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "onClientResourceStart", resourceRoot,<br />
function()<br />
setWorldSpecialPropertyEnabled("aircars", true)<br />
end<br />
)<br />
</syntaxhighlight><br />
</section><br />
<br />
'''Example 2:''' <br />
Allow cars to drive on water.<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "onClientResourceStart", resourceRoot,<br />
function()<br />
setWorldSpecialPropertyEnabled("hovercars", true)<br />
end<br />
)</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Client world functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=CreateColTube&diff=51085
CreateColTube
2017-05-27T14:06:42Z
<p>AlexTMjugador: Undo revision 51082 by Hakerbon (talk)</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
This function creates a collision tube. This is a shape that has a position and a 2D (X/Y) radius and a height. See [http://en.wikipedia.org/wiki/Cylinder_(geometry) Cylinder] for a definition of a tube. A tube is similar to a colcircle, except that it has a limited height, this means you can limit the distance above the position defined by (fX, fY, fZ) that the collision is detected.<br />
{{VisualizeColshape}}<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
colshape createColTube ( float fX, float fY, float fZ, float fRadius, float fHeight)<br />
</syntaxhighlight> <br />
{{OOP| |ColShape.Tube||}}<br />
===Required Arguments=== <br />
*'''fX:''' The position of the base of the tube's center on the X axis<br />
*'''fY:''' The position of the base of the tube's center on the Y axis<br />
*'''fZ:''' The position of the base of the tube's center on the Z axis<br />
*'''fRadius:''' The collision tube's radius<br />
*'''fHeight:''' The collision tube's height<br />
<br />
===Returns===<br />
Returns a [[colshape]] element if successful, ''false'' if invalid arguments were passed to the function.<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
This example displays a chat message when a player enters the colshape and allows the colshape to be created using a console function ''set_zone''.<br />
<syntaxhighlight lang="lua"><br />
theZone = false<br />
<br />
function shapeHit ( thePlayer ) <br />
outputChatBox ( getPlayerName ( thePlayer ) .. " is in the zone!" ) -- display a message in everyone's chat box<br />
end<br />
<br />
function setZone ( playerSource, commandName, fX, fY, fZ )<br />
if ( fZ and fY and fX ) then -- check we've got all 3 args we need<br />
local tempCol = createColTube ( fX, fY, fZ, 10.0, 10.0 ) -- create a col<br />
if ( tempCol == false ) then -- did the col get created successfully?<br />
outputConsole ( "Syntax is: set_zone <X> <Y> <Z>" ) -- inform the user what the valid syntax is<br />
else<br />
if ( theZone ~= false ) then -- did we already have a zone?<br />
destroyElement ( theZone ) -- if so, destroy it<br />
else<br />
addEventHandler ( "onColShapeHit", theZone, shapeHit ) -- add a handler for the onColShapeHit event<br />
end<br />
theZone = tempCol -- and store the new zone we've made<br />
outputChatBox ( "Zone has moved!" ) -- and tell everyone<br />
end<br />
end<br />
end<br />
addCommandHandler ( "set_zone", setZone ) -- add a console function called set_zone that will trigger the function setZone<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Collision shape functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=OnPlayerLogin&diff=51084
OnPlayerLogin
2017-05-27T14:05:56Z
<p>AlexTMjugador: Undo revision 51083 by Sukinsyn (talk)</p>
<hr />
<div>{{Server event}}<br />
__NOTOC__ <br />
This event is triggered when a player logs into their account in-game.<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
account thePreviousAccount, account theCurrentAccount<br />
</syntaxhighlight> <br />
<br />
*'''thePreviousAccount''': The account the player was logged into before<br />
*'''theCurrentAccount''': The account the player logged into just now<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the player [[element]] that just logged in.<br />
<br />
==Cancel effect==<br />
If this event is canceled the player will not be logged in.<br />
<br />
==Example== <br />
This example just outputs to the player console that a player in one account logged into an another account:<br />
<syntaxhighlight lang="lua"><br />
-- root = getElementRoot()<br />
addEventHandler("onPlayerLogin", root,<br />
function()<br />
outputChatBox(getPlayerName(source).." has logged in!", root)<br />
end<br />
)<br />
</syntaxhighlight><br />
This example allows only hardcoded serials to access given accounts.<br />
<syntaxhighlight lang="lua"><br />
Firewall = <br />
{<br />
-- [ 'accountName' ] = 'playerSerial',<br />
[ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',<br />
[ 'test5' ] = '1D6F76CF8D7193792D13789849498452',<br />
}<br />
<br />
addEventHandler ( 'onPlayerLogin', getRootElement ( ),<br />
function ( _, theCurrentAccount )<br />
local Serial = Firewall[getAccountName(theCurrentAccount)]<br />
if ( Serial ) then<br />
if Serial ~= getPlayerSerial ( source ) then<br />
outputChatBox( "Sorry, you're not allowed to access this account.", source)<br />
cancelEvent( true )<br />
end<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
{{See also/Server event|Player events}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=PasswordHash&diff=50808
PasswordHash
2017-05-01T16:55:52Z
<p>AlexTMjugador: Typos</p>
<hr />
<div>__NOTOC__<br />
{{Shared function}}<br />
{{Note box|Using '''passwordHash''' is the recommended way of storing passwords.}}<br />
{{New feature/item|3.0154|1.5.4|11277|<br />
This function creates a new password hash using a specified hashing algorithm.<br />
}}<br />
<br />
{{Warning|It is strongly recommended to use the async version of the function (i.e. provide a callback function). Otherwise, you will experience short freezes due to the slow nature of the bcrypt algorithm}}<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
string passwordHash ( string password, string algorithm [, table options = {} ][, function callback ]) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''password:''' The password to hash.<br />
*'''algorithm:''' The algorithm to use:<br />
** ''bcrypt'': use the bcrypt hashing algorithm. Hash length: 60 characters.<br />
<br />
===Optional Arguments===<br />
*'''options:''' table with options for the hashing algorithm, as detailed below<br />
{{New feature/item|3.0154|1.5.4|11281|<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 />
===Options for each hashing algorithm===<br />
* ''bcrypt'':<br />
** ''cost'' (int), default: 10. Visit [http://security.stackexchange.com/questions/17207/recommended-of-rounds-for-bcrypt this link] to determine the number of rounds appropriate for your server.<br />
** ''salt'' (string), default: automatically generate salt <br />
*** an empty string will automatically generate a salt with the ''cost'' provided<br />
*** if a string is provided, the given salt is used (do not do this!)<br />
*** the provided string should be longer or equal than 22 characters<br />
<br />
===Returns===<br />
Returns the hash as a string if hashing was successful, ''false'' otherwise. If a callback was provided, the aforementioned values are arguments to the callback, and this function will always return ''true''.<br />
<br />
==Example==<br />
{{Warning|If you will be using "Example 1" then you will have to save account data "hash_password" after server restart, otherwise this script will no longer work.}}<br />
This example makes use of [https://wiki.multitheftauto.com/wiki/PasswordHash passwordHash] and [https://wiki.multitheftauto.com/wiki/PasswordVerify passwordVerify] in account creation and account login to boost up security.<br />
<section name="Example 1" class="server" show="true"><br />
* Use '''</accountCreate [username] [password]>''' to create an account.<br />
* Use '''</accountLogin [username] [password]>''' to login in account.<br />
<syntaxhighlight lang="lua"><br />
-- lets add command handler that will handle the account creation<br />
addCommandHandler("accountCreate",function(source,cmd,username,password)<br />
if (username and password) then<br />
local hashedPassword = passwordHash(password,"bcrypt") -- create new hash for password<br />
if (hashedPassword) then -- check if hash has been generated<br />
local account = addAccount(username,hashedPassword) -- now lets add account with new hash what we got when we made it for password.<br />
if (account) then<br />
setAccountData(account,"hash_password",hashedPassword) -- store accounts password hash in order to verify it when it's needed.<br />
outputChatBox("Account successfuly created! Now please login. Syntax </accountLogin [username] [password]>",source,20,160,20)<br />
else<br />
outputChatBox("Account already exists! Please try again with different username.",source,20,160,20)<br />
end<br />
else<br />
outputChatBox("Securing your password failed! Please try again or contact an administrator.",source,160,20,20)<br />
end<br />
else<br />
outputChatBox("Wrong parameters! Correct Syntax </accountCreate [username] [password]>",source,160,20,20)<br />
end<br />
end);<br />
<br />
-- lets add command handler that will handle the account login<br />
addCommandHandler("accountLogin",function(source,cmd,username,password)<br />
if (username and password) then<br />
local account = getAccount(username) -- get entered account<br />
if (account) then -- check if entered account exists<br />
local hashedPassword = getAccountData(account,"hash_password") -- lets get hashed password<br />
if (passwordVerify(password,hashedPassword)) then -- check if hash and entered password matches<br />
if logIn(source,account,hashedPassword) then -- now lets login player into account<br />
outputChatBox("Login successfull. Welcome, "..getAccountName(account).."!",source,20,160,20)<br />
end<br />
else<br />
outputChatBox("Password is incorrect!",source,160,20,20)<br />
end<br />
else<br />
outputChatBox("Account doesn't exist! Please try again with different account.",source,160,20,20)<br />
end<br />
else<br />
outputChatBox("Wrong parameters! Correct Syntax </accountCreate [username] [password]>",source,160,20,20)<br />
end<br />
end);<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Utility functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=AddEventHandler&diff=50591
AddEventHandler
2017-04-07T14:39:44Z
<p>AlexTMjugador: Same thing as previous edit</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}} <br />
{{Note_box|It is strongly advised that you do not use the same name for your handler function as the event name, as this can lead to confusion if multiple handler functions are used.}}<br />
This function will add an [[event]] handler. An event handler is a function that will be called when the event it's attached to is triggered. See [[event system]] for more information on how the event system works.<br />
<br />
Event handlers are functions that are called when a particular event happens. Each event specifies a specific set of variables that are passed to the event handler and can be read by your function. The following global variables are available for use in handler functions:<br />
*'''source''': the element that triggered the event<br />
*'''this''': the element that the event handler is attached to<br />
*'''sourceResource''': the resource that triggered the event<br />
*'''sourceResourceRoot''': the root element of the resource that triggered the event<br />
*'''client''': the client that triggered the event using [[triggerServerEvent]]. Not set if the event was not triggered from a client.<br />
{{New_feature|3|1.0|<br />
*'''eventName''': the name of the event which triggered the handler function.<br />
}}<br />
<br />
It is important to remember that events pass up and down the [[element tree]]. An event triggered on the root element is triggered on every element in the tree. An event triggered on any other element is triggered on its ancestors (its parent element and its parent's parent etc) and its children, grandchildren and great-grandchildren. You can use the ''getPropagated'' argument to specify if you wish your handler to receive events that have propagated up or down the tree.<br />
<br />
The order in which event handlers are triggered is undefined, you should not rely on one event handler being executed before another.<br />
{{Note|See [[Script security]] for tips on preventing cheaters when using events and element data}}<br />
{{Note|See [[Event_Source_Element|Event Source Element]] for a descriptive visualization of the event system handling an event trigger.}}<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool addEventHandler ( string eventName, element attachedTo, function handlerFunction, [ bool getPropagated = true, string priority = "normal" ] ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''eventName:''' The name of the [[event]] you want to attach the handler function to.<br />
*'''attachedTo:''' The [[element]] you wish to attach the handler to. The handler will only be called when the event it is attached to is triggered for this element, or one of its children. Often, this can be the root element (meaning the handler will be called when the event is triggered for ''any'' element).<br />
*'''handlerFunction:''' The handler function you wish to call when the event is triggered. This function will be passed all of the event's parameters as arguments, but it isn't required that it takes all of them.<br />
<br />
===Optional Arguments===<br />
*'''getPropagated:''' A boolean representing whether the handler will be triggered if the event was propagated down or up the [[element tree]] (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to ''false'' will only be triggered if ''source == this'').<br />
{{New_feature|3.0131|1.3.1|<br />
*'''priority :''' A string representing the trigger order priority relative to other event handlers of the same name. Possible values are:<br />
**'''"high"'''<br />
**'''"normal"'''<br />
**'''"low"'''<br />
''It is also possible to add finer priority control by appending a positive or negative number to the priority string. For example (in priority order for reference): "high+4" "high" "high-1" "normal-6" "normal-7" "low+1" "low" "low-1"''<br />
'''Important note:''' Anything bound to a specific element will be run before other handlers that are bound to something higher in the element tree (like root) This means that "high+10" bound to root won't trigger before "normal" bound directly to an element.<br />
}}<br />
<br />
===Returns===<br />
Returns ''true'' if the event handler was attached successfully. Returns ''false'' if the specified event could not be found or any parameters were invalid.<br />
<br />
==Example==<br />
<section name="Server" class="server" show="true"><br />
This serverside example sends a message to everyone in the server when a player spawns.<br />
<syntaxhighlight lang="lua"><br />
-- get the root element<br />
rootElement = getRootElement()<br />
-- define our handler function<br />
function onPlayerSpawnHandler ( )<br />
-- get the player's name, source is the player because he was spawned<br />
local playerName = getPlayerName( source )<br />
-- output in the chat box that they've spawned<br />
outputChatBox ( playerName .. " has spawned!" )<br />
end<br />
<br />
addEventHandler( "onPlayerSpawn", rootElement, onPlayerSpawnHandler )<br />
</syntaxhighlight><br />
</section><br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.3.0-9.03795|Added priority argument}}<br />
<br />
==See Also==<br />
{{Event_functions}}<br />
[[ru:addEventHandler]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=TriggerEvent&diff=50590
TriggerEvent
2017-04-07T14:38:16Z
<p>AlexTMjugador: Display spaces instead of underscores in the recently added link</p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
This function will trigger a named [[event]] on a specific [[element]] in the [[element tree]]. See [[event system]] for more information on how the event system works.<br />
<br />
You can use the value returned from this function to determine if the event was cancelled by one of the event handlers. You should determine what your response (if any) to this should be based on the event's purpose. Generally, cancelling an event should prevent any further code being run that is dependent on whatever triggered that event. For example, if you have an ''onFlagCapture'' event, cancelling it would be expected to prevent the flag being able to be captured. Similarly, if you have ''onPlayerKill'' as an event you trigger, canceling it would either be expected to prevent the player being killed from dying or at least prevent the player from getting a score for it.<br />
{{Note|You should avoid triggering events on the [[root element]] unless you really need to. Doing this triggers the event on every element in the element tree, which is potentially very CPU intensive. Use as specific (i.e. low down the tree) element as you can.}}<br />
{{Note|See [[Event_Source_Element|Event Source Element]] for a descriptive visualization of the event system handling an event trigger.}}<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool triggerEvent ( string eventName, element baseElement, [ var argument1, ... ] ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''eventName:''' The name of the event you wish to trigger<br />
*'''baseElement:''' The element you wish to trigger the event on. See [[event system]] for information on how this works.<br />
<br />
===Optional Arguments=== <br />
{{OptionalArg}} <br />
*'''argument1:''' The first argument that the event handler expects should be added after the ''baseElement'' variable.<br />
**''NOTE:'' This function can have more than one of these arguments specified, once for each argument the event handler is expecting.<br />
<br />
===Returns===<br />
* Returns '''nil''' if the arguments are invalid or the event could not be found. <br />
* Returns '''true''' if the event was triggered successfully, and ''was not'' cancelled using [[cancelEvent]].<br />
* Returns '''false''' if the event was triggered successfully, and ''was'' cancelled using [[cancelEvent]].<br />
<br />
==Example== <br />
If you define a new custom event as follows:<br />
<syntaxhighlight lang="lua"><br />
-- Add a new event called onSpecialEvent<br />
addEvent ( "onSpecialEvent", true )<br />
-- Define our handler function<br />
function specialEventHandler ( text )<br />
outputChatBox ( text )<br />
end<br />
-- Add the event handler<br />
addEventHandler ( "onSpecialEvent", root, specialEventHandler )<br />
</syntaxhighlight><br />
<br />
You can then trigger this event later on using:<br />
<syntaxhighlight lang="lua"><br />
triggerEvent ( "onSpecialEvent", root, "test" )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Event_functions}}<br />
[[ru:triggerEvent]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=ES/Multi_Theft_Auto&diff=50570
ES/Multi Theft Auto
2017-03-24T15:35:11Z
<p>AlexTMjugador: /* Ver también */</p>
<hr />
<div>[[File:Am3.jpg|thumb|Prueba de concepto.]]<br />
{{MessageBox|<br />
bordercolorhex = BFBFFF |<br />
bgcolorhex = E0E0FF |<br />
message = '''Nota:''' Si solo quieres descargar Multi Theft Auto, ve aquÃ:<br />
* [http://mtasa.com Descargar MTA: San Andreas {{Current Version|full}}]<br />
* {{Localized article|Archive|Descargar Multi Theft Auto 0.5r2 (GTA III y Vice City)|us|es}} }}<br />
Multi Theft Auto (MTA) es el primer complemento multijugador del mundo para la trilogÃa de Grand Theft Auto III<ref>TrilogÃa: Grand Theft Auto III, Grand Theft Auto: Vice City y Grand Theft Auto: San Andreas</ref>. Empezando como un sistema de dos jugadores muy simple sin sincronización a pie, se ha convertido en uno de los complementos multijugador más activos para Grand Theft Auto.<br />
<br />
Aunque a menudo considerado una modificación, Multi Theft Auto se basa en técnicas de [https://es.wikipedia.org/wiki/Inyecci%C3%B3n_de_c%C3%B3digo inyección de código] y [http://en.wikipedia.org/wiki/Hooking ''hooking''] que manipulan el juego sin alterar ninguno de sus archivos originales. Se trata de un [https://es.wikipedia.org/wiki/Motor_de_videojuego motor de videojuego] que se instala como una extensión del juego original, añadiendo funcionalidad básica como [https://es.wikipedia.org/wiki/Red_de_computadoras comunicación por red] y [https://es.wikipedia.org/wiki/Interfaz_gr%C3%A1fica_de_usuario renderización de interfaz gráfica de usuario] mientras expone la funcionalidad del motor del juego original mediante un [https://es.wikipedia.org/wiki/Script lenguaje de ''script''].<br />
<br />
== Antes de Multi Theft Auto ==<br />
[[File:Gta3am01.jpg|thumb|GTA3: ''Alternative Multiplayer'' (Multijugador Alternativo)]]<br />
En febrero de 2003, IJs (anteriormente conocido como IJsVogel), fundador del proyecto, estuvo buscando un ''trainer'' para GTA III, encontrándose con la ''GTA3 Admin Console'' (Consola de Administrador para GTA3)<ref>http://hobby.estetiksoft.de/gta3console/html/getgta3console.htm</ref> y su código fuente. Mientras miraba el código, descubrió una manera de leer todos los datos de un coche anteriormente usado, y decidió sincronizarlos entre dos computadoras por una red. El resultado fue la creación de GTA3: AM, menos de una hora después.<br />
<br />
Sin embargo, después de su publicación, fue difÃcil convencer a la gente de que realmente funcionaba por culpa de varias farsas y anteriores intentos fallidos. Este fue el comienzo del proyecto de MTA.<br />
<br />
== Historia de Multi Theft Auto ==<br />
<br />
=== Hitos entre 2003 y 2006 ===<br />
ArtÃculo principal: {{Localized article|Timeline|LÃnea del tiempo|us|es}}<br />
<br />
=== Hitos desde 2006 ===<br />
Para versiones de MTA, ver: {{Localized article|Version_History|Historial de versiones|us|es}}<br />
[[File:MTA Main Menu 1.0.x.png|thumb|Menú principal de MTA: SA 1.0]]<br />
* '''3 de enero de 2008 — MTA: San Andreas 1.0 ''Deathmatch Developer Preview(s)'' (''Muestra/s para Desarrolladores'')'''<br />
MTA: San Andreas ''Deathmatch Developer Preview'' 1 fue la primera versión que ofreció sincronización a pie para San Andreas. El nombre ''deathmatch'' hace referencia a la posibilidad de disparar armas e ir a pie, a diferencia de la versión ''race''. Sin embargo, la etiqueta ''deathmatch'' fue eliminada en siguientes versiones por permitir éstas modos de juego personalizados mediante ''scripting'' en Lua, confundiendo a la gente. Pese a su condición de 'Developer Preview', las 5 primeras versiones eran muy populares.<br />
* '''21 de agosto de 2009 — MTA: San Andreas 1.0 publicado'''<br />
Las versiones 1.0.x se publicaron con la licencia GPLv3, que permitió trabajar a más gente en la próxima versión por volverse de código abierto.<br />
* '''2011 — ''Mod'' del Año - Elegido por jugadores #1'''<ref>http://www.moddb.com/events/2011-mod-of-the-year-awards/features/moty-players-choice-mod-of-the-year</ref><br />
* '''4 de nobiembre de 2012 — Más de diez mil jugadores conectados al mismo tiempo'''<br />
En ese dÃa, a las 17:30 (Tiempo Universal Coordinado, ''UTC'') tuvimos más de diez mil jugadores conectados al mismo tiempo en todos los servidores de MTA: SA. Ese número fue mayor que la cantidad de personas jugando a GTA IV y EFLC en Steam en ese mismo momento, e incluso mayor que la cantidad de gente jugando a tÃtulos populares como Call of Duty: Black Ops o Total War: Shogun 2 (según [http://store.steampowered.com/stats/ las estadÃsticas de Steam]).<br />
Esto demuestra que, incluso tras el paso de todos estos años, aún hay mucho interés en los juegos más antiguos de la saga GTA, especialmente si se juegan en lÃnea con amigos.<br />
También demuestra que apreciáis lo que hacemos, ¡y eso nos hace muy felices! El récord actual es de 11128 jugadores conectados a la vez el 22 de diciembre<ref>http://forum.mtasa.com/viewtopic.php?f=31&t=51863</ref>, asà que aún hay margen de mejora.<br />
<br />
== Versiones ==<br />
=== {{Localized article|Archive#Multi_Theft_Auto_0.5|GTA3: MTA|us|es}} ===<br />
GTA3: MTA fue originalmente conocido como GTA3: AM (''Alternative Multiplayer'', Multijugador Alternativo), aunque al no haber otro multijugador disponible difÃcilmente podÃa ser una alternativa. Empezó como un sistema de dos jugadores con el archiconocido método del coche anterior. Antes de migrar a MTA: VC ya se publicaron 3 versiones. 0.1a y 0.2a solo soportaban el método del coche anterior, mientras la versión 0.3b era más avanzada y tenÃa bastante más sincronización. Estas versiones originales se escribieron en Visual Basic. Sin embargo, el servidor para la versión 0.3b se hizo en C++ y estaba disponible para Windows y Linux.<br />
<br />
Las publicaciones de GTA3: MTA se descontinuaron hasta el último semestre de 2004, cuando fueron retomadas como parte de MTA 0.4. El soporte para GTA III fue mejorado posteriormente en la versión 0.5.<br />
<br />
Se ha dicho bastantes veces que GTA3: MTA se basó en el código multijugador dejado por Rockstar, los desarrolladores de GTA III. Si bien es cierto que hay contenido multijugador no utilizado en GTA III, no se empleó nada de código preexistente en MTA.<br />
<br />
=== {{Localized article|Archive#Multi_Theft_Auto_0.5|MTA:VC|us|es}} ===<br />
Cuando Vice City fue publicado no transcurrió mucho tiempo antes de que el proyecto de MTA migrase al nuevo juego. GTA III fue abandonado por el momento y el desarrollo se contró en Vice City. Aprovechamos esta oportunidad para escribir nuestro código desde cero, esta vez completamente en C++. No fue hasta la versión 0.2 cuando pudimos ver mejoras sustanciales. 0.2 fue la primera versión que incluyó un nuevo sistema de caja de chat y de tabla de puntuación (''scoreboard''). Versiones posteriores de MTA: VC tuvieron una acogida agridulce: hay personas que todavÃa prefieren la sensación de juego de las versiones 0.2.2 o 0.3. Algunos tachan a la última versión (0.5) de fracaso. En febrero de 2005, la vista previa de MTA 0.5.1 fue mostrada al público, ocupándose de arreglar incidencias conocidas y añadiendo nuevas funcionalidades<ref>http://files.mtasa.com/web/mta_0.5_launch/051.htm</ref>. La versión 0.5.1 nunca fue publicada.<br />
<br />
=== {{Localized article|Blue|'Blue'|us|es}} ===<br />
A finales de 2003 un proyecto derivado fue puesto en marcha, cuyo nombre en clave era Blue (Azul). El objetivo de este proyecto era poner en práctica nuevas ideas y luego portarlas al código ya existente. Debido a la mala programación de MTA: VC, se decidió que no se portarÃan y que el código de Blue formarÃa la base de un nuevo proyecto de MTA que, cuando estuviese acabado, serÃa fácil de adaptar a nuevos juegos. Inicialmente planeado para Vice City, el desarrollo no cogió ritmo hasta que San Andreas se lanzó al público en junio de 2005. MTA: SA está hecho sobre el proyecto Blue. Los conceptos usados en este proyecto también hacen posible añadir complementos del usuario al juego, y entonces se hizo la decisión de no hacer simplemente una modificación multijugador, sino de crear un kit de desarrollo de ''software'' (SDK) con capacidad de multijugador.<br />
<br />
=== {{Localized article|Archive#MTA:_San_Andreas_Race|MTA:SA Race|us|es}} ===<br />
La primera publicación de MTA: SA solo incorpora sincronización de vehÃculos. El equipo decidió empezar desde cero otra vez y programar un código base modular. Otra decisión fue centrarse en un área del juego a la vez y publicar otra versión cuando esa área estuviese completada. Por tanto, la primera versión solo permitÃa jugar con vehÃculos. También se añadió un editor de mapas básico. Aunque no hay sincronización a pie como en GTA3: AM, no hay comparación entre las dos desde un punto de vista técnico.<br />
<br />
=== {{Localized article|ES/Página Principal|MTA: SA (''Deathmatch'')|es|es}} ===<br />
La última revisión de Multi Theft Auto es para el juego Grand Theft Auto: San Andreas. Está hecha sobre un motor de videojuego de código abierto que ha estado en desarrollo durante varios años, y es el único que aún se mantiene activamente. Dicho motor provee a los usuarios con todas las herramientas que necesitan para crear sus propios [https://es.wikipedia.org/wiki/Jugabilidad modos de juego] y [https://es.wikipedia.org/wiki/Nivel_(videojuegos) mapas], exponiendo para ello una gran parte de la funcionalidad del juego original mediante una [https://es.wikipedia.org/wiki/Lua máquina virtual de Lua].<br />
<br />
El sábado, 22 de agosto de 2009, Multi Theft Auto: San Andreas v1.0 fue oficialmente distribuido como la primera publicación en código abierto. Abandonó la ya obsoleta etiqueta "Deathmatch" en el nombre para enfatizar la versatilidad de la aplicación. La jugabilidad está exclusivamente dada por el lenguaje de programación, asà que los usuarios pueden elegir o desarrollar su propia combinación de ''scripts'' y otros contenidos para personalizar y mantener su propio tipo de juego.<br />
<br />
{{ES/Comparación de versiones}}<br />
<br />
{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
<div align="center"><gallery perrow=5 caption="Capturas de pantalla"><br />
File:SSV Scramble.png|Mini-misión en Shoreside Vale, GTA III (MTA 0.5)<br />
File:Vc0.1-3.jpg|MTA: VC 0.1<br />
File:Mtavcbluelaunching.png|Pantalla de carga de MTA 'Blue'<br />
File:MTASA-Race-Mainmenu.png|La interfaz de 'Blue' en MTA: SA Race<br />
File:MTASA-Race-Racing.jpg|Carrera en MTA: SA Race<br />
File:Sa-airrace.jpg|Carrera aérea en MTA:SA Race<br />
File:Mtasa-nyan.png|Nyan cat en MTA:SA<br />
File:Mta-screen 2010-09-25 21-59-07.png|Mapa personalizado en MTA:SA<br />
</gallery></div><br />
|}<br />
<br />
== Ver también ==<br />
* {{Localized article|Timeline|LÃnea del tiempo|us|es}} (de 2003 a 2006)<br />
* {{Localized article|Version History|Historial de versiones|us|es}} (Un historial de las versiones de MTA detallado)<br />
* {{Localized article|Press Coverage|Cobertura de prensa|us|es}}<br />
* {{Localized article|Archive|Archivo|us|es}}<br />
<br />
== Enlaces externos ==<br />
* [http://gathering.tweakers.net/forum/list_messages/707958/0 GoT Tweakers.net Tema #1] (Holandés)<br />
* [http://gathering.tweakers.net/forum/list_messages/714034/0 GoT Tweakers.net Tema #2] (Holandés)<br />
* [http://www.youtube.com/playlist?list=PL1C361986E95BCA42&feature=plcp Archivo de vÃdeos] - Multimedia de versiones antiguas de MTA en YouTube.<br />
<br />
== Referencias ==<br />
<references/><br />
<br />
[[Category:Historical]]<br />
<br />
[[en:Multi_Theft_Auto]]<br />
[[pl:Multi_Theft_Auto]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=ES/Multi_Theft_Auto&diff=50569
ES/Multi Theft Auto
2017-03-24T15:22:40Z
<p>AlexTMjugador: Actualización a la edición inglesa vigente</p>
<hr />
<div>[[File:Am3.jpg|thumb|Prueba de concepto.]]<br />
{{MessageBox|<br />
bordercolorhex = BFBFFF |<br />
bgcolorhex = E0E0FF |<br />
message = '''Nota:''' Si solo quieres descargar Multi Theft Auto, ve aquÃ:<br />
* [http://mtasa.com Descargar MTA: San Andreas {{Current Version|full}}]<br />
* {{Localized article|Archive|Descargar Multi Theft Auto 0.5r2 (GTA III y Vice City)|us|es}} }}<br />
Multi Theft Auto (MTA) es el primer complemento multijugador del mundo para la trilogÃa de Grand Theft Auto III<ref>TrilogÃa: Grand Theft Auto III, Grand Theft Auto: Vice City y Grand Theft Auto: San Andreas</ref>. Empezando como un sistema de dos jugadores muy simple sin sincronización a pie, se ha convertido en uno de los complementos multijugador más activos para Grand Theft Auto.<br />
<br />
Aunque a menudo considerado una modificación, Multi Theft Auto se basa en técnicas de [https://es.wikipedia.org/wiki/Inyecci%C3%B3n_de_c%C3%B3digo inyección de código] y [http://en.wikipedia.org/wiki/Hooking ''hooking''] que manipulan el juego sin alterar ninguno de sus archivos originales. Se trata de un [https://es.wikipedia.org/wiki/Motor_de_videojuego motor de videojuego] que se instala como una extensión del juego original, añadiendo funcionalidad básica como [https://es.wikipedia.org/wiki/Red_de_computadoras comunicación por red] y [https://es.wikipedia.org/wiki/Interfaz_gr%C3%A1fica_de_usuario renderización de interfaz gráfica de usuario] mientras expone la funcionalidad del motor del juego original mediante un [https://es.wikipedia.org/wiki/Script lenguaje de ''script''].<br />
<br />
== Antes de Multi Theft Auto ==<br />
[[File:Gta3am01.jpg|thumb|GTA3: ''Alternative Multiplayer'' (Multijugador Alternativo)]]<br />
En febrero de 2003, IJs (anteriormente conocido como IJsVogel), fundador del proyecto, estuvo buscando un ''trainer'' para GTA III, encontrándose con la ''GTA3 Admin Console'' (Consola de Administrador para GTA3)<ref>http://hobby.estetiksoft.de/gta3console/html/getgta3console.htm</ref> y su código fuente. Mientras miraba el código, descubrió una manera de leer todos los datos de un coche anteriormente usado, y decidió sincronizarlos entre dos computadoras por una red. El resultado fue la creación de GTA3: AM, menos de una hora después.<br />
<br />
Sin embargo, después de su publicación, fue difÃcil convencer a la gente de que realmente funcionaba por culpa de varias farsas y anteriores intentos fallidos. Este fue el comienzo del proyecto de MTA.<br />
<br />
== Historia de Multi Theft Auto ==<br />
<br />
=== Hitos entre 2003 y 2006 ===<br />
ArtÃculo principal: {{Localized article|Timeline|LÃnea del tiempo|us|es}}<br />
<br />
=== Hitos desde 2006 ===<br />
Para versiones de MTA, ver: {{Localized article|Version_History|Historial de versiones|us|es}}<br />
[[File:MTA Main Menu 1.0.x.png|thumb|Menú principal de MTA: SA 1.0]]<br />
* '''3 de enero de 2008 — MTA: San Andreas 1.0 ''Deathmatch Developer Preview(s)'' (''Muestra/s para Desarrolladores'')'''<br />
MTA: San Andreas ''Deathmatch Developer Preview'' 1 fue la primera versión que ofreció sincronización a pie para San Andreas. El nombre ''deathmatch'' hace referencia a la posibilidad de disparar armas e ir a pie, a diferencia de la versión ''race''. Sin embargo, la etiqueta ''deathmatch'' fue eliminada en siguientes versiones por permitir éstas modos de juego personalizados mediante ''scripting'' en Lua, confundiendo a la gente. Pese a su condición de 'Developer Preview', las 5 primeras versiones eran muy populares.<br />
* '''21 de agosto de 2009 — MTA: San Andreas 1.0 publicado'''<br />
Las versiones 1.0.x se publicaron con la licencia GPLv3, que permitió trabajar a más gente en la próxima versión por volverse de código abierto.<br />
* '''2011 — ''Mod'' del Año - Elegido por jugadores #1'''<ref>http://www.moddb.com/events/2011-mod-of-the-year-awards/features/moty-players-choice-mod-of-the-year</ref><br />
* '''4 de nobiembre de 2012 — Más de diez mil jugadores conectados al mismo tiempo'''<br />
En ese dÃa, a las 17:30 (Tiempo Universal Coordinado, ''UTC'') tuvimos más de diez mil jugadores conectados al mismo tiempo en todos los servidores de MTA: SA. Ese número fue mayor que la cantidad de personas jugando a GTA IV y EFLC en Steam en ese mismo momento, e incluso mayor que la cantidad de gente jugando a tÃtulos populares como Call of Duty: Black Ops o Total War: Shogun 2 (según [http://store.steampowered.com/stats/ las estadÃsticas de Steam]).<br />
Esto demuestra que, incluso tras el paso de todos estos años, aún hay mucho interés en los juegos más antiguos de la saga GTA, especialmente si se juegan en lÃnea con amigos.<br />
También demuestra que apreciáis lo que hacemos, ¡y eso nos hace muy felices! El récord actual es de 11128 jugadores conectados a la vez el 22 de diciembre<ref>http://forum.mtasa.com/viewtopic.php?f=31&t=51863</ref>, asà que aún hay margen de mejora.<br />
<br />
== Versiones ==<br />
=== {{Localized article|Archive#Multi_Theft_Auto_0.5|GTA3: MTA|us|es}} ===<br />
GTA3: MTA fue originalmente conocido como GTA3: AM (''Alternative Multiplayer'', Multijugador Alternativo), aunque al no haber otro multijugador disponible difÃcilmente podÃa ser una alternativa. Empezó como un sistema de dos jugadores con el archiconocido método del coche anterior. Antes de migrar a MTA: VC ya se publicaron 3 versiones. 0.1a y 0.2a solo soportaban el método del coche anterior, mientras la versión 0.3b era más avanzada y tenÃa bastante más sincronización. Estas versiones originales se escribieron en Visual Basic. Sin embargo, el servidor para la versión 0.3b se hizo en C++ y estaba disponible para Windows y Linux.<br />
<br />
Las publicaciones de GTA3: MTA se descontinuaron hasta el último semestre de 2004, cuando fueron retomadas como parte de MTA 0.4. El soporte para GTA III fue mejorado posteriormente en la versión 0.5.<br />
<br />
Se ha dicho bastantes veces que GTA3: MTA se basó en el código multijugador dejado por Rockstar, los desarrolladores de GTA III. Si bien es cierto que hay contenido multijugador no utilizado en GTA III, no se empleó nada de código preexistente en MTA.<br />
<br />
=== {{Localized article|Archive#Multi_Theft_Auto_0.5|MTA:VC|us|es}} ===<br />
Cuando Vice City fue publicado no transcurrió mucho tiempo antes de que el proyecto de MTA migrase al nuevo juego. GTA III fue abandonado por el momento y el desarrollo se contró en Vice City. Aprovechamos esta oportunidad para escribir nuestro código desde cero, esta vez completamente en C++. No fue hasta la versión 0.2 cuando pudimos ver mejoras sustanciales. 0.2 fue la primera versión que incluyó un nuevo sistema de caja de chat y de tabla de puntuación (''scoreboard''). Versiones posteriores de MTA: VC tuvieron una acogida agridulce: hay personas que todavÃa prefieren la sensación de juego de las versiones 0.2.2 o 0.3. Algunos tachan a la última versión (0.5) de fracaso. En febrero de 2005, la vista previa de MTA 0.5.1 fue mostrada al público, ocupándose de arreglar incidencias conocidas y añadiendo nuevas funcionalidades<ref>http://files.mtasa.com/web/mta_0.5_launch/051.htm</ref>. La versión 0.5.1 nunca fue publicada.<br />
<br />
=== {{Localized article|Blue|'Blue'|us|es}} ===<br />
A finales de 2003 un proyecto derivado fue puesto en marcha, cuyo nombre en clave era Blue (Azul). El objetivo de este proyecto era poner en práctica nuevas ideas y luego portarlas al código ya existente. Debido a la mala programación de MTA: VC, se decidió que no se portarÃan y que el código de Blue formarÃa la base de un nuevo proyecto de MTA que, cuando estuviese acabado, serÃa fácil de adaptar a nuevos juegos. Inicialmente planeado para Vice City, el desarrollo no cogió ritmo hasta que San Andreas se lanzó al público en junio de 2005. MTA: SA está hecho sobre el proyecto Blue. Los conceptos usados en este proyecto también hacen posible añadir complementos del usuario al juego, y entonces se hizo la decisión de no hacer simplemente una modificación multijugador, sino de crear un kit de desarrollo de ''software'' (SDK) con capacidad de multijugador.<br />
<br />
=== {{Localized article|Archive#MTA:_San_Andreas_Race|MTA:SA Race|us|es}} ===<br />
La primera publicación de MTA: SA solo incorpora sincronización de vehÃculos. El equipo decidió empezar desde cero otra vez y programar un código base modular. Otra decisión fue centrarse en un área del juego a la vez y publicar otra versión cuando esa área estuviese completada. Por tanto, la primera versión solo permitÃa jugar con vehÃculos. También se añadió un editor de mapas básico. Aunque no hay sincronización a pie como en GTA3: AM, no hay comparación entre las dos desde un punto de vista técnico.<br />
<br />
=== {{Localized article|ES/Página Principal|MTA: SA (''Deathmatch'')|es|es}} ===<br />
La última revisión de Multi Theft Auto es para el juego Grand Theft Auto: San Andreas. Está hecha sobre un motor de videojuego de código abierto que ha estado en desarrollo durante varios años, y es el único que aún se mantiene activamente. Dicho motor provee a los usuarios con todas las herramientas que necesitan para crear sus propios [https://es.wikipedia.org/wiki/Jugabilidad modos de juego] y [https://es.wikipedia.org/wiki/Nivel_(videojuegos) mapas], exponiendo para ello una gran parte de la funcionalidad del juego original mediante una [https://es.wikipedia.org/wiki/Lua máquina virtual de Lua].<br />
<br />
El sábado, 22 de agosto de 2009, Multi Theft Auto: San Andreas v1.0 fue oficialmente distribuido como la primera publicación en código abierto. Abandonó la ya obsoleta etiqueta "Deathmatch" en el nombre para enfatizar la versatilidad de la aplicación. La jugabilidad está exclusivamente dada por el lenguaje de programación, asà que los usuarios pueden elegir o desarrollar su propia combinación de ''scripts'' y otros contenidos para personalizar y mantener su propio tipo de juego.<br />
<br />
{{ES/Comparación de versiones}}<br />
<br />
{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
<div align="center"><gallery perrow=5 caption="Capturas de pantalla"><br />
File:SSV Scramble.png|Mini-misión en Shoreside Vale, GTA III (MTA 0.5)<br />
File:Vc0.1-3.jpg|MTA: VC 0.1<br />
File:Mtavcbluelaunching.png|Pantalla de carga de MTA 'Blue'<br />
File:MTASA-Race-Mainmenu.png|La interfaz de 'Blue' en MTA: SA Race<br />
File:MTASA-Race-Racing.jpg|Carrera en MTA: SA Race<br />
File:Sa-airrace.jpg|Carrera aérea en MTA:SA Race<br />
File:Mtasa-nyan.png|Nyan cat en MTA:SA<br />
File:Mta-screen 2010-09-25 21-59-07.png|Mapa personalizado en MTA:SA<br />
</gallery></div><br />
|}<br />
<br />
== Ver también ==<br />
* {{Localized article|Timeline|LÃnea del tiempo|us|es}} (de 2003 a 2006)<br />
* {{Localized article|Version History|Historia de versiones|us|es}} (Una historia de las versiones de MTA más detallada)<br />
* {{Localized article|Press Coverage|Cobertura de prensa|us|es}}<br />
* {{Localized article|Archive|Archivo|us|es}}<br />
<br />
== Enlaces externos ==<br />
* [http://gathering.tweakers.net/forum/list_messages/707958/0 GoT Tweakers.net Tema #1] (Holandés)<br />
* [http://gathering.tweakers.net/forum/list_messages/714034/0 GoT Tweakers.net Tema #2] (Holandés)<br />
* [http://www.youtube.com/playlist?list=PL1C361986E95BCA42&feature=plcp Archivo de vÃdeos] - Multimedia de versiones antiguas de MTA en YouTube.<br />
<br />
== Referencias ==<br />
<references/><br />
<br />
[[Category:Historical]]<br />
<br />
[[en:Multi_Theft_Auto]]<br />
[[pl:Multi_Theft_Auto]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=GetElementSpeed&diff=50563
GetElementSpeed
2017-03-20T13:00:09Z
<p>AlexTMjugador: Fixed some things at /* Code */</p>
<hr />
<div>__NOTOC__<br />
{{Useful Function}}<br />
This function returns the speed of an element in m/s, km/h or mph.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float/nil getElementSpeed ( element theElement [, int/string unit="m/s" ] )<br />
</syntaxhighlight><br />
<br />
===Required arguments===<br />
* '''theElement''': the [[element]] you want to get the speed of. Compatible [[element]] types are:<br />
** [[Player|Players]].<br />
** [[Ped|Peds]].<br />
** [[Object|Objects]].<br />
** [[Vehicle|Vehicles]].<br />
** [[Projectile|Projectiles]].<br />
<br />
===Optional arguments===<br />
{{OptionalArg}}<br />
* '''unit''': the unit of the speed returned. If not specified, the unit will be ''m/s''. It can be specified as a ''[[string]]'' or ''number'' as follows:<br />
** '''0''' or '''m/s''': meters per second (speed unit of the [http://en.wikipedia.org/wiki/International_System_of_Units International System of Units], used in formal contexts).<br />
** '''1''' or '''km/h''': kilometres per hour (the most common speed unit, used in most countries).<br />
** '''2''' or '''mph''': miles per hour (used in some English-speaking countries).<br />
<br />
==Returns==<br />
This function returns a ''number'' containing the [[element]]'s speed if the arguments provided are valid. It returns ''[[nil]]'' plus an ''error'' otherwise.<br />
<br />
==Code==<br />
<section name="Function source" class="both" show="true"><br />
'''This function requires MTA: SA 1.4''' or higher to work. It doesn't need, however, to activate ''OOP''.<br />
<syntaxhighlight lang="lua"><br />
function getElementSpeed(theElement, unit)<br />
-- Check arguments for errors<br />
assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")")<br />
local elementType = getElementType(theElement)<br />
assert(elementType == "player" or elementType == "ped" or elementType == "object" or elementType == "vehicle" or elementType == "projectile", "Invalid element type @ getElementSpeed (player/ped/object/vehicle/projectile expected, got " .. elementType .. ")")<br />
assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)")<br />
-- Default to m/s if no unit specified and 'ignore' argument type if the string contains a number<br />
unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit))<br />
-- Setup our multiplier to convert the velocity to the specified unit<br />
local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456)<br />
-- Return the speed by calculating the length of the velocity vector, after converting the velocity to the specified unit<br />
return (Vector3(getElementVelocity(theElement)) * mult).length<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
==Example==<br />
<section name="Clientside example" class="client" show="true"><br />
This example draws the local player's speed rounded to a single decimal in the up-right corner of the screen in different units.<br />
<syntaxhighlight lang="lua"><br />
local sx = guiGetScreenSize()<br />
local function drawSpeed()<br />
local speedms, speedkmh, speedmph = getElementSpeed(localPlayer), getElementSpeed(localPlayer, 1), getElementSpeed(localPlayer, 2)<br />
local roundedSpeedms, roundedSpeedkmh, roundedSpeedmph = math.floor(speedms) == speedms and speedms or string.format(speedms, "%.1f"), math.floor(speedkmh) == speedkmh and speedkmh or string.format(speedkmh, "%.1f"), math.floor(speedmph) == speedmph and speedmph or string.format(speedmph, "%.1f")<br />
local speedoText = "Current speed: " .. roundedSpeedms .. " m/s | " .. roundedSpeedkmh .. " km/h | " .. roundedSpeedmph .. " mph"<br />
dxDrawText(speedoText, sx - dxGetTextWidth(speedoText), 0)<br />
end<br />
addEventHandler("onClientPreRender", root, drawSpeed)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See also==<br />
{{Useful_Functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=GetElementSpeed&diff=50562
GetElementSpeed
2017-03-20T12:58:30Z
<p>AlexTMjugador: Added projectiles to the list of compatible element types</p>
<hr />
<div>__NOTOC__<br />
{{Useful Function}}<br />
This function returns the speed of an element in m/s, km/h or mph.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float/nil getElementSpeed ( element theElement [, int/string unit="m/s" ] )<br />
</syntaxhighlight><br />
<br />
===Required arguments===<br />
* '''theElement''': the [[element]] you want to get the speed of. Compatible [[element]] types are:<br />
** [[Player|Players]].<br />
** [[Ped|Peds]].<br />
** [[Object|Objects]].<br />
** [[Vehicle|Vehicles]].<br />
** [[Projectile|Projectiles]].<br />
<br />
===Optional arguments===<br />
{{OptionalArg}}<br />
* '''unit''': the unit of the speed returned. If not specified, the unit will be ''m/s''. It can be specified as a ''[[string]]'' or ''number'' as follows:<br />
** '''0''' or '''m/s''': meters per second (speed unit of the [http://en.wikipedia.org/wiki/International_System_of_Units International System of Units], used in formal contexts).<br />
** '''1''' or '''km/h''': kilometres per hour (the most common speed unit, used in most countries).<br />
** '''2''' or '''mph''': miles per hour (used in some English-speaking countries).<br />
<br />
==Returns==<br />
This function returns a ''number'' containing the [[element]]'s speed if the arguments provided are valid. It returns ''[[nil]]'' plus an ''error'' otherwise.<br />
<br />
==Code==<br />
<section name="Function source" class="both" show="true"><br />
'''This function requires MTA: SA 1.4''' or higher to work. It doesn't need, however, to activate ''OOP''.<br />
<syntaxhighlight lang="lua"><br />
function getElementSpeed(theElement, unit)<br />
-- Check arguments for errors<br />
local theElementType = getElementType(theElement);<br />
assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")")<br />
assert(theElementType == "player" or theElementType == "ped" or theElementType == "object" or theElementType == "vehicle" or theElementType == "projectile", "Invalid element type @ getElementSpeed (player/ped/object/vehicle expected, got " .. theElementType .. ")")<br />
assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)")<br />
-- Default to m/s if no unit specified and 'ignore' argument type if the string contains a number<br />
unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit))<br />
-- Setup our multiplier to convert the velocity to the specified unit<br />
local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456)<br />
-- Return the speed by calculating the length of the velocity vector, after converting the velocity to the specified unit<br />
return (Vector3(getElementVelocity(theElement)) * mult).length<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
==Example==<br />
<section name="Clientside example" class="client" show="true"><br />
This example draws the local player's speed rounded to a single decimal in the up-right corner of the screen in different units.<br />
<syntaxhighlight lang="lua"><br />
local sx = guiGetScreenSize()<br />
local function drawSpeed()<br />
local speedms, speedkmh, speedmph = getElementSpeed(localPlayer), getElementSpeed(localPlayer, 1), getElementSpeed(localPlayer, 2)<br />
local roundedSpeedms, roundedSpeedkmh, roundedSpeedmph = math.floor(speedms) == speedms and speedms or string.format(speedms, "%.1f"), math.floor(speedkmh) == speedkmh and speedkmh or string.format(speedkmh, "%.1f"), math.floor(speedmph) == speedmph and speedmph or string.format(speedmph, "%.1f")<br />
local speedoText = "Current speed: " .. roundedSpeedms .. " m/s | " .. roundedSpeedkmh .. " km/h | " .. roundedSpeedmph .. " mph"<br />
dxDrawText(speedoText, sx - dxGetTextWidth(speedoText), 0)<br />
end<br />
addEventHandler("onClientPreRender", root, drawSpeed)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See also==<br />
{{Useful_Functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&diff=50550
Template:Useful Functions
2017-03-13T15:27:00Z
<p>AlexTMjugador: /* Data functions */</p>
<hr />
<div>=== ACL functions ===<br />
*[[aclGroupClone]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function clone a group to another group with/without ACLs and/or objects.</span><br />
*[[getPlayerAcls]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of all ACL groups on a player.</span><br />
*[[isPlayerInACL]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a player element is in an ACL group.</span><br />
*[[renameAclGroup]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gives an existing ACL group a new name.</span><br />
<br />
=== Account functions ===<br />
*[[setAccountName]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function is used to change an existing account's name.</span><br />
*[[removeAccountData]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function is used to remove data from account .</span><br />
<br />
=== Camera functions ===<br />
*[[smoothMoveCamera]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to create a cinematic camera flight.<br />
<br />
=== Cursor functions ===<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 />
<br />
=== Drawing functions ===<br />
*[[dxDrawAnimWindow]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws an animated 2D window on the screen.</span><br />
*[[dxDrawCircle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a number of 2D lines in order to achieve a circle shape on the screen.</span><br />
*[[dxDrawOctagon3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function creates a 3D Octagon</span><br />
*[[dxDrawTriangle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This is a function that will create a triangle with dx lines.</span><br />
*[[dxDrawLinedRectangle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This is a function that will create a rectangle outline with dx lines.</span><br />
*[[dxDrawBorderedRectangle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This is a function that will create a bordered rectangle .</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 in 2D.</span><br />
*[[dxDrawImage3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D image in GTA world.</span><br />
*[[dxDrawImageOnElement]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws an image on any element.</span><br />
*[[dxDrawLoading]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a loading bar on the screen.</span><br />
*[[dxDrawProgressBar]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function simulates a progress bar drawed using DirectDraw.</span><br />
*[[dxDrawRectangle3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D rectangle in GTA world.</span><br />
*[[dxDrawTextOnElement]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a text on any element.</span><br />
*[[dxGetFontSizeFromHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculates the font size from given height.</span><br />
*[[dxGetRealFontHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculates the height of a font.</span><br />
<br />
=== Effects functions ===<br />
*[[attachEffect]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you attach an effect to an element.</span><br />
<br />
=== Elements functions === <br />
*[[getElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the specified element's speed in m/s, km/h or mph.</span><br />
*[[getElementsInDimension]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of elements that are in the specified dimension.</span><br />
*[[getElementsWithinMarker]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of elements that are within a marker's collision shape.</span><br />
*[[isElementInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element is in the player's camera picture area.</span><br />
*[[isElementInRange]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to check if an element's range to a main point is within 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 />
*[[isElementWithinAColShape]]<span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element is within a collision shape element.</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 />
*[[setElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to set the speed of an element in kph or mph units.</span><br />
<br />
=== Events ===<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 vehicle's weapon.</span><br />
<br />
=== Input functions ===<br />
*[[bindControlKeys]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to bind each key bound to a control individually. Doing this bypasses a little MTA restriction.</span><br />
*[[getBoundControls]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of control names that are bound to the specified key.</span><br />
*[[unbindControlKeys]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to unbind each key bound to a control individually. Use this function with [[bindControlKeys]].</span><br />
<br />
=== Data functions === <br />
*[[Byte2human]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts an integer (number of bytes) into a human-readable unit.</span><br />
*[[capitalize]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function capitalizes a given string.</span><br />
*[[convertNumber]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts and formats large numbers.</span><br />
*[[convertServerTickToTimeStamp]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts server ticks to a unix timestamp.</span><br />
*[[convertTextToSpeech]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts the provided text to a speech in the provided language which players can hear.</span><br />
*[[findRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function 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;">» This function formats a date on the basis of a format string and returns it.</span><br />
*[[getRealMonthM]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gives you the real months name</span><br />
*[[getRealMonthH]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function convert english months to arabic months</span><br />
*[[generateString]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function generates a random string with any characters.</span><br />
*[[generateRandomASCIIString]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a random string which uses ASCII characters. </span><br />
*[[getAge]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculates the age of a given birthday.</span><br />
*[[getDistanceBetweenPointAndSegment2D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.</span><br />
*[[getEasterDate]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns easter date monthday and month for a given year.</span><br />
*[[getKeyFromValueInTable]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the key of the specified value in a table.</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 />
*[[getPointFromDistanceRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function finds a point based on a starting point, direction and distance.</span><br />
*[[getRGColorFromPercentage]] <span style="color:gray; font-family:'Georgia', sans-serif; font-size:smaller;">»This function returns two integers representing red and green colors according to the specified percentage.</span><br />
*[[getScreenRotationFromWorldPosition]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a screen relative rotation to a world position.</span><br />
*[[getTimestamp]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the UNIX timestamp of a specified date and time.</span><br />
*[[isLeapYear]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a boolean representing if a given year is a leap year.</span><br />
*[[isValidMail]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether a provided e-mail string is valid.</span><br />
*[[removeHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function is used to remove hexadecimal numbers (colors, for example) from strings.<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 client-side.</span><br />
*[[secondsToTimeDesc]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a plain seconds-integer into a user-friendly time description.</span><br />
*[[string.count]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function counts the amount of occurences of a string in a string.</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 allows the value of a variable or expression to control the flow of program execution via a multiway branch.</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 />
*[[wavelengthToRGBA]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a physical wavelength of light to a RGBA color.</span><br />
<br />
=== GUI functions === <br />
*[[centerWindow]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function centers a CEGUI window element responsively in any resolution.</span><br />
=====Comboboxes=====<br />
*[[guiComboBoxAdjustHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function adjusts a CEGUI combobox element to have the correct height.</span><br />
=====Gridlists=====<br />
*[[getGridListRowIndexFromText]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the GridList row index from the specified text.</span><br />
*[[guiGridListGetSelectedText]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a string containing the inner text of a selected gridlist item.</span><br />
*[[guiGridListAddPlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function add all online players to a grid list.</span><br />
*[[isTextInGridList]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if some text exist or not in the GridList.</span><br />
<br />
=== Math functions ===<br />
*[[mathNumber]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function is a workaround for the client-side floating-point precision of 24-bits.</span><br />
*[[math.hypot]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the Hypotenuse of the triangle given by sides x and y.</span><br />
*[[math.percent]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a percentage from two number values.</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 />
<br />
=== Ped functions ===<br />
*[[getAlivePlayers (Client)|getAlivePlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the alive players client-side.</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 />
*[[getOnlineAdmins]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of all logged-in administrators.</span><br />
*[[getPedMaxHealth]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a pedestrians's maximum health by converting it from their maximum health stat.</span><br />
*[[getPedMaxOxygenLevel]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a ped's maximum oxygen level by converting it from their maximum underwater stamina stat.</span><br />
*[[getPlayerFromNamePart]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a player from partial name.</span><br />
*[[getPlayerFromSerial]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a player from their serial.</span><br />
*[[getPlayersInGroup]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns all Players In Group .</span><br />
*[[getGuestPlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gets a players not login or players Guest .</span><br />
*[[getDimensionEmpty]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns id Dimension Empty .</span><br />
*[[getPlayersByData]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of players that have the specified data name.</span><br />
*[[getPlayersInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of all players in photograph.</span><br />
*[[isPedAiming]]<span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a pedestrian is aiming their weapon.</span><br />
*[[isPedDrivingVehicle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a specified pedestrian is driving a vehicle.</span><br />
*[[isPlayerInTeam]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a player is in a specified team.</span><br />
*[[isPedAimingNearPed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This is similar to isPedAiming but uses a colshape to be more precise.</span><br />
*[[getPedEyesPosition]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get peds eyes position.</span><br />
<br />
=== Resource functions ===<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 />
*[[getResourceScripts]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the resource scripts.</span><br />
*[[refreshResource]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function refreshes your resource if you changed any of the files<br />
<br />
=== Sound functions ===<br />
*[[isSoundFinished]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a sound element has finished.</span><br />
*[[stopSoundSlowly]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function stop your sound element slowly.</span><br />
<br />
=== Table functions ===<br />
*[[rangeToTable]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a string range to a table containing number values.</span><br />
*[[setTableProtected]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function protects a table and makes it read-only.</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 checks whether two given tables are equal.</span><br />
*[[table.empty]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether a table is empty.</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.merge]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function merges two or more tables together.</span><br />
*[[table.random]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function retrieves a random value from a table.</span><br />
*[[table.size]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the absolute size of a table.</span><br />
*[[table.removeValue]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function removes a specified value from a table.</span><br />
<br />
=== Team functions ===<br />
*[[getTeamFromColor]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a team element by the specified color.</span><br />
*[[getTeamWithFewestPlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a team element with least players of all the specified teams.</span><br />
<br />
=== Vehicle funcions === <br />
*[[getRandomVehicle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gets a random vehicle.</span><br />
*[[getValidVehicleModels]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of all valid vehicle models.</span><br />
*[[getVehicleRespawnPosition]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get the respawn position of a vehicle.</span><br />
*[[getVehiclesCountByType]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the amount of vehicles by the given type as an integer value.</span><br />
*[[isVehicleEmpty]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether a vehicle is empty.</span><br />
*[[isVehicleOccupied]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a specified vehicle is occupied.</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 />
*[[setVehicleGravityPoint]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.</span><br />
<br />
=== Weapon functions === <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 />
<br />
=== XML functions ===<br />
*[[getXMLNodes]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns all children of a XML node.</span><br />
<br />
=== Utility ===<br />
*[[Check]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if its arguments are of the right type and calls the error-function if one is not.</span><br />
*[[coroutine.resume]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function applies a fix for hidden coroutine error messages.</span><br />
*[[callClientFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to call any client-side 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 />
*[[createAnimation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to use interpolateBetween without render event and easily used.</span><br />
*[[getBanFromName]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This functions returns the ban of the given playername.</span><br />
*[[getCurrentFPS]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the frames per second at which GTA: SA is running.</span><br />
*[[IfElse]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns one of two values based on a boolean expression.</span><br />
*[[isCursorOnElement]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether the cursor is in a particular area.</span><br />
*[[isMouseInCircle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a cursor position is in circular area or not.</span><br />
*[[isMouseInPosition]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to check whether the mouse cursor/pointer is within a rectangular position.</span><br />
*[[iterElements]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns ''a time-saving'' iterator for your for-loops.</span><br />
*[[vector3:compare]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This method checks whether two vectors match, with optional precision.</span><br />
<br />
[[Category:Useful Functions]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=RemoveHex&diff=50549
RemoveHex
2017-03-13T15:25:39Z
<p>AlexTMjugador: Typo at /* Code */</p>
<hr />
<div>{{Useful Function}}<br />
<lowercasetitle></lowercasetitle><br />
__NOTOC__<br />
This function is used to remove hexadecimal numbers (expressed as ''#XXXX'') from strings.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">string removeHex ( string text [, int digits = math.huge ] )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''text''': The text from which you want to remove the hexadecimal numbers.<br />
<br />
===Optional Arguments===<br />
* '''digits''': The number of digits the hexadecimal numbers you want to remove have. If not specified, the function will remove every hexadecimal digit which follows a number sign (#).<br />
<br />
===Returns===<br />
Returns the modified string if the conversion was successful, ''false'' otherwise.<br />
<br />
==Code==<br />
<section name="Code" class="both" show="true"><br />
<syntaxhighlight lang="lua"><br />
function removeHex(text, digits)<br />
assert(type(text) == "string", "Bad argument 1 @ removeHex [String expected, got " .. tostring(text) .. "]")<br />
assert(digits == nil or (type(digits) == "number" and digits > 0), "Bad argument 2 @ removeHex [Number greater than zero expected, got " .. tostring(digits) .. "]")<br />
return string.gsub(text, "#" .. (digits and string.rep("%x", digits) or "%x+"), "")<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
==Example==<br />
<section name="Server" class="server" show="true"><br />
This example removes colors from player nicknames when they join the server.<br />
<syntaxhighlight lang="lua"><br />
function removeColorsFromNick()<br />
local name = getPlayerName(source)<br />
local new = removeHex(name, 6) -- RGB colors are 6 digits long<br />
if (new ~= name) then<br />
setPlayerName(source, new)<br />
end<br />
end<br />
addEventHandler("onPlayerJoin", root, removeColorsFromNick)<br />
</syntaxhighlight><br />
</section><br />
Author: Walid (modified by Ares)<br />
==See Also==<br />
{{Useful_Functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=RemoveHex&diff=50548
RemoveHex
2017-03-13T15:24:02Z
<p>AlexTMjugador: Removed unnecessary loop, improved function versatility and added stronger input checking</p>
<hr />
<div>{{Useful Function}}<br />
<lowercasetitle></lowercasetitle><br />
__NOTOC__<br />
This function is used to remove hexadecimal numbers (expressed as ''#XXXX'') from strings.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">string removeHex ( string text [, int digits = math.huge ] )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''text''': The text from which you want to remove the hexadecimal numbers.<br />
<br />
===Optional Arguments===<br />
* '''digits''': The number of digits the hexadecimal numbers you want to remove have. If not specified, the function will remove every hexadecimal digit which follows a number sign (#).<br />
<br />
===Returns===<br />
Returns the modified string if the conversion was successful, ''false'' otherwise.<br />
<br />
==Code==<br />
<section name="Code" class="both" show="true"><br />
<syntaxhighlight lang="lua"><br />
function removeHex(text, digits)<br />
assert(type(text) == "string", "Bad argument 1 @ removeHex [String expected, got " .. tostring(text) .. "]")<br />
assert(digits == nil or (type(digits) == "number" and digits > 0), "Bad argument 2 @ removeHex [Number greater than zero expected, got " .. tostring(digits) .. "]")<br />
return string.gsub(text, "#" .. (digits and string.rep("%x", digits) or "#%x+"), "")<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
==Example==<br />
<section name="Server" class="server" show="true"><br />
This example removes colors from player nicknames when they join the server.<br />
<syntaxhighlight lang="lua"><br />
function removeColorsFromNick()<br />
local name = getPlayerName(source)<br />
local new = removeHex(name, 6) -- RGB colors are 6 digits long<br />
if (new ~= name) then<br />
setPlayerName(source, new)<br />
end<br />
end<br />
addEventHandler("onPlayerJoin", root, removeColorsFromNick)<br />
</syntaxhighlight><br />
</section><br />
Author: Walid (modified by Ares)<br />
==See Also==<br />
{{Useful_Functions}}</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Client_Commands&diff=50546
Client Commands
2017-03-13T14:42:39Z
<p>AlexTMjugador: Typo</p>
<hr />
<div>This page lists all built in commands that the client can process. These commands can be entered directly to the client console or via the chatbox by putting a / (forward slash) in front of them. Some [[Server_Commands|server commands]] are also accessible from the client. Arguments inside [...] are optional.<br />
<br />
<br />
==Core commands==<br />
====help====<br />
:Displays these list of commands<br />
====exit====<br />
:Exits the application<br />
====quit====<br />
:Exits the application<br />
====ver====<br />
:Outputs the MTA version in the client console<br />
====time====<br />
:Outputs the local time in the chatbox<br />
====showhud====<br />
:Usage: showhud [''<''0-1''>'']<br />
:Shows the HUD<br />
====binds====<br />
:Outputs all the binds in the client console<br />
====serial====<br />
:Outputs your serial in the client console<br />
<br />
====connect====<br />
:Usage: connect ''<host> <port>'' [''<nick> <pass>'']<br />
:Connects to a server<br />
====reconnect====<br />
:Connects to a previous server<br />
====bind====<br />
:Usage: bind ''<defaults/key>'' [''<up/down>''] ''<command>'' [''<arguments>'']<br />
:Binds a key<br />
::Example to bind X to hiding the HUD: '''bind x down showhud 0'''<br />
::Example to reset all binds: '''bind defaults'''<br />
====unbind====<br />
:Usage: unbind ''<all/key>'' [''<up/down> <command>'']<br />
:Unbinds a key<br />
::Example to unbind X to from hiding the HUD: '''unbind x down showhud 0'''<br />
::Example to unbind all commands from X: '''unbind x'''<br />
====copygtacontrols====<br />
:Copies the default gta controls - This may require a restart to work properly<br />
====screenshot====<br />
:Saves a screenshot<br />
====saveconfig====<br />
:Immediately saves the config<br />
<br />
<br />
==Commands when connected to a server==<br />
====fakelag====<br />
{{Main|Command fakelag}}<br />
:Usage: fakelag ''<packet loss>'' ''<extra ping>'' ''<ping variance>'' [''<KBPS limit>'']<br />
:'''Only available if enabled by the server.'''<br />
:Adds artificial packet loss, ping, jitter and bandwidth limits to the client-server connection.<br />
====sinfo====<br />
:Prints information and settings for the current server into the client console<br />
====disconnect====<br />
:Disconnect from the server and return to the main menu<br />
====shownametags====<br />
:Usage: shownametags [''<''0-1''>'']<br />
:Shows the nametags<br />
====showchat====<br />
:Usage: showchat [''<''0-1''>'']<br />
:Shows the chatbox<br />
====shownetstat====<br />
:Usage: shownetstat [''<''0-1''>'']<br />
:Shows the network statistics <br />
====showmemstat====<br />
:Usage: showmemstat [''<''0-1''>'']<br />
:Shows the memory statistics <br />
====showframegraph====<br />
:Usage: showframegraph [''<''0-1''>'']<br />
:Shows the frame rate history graph <br />
====chatbox====<br />
:Usage: chatbox ''<''0-255''>'' ''<''0-255''>'' ''<''0-255''>''<br />
:Defines the chatbox color<br />
====textscale====<br />
:Usage: textscale ''<''0.8 to 3.0''>''<br />
:Defines the scale multiplier of all text-displays<br />
====showcol====<br />
:Usage: showcol [''<''0-1''>'']<br />
:Shows colshapes in wireframe for help when writing scripts<br />
:Only works in development mode.<br />
:More information: [[setDevelopmentMode]]<br />
====showsound====<br />
:Usage: showsound [''<''0-1''>'']<br />
:Prints world sound ids in the debug output windows to help when writing scripts with [[setWorldSoundEnabled]]<br />
:Only works in development mode.<br />
:More information: [[setDevelopmentMode]]<br />
<br />
==Commands for key binds==<br />
====cleardebug====<br />
:Clears the debug view<br />
====chatscrollup====<br />
:Usage: chatscrollup 1 <br />
:Scrolls the chatbox upwards<br />
====chatscrolldown====<br />
:Usage: chatscrolldown -1 <br />
:Scrolls the chatbox downwards<br />
====debugscrollup====<br />
:Usage: debugscrollup 1 <br />
:Scrolls the debug view upwards<br />
====debugscrolldown====<br />
:Usage: debugscrolldown -1 <br />
:Scrolls the debug view downwards<br />
====voiceptt====<br />
:Transmits voice to other players<br />
====enter_passenger====<br />
:Enters a car as passenger<br />
====radio_next====<br />
:Next radio channel<br />
====radio_previous====<br />
:Previous radio channel<br />
====radar====<br />
:Usage: radar [''<''0-1''>''] <br />
:Shows the radar view<br />
====radar_zoom_in====<br />
:Zooms the radar in<br />
====radar_zoom_out====<br />
:Zooms the radar out<br />
====radar_move_north====<br />
:Moves the radar north<br />
====radar_move_south====<br />
:Moves the radar south<br />
====radar_move_east====<br />
:Moves the radar east<br />
====radar_move_west====<br />
:Moves the radar west<br />
====radar_attach====<br />
:Attaches the radar <br />
====msg_target====<br />
:Usage: msg_target ''<text>'' <br />
:Sends a message to the targeted player<br />
====vehicle_next_weapon====<br />
:Changes to the next weapon whilst in a vehicle<br />
====vehicle_previous_weapon====<br />
:Changes to the previous weapon whilst in a vehicle<br />
====radio_next====<br />
:Selects the next radio station<br />
====radio_previous====<br />
:Selects the previous radio station<br />
<br />
[[Category: Support]]<br />
[[ru:Client Commands]]<br />
[[hu:Client Commands]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Server_Commands&diff=50545
Server Commands
2017-03-13T14:42:37Z
<p>AlexTMjugador: Typos</p>
<hr />
<div>This page lists all built in commands that the server can process. All these commands can be entered via the server console or the client console depending upon permissions unless otherwise stated.<br />
<br />
<br />
==Resource commands==<br />
====check====<br />
:<ins>Server console only</ins><br />
:Usage: check [ ''all'' | ''<resource-name>'' ]<br><br />
:Checks which files would be changed with [[Server_Commands#upgrade|upgrade]] command. Does not modify anything.<br />
====info====<br />
:<ins>Server console only</ins><br />
:Usage: info ''<resource-name>''<br><br />
:Get info for a resource eg: info admin<br />
====list====<br />
:<ins>Server console only</ins><br />
:Shows a list of resources<br />
<br />
====refresh====<br />
:Refresh resource list to find new resources<br />
====refreshall====<br />
:Refresh resources and restart any changed resources<br />
====restart====<br />
:Usage: info ''<resource-name>''<br><br />
:Restarts a running resource eg: restart admin<br />
====start====<br />
:Usage: start ''<resource-name>''<br><br />
:Start a loaded resource eg: start admin<br />
====stop====<br />
:Usage: stop ''<resource-name>''<br><br />
:Stop a resource eg: stop admin<br />
====stopall====<br />
:Stop all running resources<br />
====upgrade====<br />
:<ins>Server console only</ins><br />
:Usage: upgrade [ ''all'' | ''<resource-name>'' ]<br><br />
:Perform a basic upgrade of all resources. The [[Server_Commands#check|check]] command shows the list of changes this command will make.<br />
<br />
====aclrequest====<br />
:Usage: aclrequest [ ''list'' | ''allow'' | ''deny'' ] ''<resource-name>'' [ ''<right>'' | ''all'' ]<br><br />
:Manage ACL requests from resources implementing <aclrequest> in their [[meta.xml]]<br />
<br />
<br />
==Account commands==<br />
====aexec====<br />
:Usage: aexec ''<nick>'' ''<command>''<br><br />
:Force a player to execute a command eg: aexec playername say hello<br />
<br />
====addaccount====<br />
:Usage: addaccount ''<accountname>'' ''<password>''<br><br />
:Add an account eg: addaccount accountname password<br />
<br />
====chgpass====<br />
:Usage: chgpass ''<accountname>'' ''<password>''<br><br />
:Change an accounts password eg: chgpass account newpw<br />
====delaccount====<br />
:Usage: delaccount ''<accountname>''<br><br />
:Delete an account eg: delaccount accountname<br />
<br />
<br />
==Server commands==<br />
====ase====<br />
:<ins>Server console only</ins><br />
:See the amount of master server list queries<br />
====debugdb====<br />
:Usage: debugdb ''<''0-2''>''<br><br />
:<ins>Server console only</ins><br />
:Set logging level for database functions. [0-Off &nbsp;1-Errors only &nbsp;2-All]<br />
:By default, logging output is written to the file '''logs/db.log''' unless another file is declared in the [[Mtaserver.conf#dbfile|<dbfile> section of mtaserver.conf]]<br />
====help====<br />
:<ins>Server console only</ins><br />
:Displays these list of commands<br />
====loadmodule====<br />
:<ins>Server console only</ins><br />
:Usage: loadmodule ''<module-filename>''<br><br />
:Load a module eg: loadmodule ml_sockets.dll<br />
====unloadmodule====<br />
:<ins>Server console only</ins><br />
:Usage: unloadmodule ''<module-filename>''<br><br />
:Unload a module eg: unloadmodule ml_sockets.dll<br />
====reloadmodule====<br />
:<ins>Server console only</ins><br />
:Usage: reloadmodule ''<module-filename>''<br><br />
:Reload a module eg: reloadmodule ml_sockets.dll<br />
====openports====<br />
:<ins>Server console only</ins><br />
:Test if server ports are open<br />
====sfakelag====<br />
{{Main|Command fakelag}}<br />
:Usage: sfakelag ''<packet loss>'' ''<extra ping>'' ''<ping variance>'' [''<KBPS limit>'']<br />
:'''Only available if enabled in the [[mtaserver.conf]] file.'''<br />
:Adds artificial packet loss, ping, jitter and bandwidth limits to the server-client connections.<br />
====shutdown====<br />
:Usage: shutdown ''<reason>''<br><br />
:Shutdown the server eg: shutdown put reason here<br />
====sver====<br />
:Get the server MTA version<br />
<br />
<br />
==Other commands==<br />
====say====<br />
:Usage: say ''<text>''<br><br />
:Show a message to all players on the server eg: say hello<br />
====whois====<br />
:Usage: whois ''<nick>''<br><br />
:Get the IP of a player currently connected (use whowas for IP/serial/version)<br />
====whowas====<br />
:Usage: whowas ''<nick>''<br><br />
:Get IP/Serial/username of a player that was previously connected to the server<br />
====ver====<br />
:Get the MTA version<br />
<br />
<br />
==Client relevant only==<br />
====chgmypass====<br />
:<ins>Client only</ins><br />
:Usage: chgmypass ''<oldpass>'' ''<newpass>''<br><br />
:Change your password eg: chgmypass oldpw newpw<br />
====debugscript====<br />
:<ins>Client only</ins><br />
:Usage: debugscript ''<''0-3''>''<br><br />
:Remove (This does not work "Incorrect client type for this command")<br />
====login====<br />
:<ins>Client only</ins><br />
:Usage: login ''<accountname>'' ''<password>''<br><br />
:Login to an account eg: login accountname password<br />
<br />
====logout====<br />
:<ins>Client only</ins><br />
:Log out of the current account<br />
====me====<br />
:<ins>Client only</ins><br />
:Usage: me ''<text>''<br><br />
:Show a message to all players on the server, with your nick prepended<br />
====msg====<br />
:<ins>Client only</ins><br />
:Usage: msg ''<nick>'' ''<text>''<br><br />
:Send a message to a player eg: msg playername hello<br />
====nick====<br />
:<ins>Client only</ins><br />
:Usage: nick ''<old-nick>'' ''<new-nick>''<br><br />
:Change your ingame nickname<br />
====teamsay====<br />
:<ins>Client only</ins><br />
:Usage: teamsay ''<test>''<br><br />
:Send a message to all players on the same team<br />
<br />
[[Category: Support]]<br />
[[ru:Server Commands]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Server_Commands&diff=50544
Server Commands
2017-03-13T14:40:42Z
<p>AlexTMjugador: Added sfakelag to the list</p>
<hr />
<div>This page lists all built in commands that the server can process. All these commands can be entered via the server console or the client console depending upon permissions unless otherwise stated.<br />
<br />
<br />
==Resource commands==<br />
====check====<br />
:<ins>Server console only</ins><br />
:Usage: check [ ''all'' | ''<resource-name>'' ]<br><br />
:Checks which files would be changed with [[Server_Commands#upgrade|upgrade]] command. Does not modify anything.<br />
====info====<br />
:<ins>Server console only</ins><br />
:Usage: info ''<resource-name>''<br><br />
:Get info for a resource eg: info admin<br />
====list====<br />
:<ins>Server console only</ins><br />
:Shows a list of resources<br />
<br />
====refresh====<br />
:Refresh resource list to find new resources<br />
====refreshall====<br />
:Refresh resources and restart any changed resources<br />
====restart====<br />
:Usage: info ''<resource-name>''<br><br />
:Restarts a running resource eg: restart admin<br />
====start====<br />
:Usage: start ''<resource-name>''<br><br />
:Start a loaded resource eg: start admin<br />
====stop====<br />
:Usage: stop ''<resource-name>''<br><br />
:Stop a resource eg: stop admin<br />
====stopall====<br />
:Stop all running resources<br />
====upgrade====<br />
:<ins>Server console only</ins><br />
:Usage: upgrade [ ''all'' | ''<resource-name>'' ]<br><br />
:Perform a basic upgrade of all resources. The [[Server_Commands#check|check]] command shows the list of changes this command will make.<br />
<br />
====aclrequest====<br />
:Usage: aclrequest [ ''list'' | ''allow'' | ''deny'' ] ''<resource-name>'' [ ''<right>'' | ''all'' ]<br><br />
:Manage ACL requests from resources implementing <aclrequest> in their [[meta.xml]]<br />
<br />
<br />
==Account commands==<br />
====aexec====<br />
:Usage: aexec ''<nick>'' ''<command>''<br><br />
:Force a player to execute a command eg: aexec playername say hello<br />
<br />
====addaccount====<br />
:Usage: addaccount ''<accountname>'' ''<password>''<br><br />
:Add an account eg: addaccount accountname password<br />
<br />
====chgpass====<br />
:Usage: chgpass ''<accountname>'' ''<password>''<br><br />
:Change an accounts password eg: chgpass account newpw<br />
====delaccount====<br />
:Usage: delaccount ''<accountname>''<br><br />
:Delete an account eg: delaccount accountname<br />
<br />
<br />
==Server commands==<br />
====ase====<br />
:<ins>Server console only</ins><br />
:See the amount of master server list queries<br />
====debugdb====<br />
:Usage: debugdb ''<''0-2''>''<br><br />
:<ins>Server console only</ins><br />
:Set logging level for database functions. [0-Off &nbsp;1-Errors only &nbsp;2-All]<br />
:By default, logging output is written to the file '''logs/db.log''' unless another file is declared in the [[Mtaserver.conf#dbfile|<dbfile> section of mtaserver.conf]]<br />
====help====<br />
:<ins>Server console only</ins><br />
:Displays these list of commands<br />
====loadmodule====<br />
:<ins>Server console only</ins><br />
:Usage: loadmodule ''<module-filename>''<br><br />
:Load a module eg: loadmodule ml_sockets.dll<br />
====unloadmodule====<br />
:<ins>Server console only</ins><br />
:Usage: unloadmodule ''<module-filename>''<br><br />
:Unload a module eg: unloadmodule ml_sockets.dll<br />
====reloadmodule====<br />
:<ins>Server console only</ins><br />
:Usage: reloadmodule ''<module-filename>''<br><br />
:Reload a module eg: reloadmodule ml_sockets.dll<br />
====openports====<br />
:<ins>Server console only</ins><br />
:Test if server ports are open<br />
====sfakelag====<br />
{{Main|Command fakelag}}<br />
:Usage: sfakelag ''<packet loss>'' ''<extra ping>'' ''<ping variance>'' [''<KBPS limit>'']<br />
:'''Only available if enabled in the [[mtaserver.conf]] file.'''.<br />
:Adds artificial packet loss, ping, jitter and bandwith limits to the server-client connections.<br />
====shutdown====<br />
:Usage: shutdown ''<reason>''<br><br />
:Shutdown the server eg: shutdown put reason here<br />
====sver====<br />
:Get the server MTA version<br />
<br />
<br />
==Other commands==<br />
====say====<br />
:Usage: say ''<text>''<br><br />
:Show a message to all players on the server eg: say hello<br />
====whois====<br />
:Usage: whois ''<nick>''<br><br />
:Get the IP of a player currently connected (use whowas for IP/serial/version)<br />
====whowas====<br />
:Usage: whowas ''<nick>''<br><br />
:Get IP/Serial/username of a player that was previously connected to the server<br />
====ver====<br />
:Get the MTA version<br />
<br />
<br />
==Client relevant only==<br />
====chgmypass====<br />
:<ins>Client only</ins><br />
:Usage: chgmypass ''<oldpass>'' ''<newpass>''<br><br />
:Change your password eg: chgmypass oldpw newpw<br />
====debugscript====<br />
:<ins>Client only</ins><br />
:Usage: debugscript ''<''0-3''>''<br><br />
:Remove (This does not work "Incorrect client type for this command")<br />
====login====<br />
:<ins>Client only</ins><br />
:Usage: login ''<accountname>'' ''<password>''<br><br />
:Login to an account eg: login accountname password<br />
<br />
====logout====<br />
:<ins>Client only</ins><br />
:Log out of the current account<br />
====me====<br />
:<ins>Client only</ins><br />
:Usage: me ''<text>''<br><br />
:Show a message to all players on the server, with your nick prepended<br />
====msg====<br />
:<ins>Client only</ins><br />
:Usage: msg ''<nick>'' ''<text>''<br><br />
:Send a message to a player eg: msg playername hello<br />
====nick====<br />
:<ins>Client only</ins><br />
:Usage: nick ''<old-nick>'' ''<new-nick>''<br><br />
:Change your ingame nickname<br />
====teamsay====<br />
:<ins>Client only</ins><br />
:Usage: teamsay ''<test>''<br><br />
:Send a message to all players on the same team<br />
<br />
[[Category: Support]]<br />
[[ru:Server Commands]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Client_Commands&diff=50543
Client Commands
2017-03-13T14:40:38Z
<p>AlexTMjugador: Added fakelag to the list</p>
<hr />
<div>This page lists all built in commands that the client can process. These commands can be entered directly to the client console or via the chatbox by putting a / (forward slash) in front of them. Some [[Server_Commands|server commands]] are also accessible from the client. Arguments inside [...] are optional.<br />
<br />
<br />
==Core commands==<br />
====help====<br />
:Displays these list of commands<br />
====exit====<br />
:Exits the application<br />
====quit====<br />
:Exits the application<br />
====ver====<br />
:Outputs the MTA version in the client console<br />
====time====<br />
:Outputs the local time in the chatbox<br />
====showhud====<br />
:Usage: showhud [''<''0-1''>'']<br />
:Shows the HUD<br />
====binds====<br />
:Outputs all the binds in the client console<br />
====serial====<br />
:Outputs your serial in the client console<br />
<br />
====connect====<br />
:Usage: connect ''<host> <port>'' [''<nick> <pass>'']<br />
:Connects to a server<br />
====reconnect====<br />
:Connects to a previous server<br />
====bind====<br />
:Usage: bind ''<defaults/key>'' [''<up/down>''] ''<command>'' [''<arguments>'']<br />
:Binds a key<br />
::Example to bind X to hiding the HUD: '''bind x down showhud 0'''<br />
::Example to reset all binds: '''bind defaults'''<br />
====unbind====<br />
:Usage: unbind ''<all/key>'' [''<up/down> <command>'']<br />
:Unbinds a key<br />
::Example to unbind X to from hiding the HUD: '''unbind x down showhud 0'''<br />
::Example to unbind all commands from X: '''unbind x'''<br />
====copygtacontrols====<br />
:Copies the default gta controls - This may require a restart to work properly<br />
====screenshot====<br />
:Saves a screenshot<br />
====saveconfig====<br />
:Immediately saves the config<br />
<br />
<br />
==Commands when connected to a server==<br />
====fakelag====<br />
{{Main|Command fakelag}}<br />
:Usage: fakelag ''<packet loss>'' ''<extra ping>'' ''<ping variance>'' [''<KBPS limit>'']<br />
:'''Only available if enabled by the server'''.<br />
:Adds artificial packet loss, ping, jitter and bandwith limits to the client-server connection.<br />
====sinfo====<br />
:Prints information and settings for the current server into the client console<br />
====disconnect====<br />
:Disconnect from the server and return to the main menu<br />
====shownametags====<br />
:Usage: shownametags [''<''0-1''>'']<br />
:Shows the nametags<br />
====showchat====<br />
:Usage: showchat [''<''0-1''>'']<br />
:Shows the chatbox<br />
====shownetstat====<br />
:Usage: shownetstat [''<''0-1''>'']<br />
:Shows the network statistics <br />
====showmemstat====<br />
:Usage: showmemstat [''<''0-1''>'']<br />
:Shows the memory statistics <br />
====showframegraph====<br />
:Usage: showframegraph [''<''0-1''>'']<br />
:Shows the frame rate history graph <br />
====chatbox====<br />
:Usage: chatbox ''<''0-255''>'' ''<''0-255''>'' ''<''0-255''>''<br />
:Defines the chatbox color<br />
====textscale====<br />
:Usage: textscale ''<''0.8 to 3.0''>''<br />
:Defines the scale multiplier of all text-displays<br />
====showcol====<br />
:Usage: showcol [''<''0-1''>'']<br />
:Shows colshapes in wireframe for help when writing scripts<br />
:Only works in development mode.<br />
:More information: [[setDevelopmentMode]]<br />
====showsound====<br />
:Usage: showsound [''<''0-1''>'']<br />
:Prints world sound ids in the debug output windows to help when writing scripts with [[setWorldSoundEnabled]]<br />
:Only works in development mode.<br />
:More information: [[setDevelopmentMode]]<br />
<br />
==Commands for key binds==<br />
====cleardebug====<br />
:Clears the debug view<br />
====chatscrollup====<br />
:Usage: chatscrollup 1 <br />
:Scrolls the chatbox upwards<br />
====chatscrolldown====<br />
:Usage: chatscrolldown -1 <br />
:Scrolls the chatbox downwards<br />
====debugscrollup====<br />
:Usage: debugscrollup 1 <br />
:Scrolls the debug view upwards<br />
====debugscrolldown====<br />
:Usage: debugscrolldown -1 <br />
:Scrolls the debug view downwards<br />
====voiceptt====<br />
:Transmits voice to other players<br />
====enter_passenger====<br />
:Enters a car as passenger<br />
====radio_next====<br />
:Next radio channel<br />
====radio_previous====<br />
:Previous radio channel<br />
====radar====<br />
:Usage: radar [''<''0-1''>''] <br />
:Shows the radar view<br />
====radar_zoom_in====<br />
:Zooms the radar in<br />
====radar_zoom_out====<br />
:Zooms the radar out<br />
====radar_move_north====<br />
:Moves the radar north<br />
====radar_move_south====<br />
:Moves the radar south<br />
====radar_move_east====<br />
:Moves the radar east<br />
====radar_move_west====<br />
:Moves the radar west<br />
====radar_attach====<br />
:Attaches the radar <br />
====msg_target====<br />
:Usage: msg_target ''<text>'' <br />
:Sends a message to the targeted player<br />
====vehicle_next_weapon====<br />
:Changes to the next weapon whilst in a vehicle<br />
====vehicle_previous_weapon====<br />
:Changes to the previous weapon whilst in a vehicle<br />
====radio_next====<br />
:Selects the next radio station<br />
====radio_previous====<br />
:Selects the previous radio station<br />
<br />
[[Category: Support]]<br />
[[ru:Client Commands]]<br />
[[hu:Client Commands]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&diff=49752
Server mtaserver.conf
2016-11-03T14:56:12Z
<p>AlexTMjugador: </p>
<hr />
<div>This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.<br />
<br />
<br />
====servername====<br />
:''<servername>Default MTA Server</servername>''<br />
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter.<br />
<br />
====serverip====<br />
:''<serverip></serverip><br />
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''<br />
:It is generally only needed for professional servers and should be left blank otherwise. This parameter specifies the IP to use for servers that have multiple IP addresses. If left blank, it will default to server's standard local IP address.<br />
:SERVERIP SHOULD BE LEFT BLANK UNLESS YOU ARE SURE OF WHAT YOU ARE DOING<br />
:People who set this and then ask for support will be the first ones against the wall when the revolution comes<br />
<br />
====serverport====<br />
:''<serverport>22003</serverport> <br />
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;<br />
:default value: 22003. It is a required parameter.<br />
<br />
====maxplayers====<br />
:''<maxplayers>32</maxplayers><br />
:This parameter specifies the number of maximum player slots available on the server;<br />
:default value: 32. It is a required parameter.<br />
<br />
====httpserver====<br />
:''<httpserver>1</httpserver><br />
:This parameter specifies whether the builtin http server will be used.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.<br />
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]<br />
<br />
====httpport====<br />
:''<httpport>22005</httpport><br />
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as <serverport>. It is a required parameter if <httpserver> is set to 1.<br />
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]<br />
<br />
====httpdownloadurl====<br />
:''<httpdownloadurl></httpdownloadurl><br />
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.<br />
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]<br />
<br />
====httpmaxconnectionsperclient====<br />
:''<httpmaxconnectionsperclient>5</httpmaxconnectionsperclient><br />
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.<br />
:Available range: 1 to 8.<br />
<br />
====httpdosthreshold====<br />
:''<httpdosthreshold>20</httpdosthreshold><br />
:This parameter limits the number http connections that an IP can initiate over a short period of time.<br />
:Available range: 1 to 100. default value: 20<br />
<br />
{{New feature/item|3.0136|1.3.5|6301|<br />
====http_dos_exclude====<br />
:''<http_dos_exclude></http_dos_exclude><br />
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.<br />
:e.g. 88.11.22.33,101.2.3.4<br />
}}<br />
<br />
====allow_gta3_img_mods====<br />
:''<allow_gta3_img_mods>none</allow_gta3_img_mods><br />
:By default, the server will block the use of locally customized gta3.img player skins. <br />
:This setting can be used to allow such mods. Not recommended for competitive servers.<br />
:Values: none or peds ; default value: none<br />
:'''From server version 1.4.1-9.07268<br />
<br />
====client_file====<br />
:''<nowiki><!-- <client_file name="data/carmods.dat" verify="0" /> --></nowiki><br />
:By default, the server will block the use of customized GTA:SA data files.<br />
:To allow specific client files, add one or more of the above lines.<br />
:More information: [[Anti-cheat_guide|Anti-cheat guide]]<br />
<br />
====disableac====<br />
:''<disableac></disableac><br />
:Comma seperated list of disabled anti-cheats.<br />
:e.g. To disable anti-cheat #2 and #3, use: 2,3<br />
:More information: [[Anti-cheat_guide|Anti-cheat guide]]<br />
<br />
====enablesd====<br />
:''<enablesd></enablesd><br />
:Comma seperated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. Competitive servers may wish to enable special detections, but most servers should leave this setting blank.<br />
:e.g. To enable special detection #12 (disallow custom D3D9.DLL) use: 12<br />
:More information: [[Anti-cheat_guide|Anti-cheat guide]]<br />
<br />
====networkencryption====<br />
:''<networkencryption>1</networkencryption><br />
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====minclientversion====<br />
:''<minclientversion></minclientversion><br />
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.1.0-9.03100.0<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''<br />
<br />
{{New feature/item|3.0136|1.3.4|6023|<br />
====minclientversion_auto_update====<br />
:''<minclientversion_auto_update></minclientversion_auto_update><br />
:This parameter specifies if/when the <minclientversion> setting is automatically updated.<br />
:Keeping <minclientversion> updated can help reduce cheating.<br />
:Note: The instant setting (2) is only recommened for competitive servers.<br />
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.<br />
}}<br />
<br />
====recommendedclientversion====<br />
:''<recommendedclientversion></recommendedclientversion><br />
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''<br />
<br />
====ase====<br />
:''<ase>1</ase><br />
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the ingame server browser. An additional UDP port needs to be available for this to work (value from <serverport> + 123 , so on a default <serverport> value 22003 the right port will be 22126 ).<br />
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.<br />
<br />
====donotbroadcastlan====<br />
:''<donotbroadcastlan>0</donotbroadcastlan><br />
:This parameter allows you to disable LAN broadcasting. <br />
<br />
====password====<br />
:''<password></password> <br />
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.<br />
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]<br />
<br />
====bandwidth_reduction====<br />
:''<bandwidth_reduction>medium</bandwidth_reduction> <br />
:This parameter reduces the server's bandwidth usage by using various optimizations.<br />
:Values: none, medium or maximum ; default value: medium<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====player_sync_interval====<br />
:''<player_sync_interval>100</player_sync_interval> <br />
:This parameter determines the time in milliseconds between player sync packets.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====lightweight_sync_interval====<br />
:''<lightweight_sync_interval>1500</lightweight_sync_interval> <br />
:This parameter determines the time in milliseconds between lightweight (player) sync packets.<br />
:Available range: 200 - 40000; default value: 1500<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====camera_sync_interval====<br />
:''<camera_sync_interval>500</camera_sync_interval> <br />
:This parameter determines the time in milliseconds between camera sync packets.<br />
:Available range: 200 - 400; default value: 500<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====ped_sync_interval====<br />
:''<ped_sync_interval>400</ped_sync_interval> <br />
:This parameter determines the time in milliseconds between ped sync packets.<br />
:Available range: 200 - 4000; default value: 400<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====unoccupied_vehicle_sync_interval====<br />
:''<unoccupied_vehicle_sync_interval>1000</unoccupied_vehicle_sync_interval> <br />
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.<br />
:Available range: 200 - 4000; default value: 1000<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====keysync_mouse_sync_interval====<br />
:''<keysync_mouse_sync_interval>100</keysync_mouse_sync_interval> <br />
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====keysync_analog_sync_interval====<br />
:''<keysync_analog_sync_interval>100</keysync_analog_sync_interval> <br />
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====bullet_sync====<br />
:''<bullet_sync>0</bullet_sync> <br />
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.<br />
:'''It only works on server build 4247 or later, and when enabled, connecting clients will be auto-updated if required.'''<br />
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 0.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====vehext_percent====<br />
:''<vehext_percent>0</vehext_percent><br />
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. <br />
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.<br />
:Depending on the gamemode, an incorrect prediction may have a negative effect. <br />
:Therefore this setting should be considered expermental.<br />
:'''It only works on server build 4456 or later.'''<br />
:Available range: 0 to 100. Default - 0 --><br />
<br />
====vehext_ping_limit====<br />
:''<vehext_ping_limit>150</vehext_ping_limit><br />
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.<br />
:Only relevant if <vehext_percent> is greater than zero.<br />
:'''It only works on server build 4456 or later.'''<br />
:Available range: 50 to 500. Default - 150<br />
<br />
====latency_reduction====<br />
:''<latency_reduction>0</latency_reduction><br />
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).<br />
:Due to the impact this may have on shot lag compensation, it should be considered experimental.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 0.<br />
:Bugs caused by enabling latency_reduction: http://bugs.mtasa.com/view.php?id=8191 + http://bugs.mtasa.com/view.php?id=8226<br />
<br />
====threadnet====<br />
:''<threadnet>1</threadnet> <br />
:This parameter specifies whether or not to run the network synchronization on another thread.<br />
:Enabling will make the sync smoother, but may increase cpu usage slightly.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====idfile====<br />
:''<idfile>server-id.keys</idfile> <br />
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. <br />
:Keep a backup of this file in a safe place. Default value: server-id.keys<br />
:More information about client private files: [[Filepath]]<br />
<br />
====logfile====<br />
:''<logfile>logs/server.log</logfile><br />
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.<br />
<br />
====authfile====<br />
:''<authfile>logs/server_auth.log</authfile><br />
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used<br />
<br />
====dbfile====<br />
:''<dbfile>logs/db.log</dbfile><br />
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.<br />
<br />
{{New feature/item|3.0136|1.3.4|5809|<br />
====loadstringfile====<br />
:''<!-- <loadstringfile>logs/loadstring.log</loadstringfile> --><br />
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.<br />
}}<br />
<br />
====acl====<br />
:''<acl>acl.xml</acl> <br />
:This parameter specifies the location and name of the Access Control List settings file. If left<br />
:blank, server will use acl.xml file, located in the same folder as this configuration file.<br />
<br />
====scriptdebuglogfile====<br />
:''<scriptdebuglogfile>logs/scripts.log</scriptdebuglogfile> <br />
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.<br />
<br />
====scriptdebugloglevel====<br />
:''<scriptdebugloglevel>0</scriptdebugloglevel><br />
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.<br />
<br />
====fpslimit====<br />
:''<fpslimit>36</fpslimit><br />
:Specifies the frame rate limit that will be applied to connecting clients.<br />
:Available range: 25 to 100. Default: 36.<br />
:When running the map editor locally (i.e. from the client), the default FPS limit is 50.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====voice====<br />
:''<voice>0</voice><br />
:This parameter specifies whether or not to enable player voice chat in-game<br />
:Values: 0 - disabled , 1 - enabled<br />
<br />
====voice_samplerate====<br />
:''<voice_samplerate>1</voice_samplerate><br />
:This parameter specifies the sample rate for voice chat. 'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat<br />
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz). Default - 1<br />
<br />
====voice_quality====<br />
:''<voice_quality>4</voice_quality><br />
:This parameter specifies the voice quality for voice chat. 'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat<br />
:Available range: 0 to 10. Default - 4<br />
<br />
====voice_bitrate====<br />
:''<nowiki><!-- <voice_bitrate>24600</voice_bitrate> --></nowiki><br />
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically. Use with care.<br />
<br />
====backup_path====<br />
:''<backup_path>backups</backup_path><br />
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups<br />
<br />
====backup_interval====<br />
:''<backup_interval>3</backup_interval><br />
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups<br />
:Available range: 0 to 30. Default - 3<br />
<br />
====backup_copies====<br />
:''<backup_copies>5</backup_copies><br />
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups<br />
:Available range: 0 to 100. Default - 5<br />
<br />
{{New feature/item|3.0136|1.3.4|5950|<br />
====compact_internal_databases====<br />
:''<compact_internal_databases>1</compact_internal_databases><br />
:This parameter specifies when the internal sqlite databases should be defragmented. Details: http://www.sqlite.org/lang_vacuum.html<br />
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always. Default - 1<br />
}}<br />
<br />
====module====<br />
:''<nowiki><!-- <module src="sample_win32.dll"/> --></nowiki><br />
:''<nowiki><!-- <module src="sample_linux.so"/> --></nowiki><br />
:Specifies the module(s) which are loaded with the server. To load several modules, add more <module> parameter(s). Optional parameter.<br />
<br />
====resource====<br />
:''<resource src="admin" startup="1" protected="0"/><br />
:''<resource src="defaultstats" startup="1" protected="0"/><br />
:''<resource src="helpmanager" startup="1" protected="0"/><br />
:''<resource src="joinquit" startup="1" protected="0"/><br />
:''<resource src="mapcycler" startup="1" protected="0"/><br />
:''<resource src="mapmanager" startup="1" protected="0"/><br />
:''<resource src="parachute" startup="1" protected="0"/><br />
:''<resource src="resourcebrowser" startup="1" protected="1" default="true"/><br />
:''<resource src="resourcemanager" startup="1" protected="1"/><br />
:''<resource src="scoreboard" startup="1" protected="0"/><br />
:''<resource src="spawnmanager" startup="1" protected="0"/><br />
:''<resource src="voice" startup="1" protected="0" /><br />
:''<resource src="votemanager" startup="1" protected="0"/><br />
:''<resource src="webadmin" startup="1" protected="0"/><br />
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more <resource> parameters.<br />
<br />
:In addition, there are several flags which control how the server deals with each resource:<br />
<br />
:* '''src''': the resource name. This is the only mandatory flag.<br />
:* '''startup''': controls whether the resource will be started with the server or not. If "1", "true" or "yes", the resource will be started. If not specified, defaults to not starting the resource.<br />
:* '''protected''': if "1", "true" or "yes", the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.<br />
:* '''default''': if given a "1", "true" or "yes" value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.<br />
<br />
[[Category: Support]]<br />
[[ru:Server mtaserver.conf]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&diff=49751
Server mtaserver.conf
2016-11-03T14:53:22Z
<p>AlexTMjugador: /* fpslimit */ is now 50 by default</p>
<hr />
<div>This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.<br />
<br />
<br />
====servername====<br />
:''<servername>Default MTA Server</servername>''<br />
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter.<br />
<br />
====serverip====<br />
:''<serverip></serverip><br />
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''<br />
:It is generally only needed for professional servers and should be left blank otherwise. This parameter specifies the IP to use for servers that have multiple IP addresses. If left blank, it will default to server's standard local IP address.<br />
:SERVERIP SHOULD BE LEFT BLANK UNLESS YOU ARE SURE OF WHAT YOU ARE DOING<br />
:People who set this and then ask for support will be the first ones against the wall when the revolution comes<br />
<br />
====serverport====<br />
:''<serverport>22003</serverport> <br />
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;<br />
:default value: 22003. It is a required parameter.<br />
<br />
====maxplayers====<br />
:''<maxplayers>32</maxplayers><br />
:This parameter specifies the number of maximum player slots available on the server;<br />
:default value: 32. It is a required parameter.<br />
<br />
====httpserver====<br />
:''<httpserver>1</httpserver><br />
:This parameter specifies whether the builtin http server will be used.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.<br />
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]<br />
<br />
====httpport====<br />
:''<httpport>22005</httpport><br />
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as <serverport>. It is a required parameter if <httpserver> is set to 1.<br />
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]<br />
<br />
====httpdownloadurl====<br />
:''<httpdownloadurl></httpdownloadurl><br />
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.<br />
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]<br />
<br />
====httpmaxconnectionsperclient====<br />
:''<httpmaxconnectionsperclient>5</httpmaxconnectionsperclient><br />
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.<br />
:Available range: 1 to 8.<br />
<br />
====httpdosthreshold====<br />
:''<httpdosthreshold>20</httpdosthreshold><br />
:This parameter limits the number http connections that an IP can initiate over a short period of time.<br />
:Available range: 1 to 100. default value: 20<br />
<br />
{{New feature/item|3.0136|1.3.5|6301|<br />
====http_dos_exclude====<br />
:''<http_dos_exclude></http_dos_exclude><br />
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.<br />
:e.g. 88.11.22.33,101.2.3.4<br />
}}<br />
<br />
====allow_gta3_img_mods====<br />
:''<allow_gta3_img_mods>none</allow_gta3_img_mods><br />
:By default, the server will block the use of locally customized gta3.img player skins. <br />
:This setting can be used to allow such mods. Not recommended for competitive servers.<br />
:Values: none or peds ; default value: none<br />
:'''From server version 1.4.1-9.07268<br />
<br />
====client_file====<br />
:''<nowiki><!-- <client_file name="data/carmods.dat" verify="0" /> --></nowiki><br />
:By default, the server will block the use of customized GTA:SA data files.<br />
:To allow specific client files, add one or more of the above lines.<br />
:More information: [[Anti-cheat_guide|Anti-cheat guide]]<br />
<br />
====disableac====<br />
:''<disableac></disableac><br />
:Comma seperated list of disabled anti-cheats.<br />
:e.g. To disable anti-cheat #2 and #3, use: 2,3<br />
:More information: [[Anti-cheat_guide|Anti-cheat guide]]<br />
<br />
====enablesd====<br />
:''<enablesd></enablesd><br />
:Comma seperated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. Competitive servers may wish to enable special detections, but most servers should leave this setting blank.<br />
:e.g. To enable special detection #12 (disallow custom D3D9.DLL) use: 12<br />
:More information: [[Anti-cheat_guide|Anti-cheat guide]]<br />
<br />
====networkencryption====<br />
:''<networkencryption>1</networkencryption><br />
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====minclientversion====<br />
:''<minclientversion></minclientversion><br />
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.1.0-9.03100.0<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''<br />
<br />
{{New feature/item|3.0136|1.3.4|6023|<br />
====minclientversion_auto_update====<br />
:''<minclientversion_auto_update></minclientversion_auto_update><br />
:This parameter specifies if/when the <minclientversion> setting is automatically updated.<br />
:Keeping <minclientversion> updated can help reduce cheating.<br />
:Note: The instant setting (2) is only recommened for competitive servers.<br />
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.<br />
}}<br />
<br />
====recommendedclientversion====<br />
:''<recommendedclientversion></recommendedclientversion><br />
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.<br />
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]<br />
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''<br />
<br />
====ase====<br />
:''<ase>1</ase><br />
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the ingame server browser. An additional UDP port needs to be available for this to work (value from <serverport> + 123 , so on a default <serverport> value 22003 the right port will be 22126 ).<br />
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.<br />
<br />
====donotbroadcastlan====<br />
:''<donotbroadcastlan>0</donotbroadcastlan><br />
:This parameter allows you to disable LAN broadcasting. <br />
<br />
====password====<br />
:''<password></password> <br />
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.<br />
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]<br />
<br />
====bandwidth_reduction====<br />
:''<bandwidth_reduction>medium</bandwidth_reduction> <br />
:This parameter reduces the server's bandwidth usage by using various optimizations.<br />
:Values: none, medium or maximum ; default value: medium<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====player_sync_interval====<br />
:''<player_sync_interval>100</player_sync_interval> <br />
:This parameter determines the time in milliseconds between player sync packets.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====lightweight_sync_interval====<br />
:''<lightweight_sync_interval>1500</lightweight_sync_interval> <br />
:This parameter determines the time in milliseconds between lightweight (player) sync packets.<br />
:Available range: 200 - 40000; default value: 1500<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====camera_sync_interval====<br />
:''<camera_sync_interval>500</camera_sync_interval> <br />
:This parameter determines the time in milliseconds between camera sync packets.<br />
:Available range: 200 - 400; default value: 500<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====ped_sync_interval====<br />
:''<ped_sync_interval>400</ped_sync_interval> <br />
:This parameter determines the time in milliseconds between ped sync packets.<br />
:Available range: 200 - 4000; default value: 400<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====unoccupied_vehicle_sync_interval====<br />
:''<unoccupied_vehicle_sync_interval>1000</unoccupied_vehicle_sync_interval> <br />
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.<br />
:Available range: 200 - 4000; default value: 1000<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====keysync_mouse_sync_interval====<br />
:''<keysync_mouse_sync_interval>100</keysync_mouse_sync_interval> <br />
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====keysync_analog_sync_interval====<br />
:''<keysync_analog_sync_interval>100</keysync_analog_sync_interval> <br />
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.<br />
:Available range: 50 - 500; default value: 100<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]<br />
<br />
====bullet_sync====<br />
:''<bullet_sync>0</bullet_sync> <br />
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.<br />
:'''It only works on server build 4247 or later, and when enabled, connecting clients will be auto-updated if required.'''<br />
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 0.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====vehext_percent====<br />
:''<vehext_percent>0</vehext_percent><br />
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. <br />
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.<br />
:Depending on the gamemode, an incorrect prediction may have a negative effect. <br />
:Therefore this setting should be considered expermental.<br />
:'''It only works on server build 4456 or later.'''<br />
:Available range: 0 to 100. Default - 0 --><br />
<br />
====vehext_ping_limit====<br />
:''<vehext_ping_limit>150</vehext_ping_limit><br />
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.<br />
:Only relevant if <vehext_percent> is greater than zero.<br />
:'''It only works on server build 4456 or later.'''<br />
:Available range: 50 to 500. Default - 150<br />
<br />
====latency_reduction====<br />
:''<latency_reduction>0</latency_reduction><br />
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).<br />
:Due to the impact this may have on shot lag compensation, it should be considered experimental.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 0.<br />
:Bugs caused by enabling latency_reduction: http://bugs.mtasa.com/view.php?id=8191 + http://bugs.mtasa.com/view.php?id=8226<br />
<br />
====threadnet====<br />
:''<threadnet>1</threadnet> <br />
:This parameter specifies whether or not to run the network synchronization on another thread.<br />
:Enabling will make the sync smoother, but may increase cpu usage slightly.<br />
:Values: 0 - disabled , 1 - enabled ; default value: 1.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====idfile====<br />
:''<idfile>server-id.keys</idfile> <br />
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. <br />
:Keep a backup of this file in a safe place. Default value: server-id.keys<br />
:More information about client private files: [[Filepath]]<br />
<br />
====logfile====<br />
:''<logfile>logs/server.log</logfile><br />
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.<br />
<br />
====authfile====<br />
:''<authfile>logs/server_auth.log</authfile><br />
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used<br />
<br />
====dbfile====<br />
:''<dbfile>logs/db.log</dbfile><br />
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.<br />
<br />
{{New feature/item|3.0136|1.3.4|5809|<br />
====loadstringfile====<br />
:''<!-- <loadstringfile>logs/loadstring.log</loadstringfile> --><br />
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.<br />
}}<br />
<br />
====acl====<br />
:''<acl>acl.xml</acl> <br />
:This parameter specifies the location and name of the Access Control List settings file. If left<br />
:blank, server will use acl.xml file, located in the same folder as this configuration file.<br />
<br />
====scriptdebuglogfile====<br />
:''<scriptdebuglogfile>logs/scripts.log</scriptdebuglogfile> <br />
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.<br />
<br />
====scriptdebugloglevel====<br />
:''<scriptdebugloglevel>0</scriptdebugloglevel><br />
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.<br />
<br />
====fpslimit====<br />
:''<fpslimit>50</fpslimit><br />
:Specifies the frame rate limit that will be applied to connecting clients.<br />
:Available range: 25 to 100. Default: 50.<br />
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]<br />
<br />
====voice====<br />
:''<voice>0</voice><br />
:This parameter specifies whether or not to enable player voice chat in-game<br />
:Values: 0 - disabled , 1 - enabled<br />
<br />
====voice_samplerate====<br />
:''<voice_samplerate>1</voice_samplerate><br />
:This parameter specifies the sample rate for voice chat. 'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat<br />
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz). Default - 1<br />
<br />
====voice_quality====<br />
:''<voice_quality>4</voice_quality><br />
:This parameter specifies the voice quality for voice chat. 'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat<br />
:Available range: 0 to 10. Default - 4<br />
<br />
====voice_bitrate====<br />
:''<nowiki><!-- <voice_bitrate>24600</voice_bitrate> --></nowiki><br />
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically. Use with care.<br />
<br />
====backup_path====<br />
:''<backup_path>backups</backup_path><br />
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups<br />
<br />
====backup_interval====<br />
:''<backup_interval>3</backup_interval><br />
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups<br />
:Available range: 0 to 30. Default - 3<br />
<br />
====backup_copies====<br />
:''<backup_copies>5</backup_copies><br />
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups<br />
:Available range: 0 to 100. Default - 5<br />
<br />
{{New feature/item|3.0136|1.3.4|5950|<br />
====compact_internal_databases====<br />
:''<compact_internal_databases>1</compact_internal_databases><br />
:This parameter specifies when the internal sqlite databases should be defragmented. Details: http://www.sqlite.org/lang_vacuum.html<br />
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always. Default - 1<br />
}}<br />
<br />
====module====<br />
:''<nowiki><!-- <module src="sample_win32.dll"/> --></nowiki><br />
:''<nowiki><!-- <module src="sample_linux.so"/> --></nowiki><br />
:Specifies the module(s) which are loaded with the server. To load several modules, add more <module> parameter(s). Optional parameter.<br />
<br />
====resource====<br />
:''<resource src="admin" startup="1" protected="0"/><br />
:''<resource src="defaultstats" startup="1" protected="0"/><br />
:''<resource src="helpmanager" startup="1" protected="0"/><br />
:''<resource src="joinquit" startup="1" protected="0"/><br />
:''<resource src="mapcycler" startup="1" protected="0"/><br />
:''<resource src="mapmanager" startup="1" protected="0"/><br />
:''<resource src="parachute" startup="1" protected="0"/><br />
:''<resource src="resourcebrowser" startup="1" protected="1" default="true"/><br />
:''<resource src="resourcemanager" startup="1" protected="1"/><br />
:''<resource src="scoreboard" startup="1" protected="0"/><br />
:''<resource src="spawnmanager" startup="1" protected="0"/><br />
:''<resource src="voice" startup="1" protected="0" /><br />
:''<resource src="votemanager" startup="1" protected="0"/><br />
:''<resource src="webadmin" startup="1" protected="0"/><br />
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more <resource> parameters.<br />
<br />
:In addition, there are several flags which control how the server deals with each resource:<br />
<br />
:* '''src''': the resource name. This is the only mandatory flag.<br />
:* '''startup''': controls whether the resource will be started with the server or not. If "1", "true" or "yes", the resource will be started. If not specified, defaults to not starting the resource.<br />
:* '''protected''': if "1", "true" or "yes", the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.<br />
:* '''default''': if given a "1", "true" or "yes" value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.<br />
<br />
[[Category: Support]]<br />
[[ru:Server mtaserver.conf]]</div>
AlexTMjugador
https://wiki.multitheftauto.com/index.php?title=User:J.Chaikos&diff=49725
User:J.Chaikos
2016-10-30T16:31:21Z
<p>AlexTMjugador: Created page with "When posting useful functions to the wiki, you should write their articles in English, because it is an international section of this wiki that should be understandable by eve..."</p>
<hr />
<div>When posting useful functions to the wiki, you should write their articles in English, because it is an international section of this wiki that should be understandable by everybody. Could you please translate the [[slowlyMusicStop]] article to English, then? Thank you. --[[User:AlexTMjugador|AlexTMjugador]] ([[User talk:AlexTMjugador|talk]]) 16:31, 30 October 2016 (UTC)</div>
AlexTMjugador