https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=CodyJ&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-29T10:45:57ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=EngineSetAsynchronousLoading&diff=61822EngineSetAsynchronousLoading2019-01-02T23:59:54Z<p>CodyJ: </p>
<hr />
<div>{{Client function}}<br />
<br />
__NOTOC__<br />
This function enables or disables asynchronous model loading. Enabling asynchronous model loading may reduce the small pauses that occur when a new model is displayed for the first time. However, it can cause the new models to appear slightly later than they might have otherwise.<br />
<br />
<br />
{{Warning|Using this function with a large amounts of engineReplace* at the same time may cause loading times to be exponentially slower}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool engineSetAsynchronousLoading ( bool enable, bool force ) <br />
</syntaxhighlight> <br />
{{OOP||Engine.setAsynchronousLoading}}<br />
===Required Arguments=== <br />
*'''enable:''' Set to true/false to enable/disable asynchronous loading. Only works if the client's preferences has 'Asynchronous Loading' set to 'Auto'.<br />
*'''force:''' If set to true, ignores the client's preferences.<br />
<br />
===Returns===<br />
Returns ''true'' if the function executed successfully, ''false'' otherwise.<br />
<br />
==Example== <br />
The next example enables the model asynchronous loading ignoring client preferences if there are a lot of objects (and the player wants to).<syntaxhighlight lang="lua"><br />
addEventHandler("onClientResourceStart", resourceRoot, function()<br />
if #getElementsByType("object") > 500 then<br />
engineSetAsynchronousLoading( true, false )<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==How it works==<br />
If asynchronous loading is disabled, MTA requests all resources to be loaded at the time they have been requested. This will halt game execution for the time being.<br />
<br />
Otherwise, all resource requests are queued up on the to-be-loaded queue. At the beginning of the game frame, the GTA:SA streaming system is updated, along with its streaming slicers. This is when a model is loaded after going through multiple stages. Having asynchronous loading disabled forces all stages to be consecutively run through.<br />
<br />
For more details read [[GTA:SA Resource Streaming]]<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=EngineSetAsynchronousLoading&diff=61821EngineSetAsynchronousLoading2019-01-02T23:59:08Z<p>CodyJ: </p>
<hr />
<div>{{Client function}}<br />
<br />
{{Warning|Using this function with a large amounts of engineReplace* at the same time may cause loading times to be exponentially slower}<br />
<br />
__NOTOC__<br />
This function enables or disables asynchronous model loading. Enabling asynchronous model loading may reduce the small pauses that occur when a new model is displayed for the first time. However, it can cause the new models to appear slightly later than they might have otherwise.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool engineSetAsynchronousLoading ( bool enable, bool force ) <br />
</syntaxhighlight> <br />
{{OOP||Engine.setAsynchronousLoading}}<br />
===Required Arguments=== <br />
*'''enable:''' Set to true/false to enable/disable asynchronous loading. Only works if the client's preferences has 'Asynchronous Loading' set to 'Auto'.<br />
*'''force:''' If set to true, ignores the client's preferences.<br />
<br />
===Returns===<br />
Returns ''true'' if the function executed successfully, ''false'' otherwise.<br />
<br />
==Example== <br />
The next example enables the model asynchronous loading ignoring client preferences if there are a lot of objects (and the player wants to).<syntaxhighlight lang="lua"><br />
addEventHandler("onClientResourceStart", resourceRoot, function()<br />
if #getElementsByType("object") > 500 then<br />
engineSetAsynchronousLoading( true, false )<br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==How it works==<br />
If asynchronous loading is disabled, MTA requests all resources to be loaded at the time they have been requested. This will halt game execution for the time being.<br />
<br />
Otherwise, all resource requests are queued up on the to-be-loaded queue. At the beginning of the game frame, the GTA:SA streaming system is updated, along with its streaming slicers. This is when a model is loaded after going through multiple stages. Having asynchronous loading disabled forces all stages to be consecutively run through.<br />
<br />
For more details read [[GTA:SA Resource Streaming]]<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&diff=57253DxDrawTextOnElement2018-08-02T18:36:29Z<p>CodyJ: /* Function source */</p>
<hr />
<div>{{Useful Function}}<lowercasetitle/><br />
__NOTOC__<br />
This useful client function draws a text on any element you choose.<br />
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">boolean dxDrawTextOnElement(element TheElement, string text [, int height = 1, int distance = 20, int R = 255, int G = 255, int B = 255, int alpha = 255, int size = 1, string font = "arial", bool checkBuildings = true, bool checkVehicles = false, bool checkPeds = false, bool checkDummies = true, bool seeThroughStuff = true, bool ignoreSomeObjectsForCamera = false, element ignoredElement = nil ] )</syntaxhighlight><br />
[[Image:dxDrawTextOnElement.png|thumb|Example of how it should looks like.|284x230px]]<br />
<br />
==Required arguments==<br />
* ''TheElement'': The element you want to draw the text on it.<br />
* ''text'': The text you want.<br />
<br />
==Optional arguments==<br />
* ''height'': The height of the text, it's 1 by default.<br />
* ''distance'': The distance you will be able to view the text from, it's 20 by default.<br />
* ''R'': The Red color code (0-255), it's 255 by default.<br />
* ''G'': The Green color code (0-255), it's 255 by default.<br />
* ''B'': The Blue color code (0-255), it's 255 by default.<br />
* ''alpha'': The alpha of the text, it's 255 by default.<br />
* ''size'': The size of the text, it's 1 by default.<br />
* ''font'': Either a custom [[DX font]] element or the name of a built-in DX font:<br />
{{DxFonts}}<br />
It's arial by default.<br />
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.<br />
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].<br />
*'''checkPeds:''' Allow the line of sight to be blocked by peds, i.e. [[Player|players]].<br />
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].<br />
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies. These are not used in the current MTA version so this argument can be set to ''false''.<br />
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.<br />
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects.<br />
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element.<br />
<br />
<br />
==Returns==<br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Function source==<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,...)<br />
local x, y, z = getElementPosition(TheElement)<br />
local x2, y2, z2 = getCameraMatrix()<br />
local distance = distance or 20<br />
local height = height or 1<br />
<br />
if (isLineOfSightClear(x, y, z+2, x2, y2, z2, ...)) then<br />
local sx, sy = getScreenFromWorldPosition(x, y, z+height)<br />
if(sx) and (sy) then<br />
local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)<br />
if(distanceBetweenPoints < distance) then<br />
dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center")<br />
end<br />
end<br />
end<br />
end<br />
</syntaxhighlight><br />
</section><br />
*Original author: ''Al Obaidi Hassan''.<br />
*Skype: ''hassan.saad2000''<br />
<br />
==Example #1==<br />
This example creates a text on a random ped in the Grove street.<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
randomPed = createPed(285,2476.91406,-1665.31799,13.32435)<br />
<br />
addEventHandler("onClientRender", getRootElement(), <br />
function ()<br />
dxDrawTextOnElement(randomPed,"SWATTEAM Officer",1,20,0,0,255,255,1,"pricedown")<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
==Example #2==<br />
This example creates a text 'HassoN' on all the players are in a team named HassoN.<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onClientRender", getRootElement(), <br />
function ()<br />
for k,v in ipairs(getElementsByType("player")) do<br />
if getPlayerTeam(v) == getTeamFromName("HassoN") then<br />
if v == localPlayer then return end<br />
dxDrawTextOnElement(v,"HassoN",1,20,0,0,255,255,1,"arial")<br />
end<br />
end<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See also==<br />
{{Useful Functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=DxDrawTextOnElement&diff=57252DxDrawTextOnElement2018-08-02T18:08:34Z<p>CodyJ: </p>
<hr />
<div>{{Useful Function}}<lowercasetitle/><br />
__NOTOC__<br />
This useful client function draws a text on any element you choose.<br />
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">boolean dxDrawTextOnElement(element TheElement, string text [, int height = 1, int distance = 20, int R = 255, int G = 255, int B = 255, int alpha = 255, int size = 1, string font = "arial", bool checkBuildings = true, bool checkVehicles = false, bool checkPeds = false, bool checkDummies = true, bool seeThroughStuff = true, bool ignoreSomeObjectsForCamera = false, element ignoredElement = nil ] )</syntaxhighlight><br />
[[Image:dxDrawTextOnElement.png|thumb|Example of how it should looks like.|284x230px]]<br />
<br />
==Required arguments==<br />
* ''TheElement'': The element you want to draw the text on it.<br />
* ''text'': The text you want.<br />
<br />
==Optional arguments==<br />
* ''height'': The height of the text, it's 1 by default.<br />
* ''distance'': The distance you will be able to view the text from, it's 20 by default.<br />
* ''R'': The Red color code (0-255), it's 255 by default.<br />
* ''G'': The Green color code (0-255), it's 255 by default.<br />
* ''B'': The Blue color code (0-255), it's 255 by default.<br />
* ''alpha'': The alpha of the text, it's 255 by default.<br />
* ''size'': The size of the text, it's 1 by default.<br />
* ''font'': Either a custom [[DX font]] element or the name of a built-in DX font:<br />
{{DxFonts}}<br />
It's arial by default.<br />
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.<br />
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].<br />
*'''checkPeds:''' Allow the line of sight to be blocked by peds, i.e. [[Player|players]].<br />
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].<br />
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies. These are not used in the current MTA version so this argument can be set to ''false''.<br />
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.<br />
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects.<br />
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element.<br />
<br />
<br />
==Returns==<br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Function source==<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,...)<br />
local x, y, z = getElementPosition(TheElement)<br />
local x2, y2, z2 = getElementPosition(localPlayer)<br />
local distance = distance or 20<br />
local height = height or 1<br />
<br />
if (isLineOfSightClear(x, y, z, x2, y2, z2, ...)) then<br />
local sx, sy = getScreenFromWorldPosition(x, y, z+height)<br />
if(sx) and (sy) then<br />
local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)<br />
if(distanceBetweenPoints < distance) then<br />
dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center")<br />
end<br />
end<br />
end<br />
end<br />
</syntaxhighlight><br />
</section><br />
*Original author: ''Al Obaidi Hassan''.<br />
*Skype: ''hassan.saad2000''<br />
<br />
==Example #1==<br />
This example creates a text on a random ped in the Grove street.<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
randomPed = createPed(285,2476.91406,-1665.31799,13.32435)<br />
<br />
addEventHandler("onClientRender", getRootElement(), <br />
function ()<br />
dxDrawTextOnElement(randomPed,"SWATTEAM Officer",1,20,0,0,255,255,1,"pricedown")<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
==Example #2==<br />
This example creates a text 'HassoN' on all the players are in a team named HassoN.<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler("onClientRender", getRootElement(), <br />
function ()<br />
for k,v in ipairs(getElementsByType("player")) do<br />
if getPlayerTeam(v) == getTeamFromName("HassoN") then<br />
if v == localPlayer then return end<br />
dxDrawTextOnElement(v,"HassoN",1,20,0,0,255,255,1,"arial")<br />
end<br />
end<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See also==<br />
{{Useful Functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=IsVehicleWheelOnGround&diff=55855IsVehicleWheelOnGround2018-07-16T18:08:59Z<p>CodyJ: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{New feature/item|3.0160|1.5.5|11854|<br />
This function returns a [[boolean]] whether the [[vehicle]]'s wheel is on ground (true) or in air (false).<br />
}}<br />
{{Note|In vehicles with 3 wheels, the wheels are combined 2 in 1, in motorbikes only the left - <code>"front_left"</code> and <code>"rear_left"</code>}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua">bool isVehicleWheelOnGround ( vehicle theVehicle, string|int wheel )</syntaxhighlight> <br />
{{OOP||[[vehicle]]:isWheelCollided}}<br />
===Required Arguments=== <br />
*'''theVehicle''' The [[vehicle]], which you want to check.<br />
*'''wheel''' The wheel name or number, see list below:<br />
** <code>"front_left"</code> or 0<br />
** <code>"rear_left"</code> or 1<br />
** <code>"front_right"</code> or 2<br />
** <code>"rear_right"</code> or 3<br />
<br />
===Returns===<br />
Returns ''true'' if the vehicle wheel is on ground/collided, ''false'' otherwise.<br />
<br />
==Example==<br />
This example displays four colored rectangles on the screen. If the wheel is colliding, the rectangle will be green, otherwise it will be red.<br />
<syntaxhighlight lang="lua"><br />
local Green = tocolor(0, 255, 0, 255)<br />
local Red = tocolor(255, 0, 0, 255)<br />
<br />
addEventHandler( "onClientRender", root,<br />
function( )<br />
local theVehicle = getPedOccupiedVehicle( localPlayer )<br />
<br />
if isElement( theVehicle ) then<br />
dxDrawRectangle( 100, 100, 20, 20, isVehicleWheelOnGround ( theVehicle, 0 ) and Green or Red )<br />
dxDrawRectangle( 100, 140, 20, 20, isVehicleWheelOnGround ( theVehicle, 1 ) and Green or Red )<br />
dxDrawRectangle( 140, 100, 20, 20, isVehicleWheelOnGround ( theVehicle, 2 ) and Green or Red )<br />
dxDrawRectangle( 140, 140, 20, 20, isVehicleWheelOnGround ( theVehicle, 3 ) and Green or Red )<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Vehicle_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=IsVehicleWheelCollided&diff=55853IsVehicleWheelCollided2018-07-16T18:04:32Z<p>CodyJ: CodyJ moved page IsVehicleWheelCollided to IsVehicleWheelOnGround: New Name</p>
<hr />
<div>#REDIRECT [[IsVehicleWheelOnGround]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=IsVehicleWheelOnGround&diff=55852IsVehicleWheelOnGround2018-07-16T18:04:32Z<p>CodyJ: CodyJ moved page IsVehicleWheelCollided to IsVehicleWheelOnGround: New Name</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{New feature/item|3.0160|1.5.5|11854|<br />
This function returns a [[boolean]] whether the [[vehicle]]'s wheel is on ground (true) or in air (false).<br />
}}<br />
{{Note|In vehicles with 3 wheels, the wheels are combined 2 in 1, in motorbikes only the left - <code>"front_left"</code> and <code>"rear_left"</code>}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua">bool isVehicleWheelOnGround ( vehicle theVehicle, string|int wheel )</syntaxhighlight> <br />
{{OOP||[[vehicle]]:isWheelCollided}}<br />
===Required Arguments=== <br />
*'''theVehicle''' The [[vehicle]], which you want to check.<br />
*'''wheel''' The wheel name or number, see list below:<br />
** <code>"front_left"</code> or 0<br />
** <code>"rear_left"</code> or 1<br />
** <code>"front_right"</code> or 2<br />
** <code>"rear_right"</code> or 3<br />
<br />
===Returns===<br />
Returns ''true'' if the vehicle wheel is on ground/collided, ''false'' otherwise.<br />
<br />
==Example==<br />
This example displays four colored rectangles on the screen. If the wheel is colliding, the rectangle will be green, otherwise it will be red.<br />
<syntaxhighlight lang="lua"><br />
local Green = tocolor(0, 255, 0, 255)<br />
local Red = tocolor(255, 0, 0, 255)<br />
<br />
addEventHandler( "onClientRender", root,<br />
function( )<br />
local theVehicle = getPedOccupiedVehicle( localPlayer )<br />
<br />
if isElement( theVehicle ) then<br />
dxDrawRectangle( 100, 100, 20, 20, isVehicleWheelOnGround ( theVehicle, 0 ) and Green or Red )<br />
dxDrawRectangle( 100, 140, 20, 20, isVehicleWheelOnGround ( theVehicle, 1 ) and Green or Red )<br />
dxDrawRectangle( 140, 100, 20, 20, isVehicleWheelOnGround ( theVehicle, 2 ) and Green or Red )<br />
dxDrawRectangle( 140, 140, 20, 20, isVehicleWheelOnGround ( theVehicle, 3 ) and Green or Red )<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=IsVehicleWheelOnGround&diff=55851IsVehicleWheelOnGround2018-07-16T18:04:09Z<p>CodyJ: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{New feature/item|3.0160|1.5.5|11854|<br />
This function returns a [[boolean]] whether the [[vehicle]]'s wheel is on ground (true) or in air (false).<br />
}}<br />
{{Note|In vehicles with 3 wheels, the wheels are combined 2 in 1, in motorbikes only the left - <code>"front_left"</code> and <code>"rear_left"</code>}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua">bool isVehicleWheelOnGround ( vehicle theVehicle, string|int wheel )</syntaxhighlight> <br />
{{OOP||[[vehicle]]:isWheelCollided}}<br />
===Required Arguments=== <br />
*'''theVehicle''' The [[vehicle]], which you want to check.<br />
*'''wheel''' The wheel name or number, see list below:<br />
** <code>"front_left"</code> or 0<br />
** <code>"rear_left"</code> or 1<br />
** <code>"front_right"</code> or 2<br />
** <code>"rear_right"</code> or 3<br />
<br />
===Returns===<br />
Returns ''true'' if the vehicle wheel is on ground/collided, ''false'' otherwise.<br />
<br />
==Example==<br />
This example displays four colored rectangles on the screen. If the wheel is colliding, the rectangle will be green, otherwise it will be red.<br />
<syntaxhighlight lang="lua"><br />
local Green = tocolor(0, 255, 0, 255)<br />
local Red = tocolor(255, 0, 0, 255)<br />
<br />
addEventHandler( "onClientRender", root,<br />
function( )<br />
local theVehicle = getPedOccupiedVehicle( localPlayer )<br />
<br />
if isElement( theVehicle ) then<br />
dxDrawRectangle( 100, 100, 20, 20, isVehicleWheelOnGround ( theVehicle, 0 ) and Green or Red )<br />
dxDrawRectangle( 100, 140, 20, 20, isVehicleWheelOnGround ( theVehicle, 1 ) and Green or Red )<br />
dxDrawRectangle( 140, 100, 20, 20, isVehicleWheelOnGround ( theVehicle, 2 ) and Green or Red )<br />
dxDrawRectangle( 140, 140, 20, 20, isVehicleWheelOnGround ( theVehicle, 3 ) and Green or Red )<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=IsInsideColShape&diff=55795IsInsideColShape2018-07-09T15:55:05Z<p>CodyJ: /* Syntax */</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
{{New feature/item|3.0156|1.5.5|12286|This function checks if a 3D position is inside a colshape or not.}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool isInsideColShape( colshape theShape, float posX, float posY, float posZ )<br />
</syntaxhighlight> <br />
{{OOP||[[colshape]]:isInside}}<br />
<br />
===Required Arguments=== <br />
*'''theShape:''' The colshape you're checking the position against.<br />
*'''posX:''' The X coordinate of the position you're checking.<br />
*'''posY:''' The Y coordinate of the position you're checking.<br />
*'''posZ:''' The Z coordinate of the position you're checking.<br />
<br />
===Returns===<br />
Returns ''true'' if the position is inside the colshape, ''false'' if it isn't or if any parameters are invalid.<br />
<br />
==Example== <br />
This function checks if an element is within a colshape.<br />
<syntaxhighlight lang="lua"><br />
function isElementInsideColShape( theElement, theColShape )<br />
return isInsideColShape( theColShape, getElementPosition( theElement ) )<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Collision shape functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=EngineReplaceModel&diff=55310EngineReplaceModel2018-06-13T20:05:58Z<p>CodyJ: Engine COLs work just fine, however some times there is a ghosting problem.</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
<br />
{{Note box|Please note the loading order that is used in the examples as other orders can cause collisions, textures or the DFF not to load due to technical limitations}}<br />
<br />
This function replaces the given model ID with the model contained in a DFF file loaded by [[engineLoadDFF]]. {{New items|3.0111|1.1.1|This function supports [[vehicle|vehicles]], [[object|objects]], [[ped|peds]] and [[player|players]].}}<br />
<br />
{{Deprecated feature|3.0111|1.1.1|This function does not support ped and weapon models.}}<br />
<br />
To replace weapon models you must use their object IDs, not weapon IDs. There is a weapon model list available at [[weapons]].<br />
{{Note|<br />
* Default GTA map objects behave inconsistently when using this function on them. If you want to replace models in the original GTA map, use one of the [[EngineReplaceModel notes|methods shown here]].}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool engineReplaceModel ( dff theModel, int modelID [, bool alphaTransparency = false ] )<br />
</syntaxhighlight> <br />
{{OOP||[[DFF|dff]]:replace}}<br />
===Required Arguments=== <br />
*'''theModel:''' The model to replace the given model ID with<br />
*'''modelID:''' The model it to replace the model of<br />
<br />
===Optional Arguments=== <br />
*'''alphaTransparency:''' Set to true to enable texture transparency within the model<br />
<br />
===Returns===<br />
Returns ''true'' if the model was successfully replaced, ''false'' if it failed for some reason, ie. the DFF or the model ID is not valid.<br />
<br />
==Example== <br />
'''Example 1:'''<br />
<section name="Client" class="client" show="true"><br />
Client-side example for replacing vehicle model and texture with custom ones.<br />
<syntaxhighlight lang="lua"><br />
function ReplaceVehicle ( )<br />
outputChatBox ( "> replacing the euros vehicle" )<br />
<br />
txd = engineLoadTXD ( "data/euros.txd" )<br />
engineImportTXD ( txd, 587 )<br />
dff = engineLoadDFF ( "data/euros.dff" )<br />
engineReplaceModel ( dff, 587 )<br />
end<br />
<br />
addEvent ( "replaceVeh", true )<br />
addEventHandler ( "replaceVeh", root, ReplaceVehicle )<br />
</syntaxhighlight><br />
</section><br />
<section name="Server" class="server" show="true"><br />
Server-side example function for triggering the replace.<br />
<syntaxhighlight lang="lua"><br />
function ReplaceCommand ( )<br />
triggerClientEvent( "replaceVeh", root, replaceVeh )<br />
end<br />
addCommandHandler( "replace", ReplaceCommand )<br />
</syntaxhighlight><br />
</section><br />
<br />
'''Example 2:'''<br />
<section name="Client" class="client" show="true"><br />
Client-side example for replacing weapons with custom mods.<br />
<syntaxhighlight lang="lua"><br />
function replaceWeapon() <br />
txd = engineLoadTXD ( "m4.txd" )<br />
engineImportTXD ( txd, 356)<br />
dff = engineLoadDFF ( "m4.dff", 356) -- use weapon model ID, not weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons)<br />
engineReplaceModel ( dff, 356) -- Likewise, model ID, for M4 as example it's 356<br />
<br />
end<br />
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon)<br />
</syntaxhighlight><br />
</section><br />
<br />
'''Example 3:'''<br />
<section name="Client" class="client" show="true"><br />
Client-Side example for replacing object collision, texture and model with custom ones.<br />
<syntaxhighlight lang="lua"><br />
function ReplaceObject ( )<br />
<br />
col = engineLoadCOL( "MyModel.col" )<br />
txd = engineLoadTXD( "MyModel.txd" )<br />
dff = engineLoadDFF( "MyModel.dff", 0 )<br />
<br />
engineReplaceCOL( col, 1234 )<br />
engineImportTXD( txd, 1234 )<br />
engineReplaceModel( dff, 1234 )-- replace the model at least<br />
<br />
end<br />
<br />
addEvent ( "replaceObj", true )<br />
addEventHandler ( "replaceObj", root, ReplaceObject )<br />
</syntaxhighlight><br />
</section><br />
<section name="Server" class="server" show="true"><br />
Server-side example function for triggering the replace.<br />
<syntaxhighlight lang="lua"><br />
function ReplaceCommand ( )<br />
triggerClientEvent( "replaceObj", root, replaceObj )<br />
end<br />
addCommandHandler( "replace", ReplaceCommand )<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Engine_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Strona_g%C5%82%C3%B3wna&diff=54148Strona główna2018-03-17T16:18:46Z<p>CodyJ: Undo revision 54117 by Ciastuuś (talk)</p>
<hr />
<div>{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
<div style="/*border: 1px solid #D8D8D8;*/ padding-left: 15px; padding-right: 15px; height: 100%;"><br />
[[File:Mtalogo.png|left|100px|link=http://wiki.multitheftauto.com/]]'''Witaj na polskiej wiki [[PL/Multi Theft Auto|Multi Theft Auto]].''' Znajdziesz tutaj wiele informacji na temat korzystania z Multi Theft Auto.<br />
<br />
Jest wiele [[PL/How you can help|rzeczy które możesz zrobić]], aby pomóc nam w rozwijaniu MTA - stworzyć mapę, tryb gry, pomóc w dokumentowaniu funkcji, napisać przykładowy kod, napisać poradnik lub po prostu grać w MTA i zgłaszać błędy, które znajdziesz.<br />
<br />
Jeśli masz jakieś pytania bądź problemy związane z pisaniem skryptów, zapytaj nas na [[PL/IRC Channel|kanale IRC]].<br />
<br/><br/>[ Przestań bawić się samemu! :) ]<br />
</div><br />
|}<br />
{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
|-<br />
|width="50%" style="vertical-align:top;" |<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;"><br />
<div style="float:right; width: 32px;">[[File:Input-gaming.png|link=]]</div><br />
<h3>Graj</h3><br />
<div style="background: #FFEEAA; border: 1px solid #FFCD19;"><br />
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Pobierz Multi Theft Auto: San Andreas {{Current Version|full}}]'''</div><br />
* [[PL/Where to buy GTASA|Gdzie kupić GTASA]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[PL/Client Manual|Obsługa klienta]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
<!-- * [[PL/Changes_in_{{padleft:|3|{{Current Version|full}}}}| Zmiany w {{padleft:|3|{{Current Version|full}}}}]] --><br />
* [[PL/Changes_in_{{padleft:|5|{{Current Version|full}}}}| Zmiany w {{padleft:|5|{{Current Version|full}}}}]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[PL/Known_Issues_-_FAQ|Znane problemy]] [[Image:Plflag.png|Artykuł w języku polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[PL/Migracja_z_MTA:Race_do_MTA:SA_1.0.x|Migracja z MTA:Race do MTA:SA {{padleft:|3|{{Current Version|full}}}}]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[PL/Server Manual|Obsługa serwera]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[Map manager|Menadżer map]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
<br />
<h3>Edytor map</h3><br />
*[[PL/Resource:Editor|Instrukcja]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Resource:Editor/EDF|Edytor Właściwości Mapy]] [[Image:Plflag.png|Artykuł w języku polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]]<br />
*[[Resource:Editor/Plugins|Pluginy]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
*[[PL/Resource:Editor#FAQ|Najczęściej zadawane pytania]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Package-x-generic.png|link=]]</div><br />
<h3>Bazy danych</h3><br />
Ta sekcja opisuje wszystkie możliwości Lua umożliwiane przez MTA lub zasoby.<br />
* [[PL/Category:Resource|Katalog zasobów]] - Musisz je poznać, aby tworzyć właściwe skrypty<br />
* [[PL/Client side scripts|Skrypty po stronie klienta]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[PL/Modules|Moduły]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Applications-development.png|link=]]</div><br />
<h3>Rozwijanie Multi Theft Auto</h3><br />
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Nightly builds]<br />
* [[Compiling_MTASA|Kompilacja MTASA na Windows]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[Building_MTASA_Server_on_GNU_Linux|Kompilacja MTASA na GNU/Linux]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[Coding guidelines|Wytyczne dot. pisania kodu]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [https://github.com/multitheftauto/mtasa-blue Repozytorium Github]<br />
* [[Roadmap]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [http://bugs.mtasa.com/ Bugtracker]<br />
* [[Branches|Branże]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Applications-office.png|link=]]</div><br />
<h3>Polskie Wiki - jak możesz pomóc?</h3><br />
* Pomóż tłumaczyć hasła, przy których jest angielska flaga<br />
* Twórz hasła, które istnieją w angielskiej wiki, a których u nas brakuje<br />
** Staraj się, aby nowe artykuły miały takie same nazwy (angielskie), a jedynie poprzedzane były przedrostkiem PL/ - przykład: [[PL/Character_Skins]]<br />
* Zwołaj znajomych, informuj na forach, niech inni dowiedzą się o takiej możliwości!<br />
* Jeśli nie masz pomysłu na edycję, wykonaj coś z [[PL/Todo|tej listy]]. Możesz ją także rozbudować.<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Internet-group-chat.png|link=]]</div><br />
<h3>Społeczność</h3><br />
* [http://forum.multitheftauto.com/ Forum]<br />
* Discord: [https://forum.mtasa.com/topic/95008-multi-theft-autos-official-discord-server/ Oficjalny serwer Discord MTA]<br />
* IRC: [irc://irc.multitheftauto.com/mta irc.multitheftauto.com #mta]<br />
* [http://community.mtasa.com/ MTA Community] - dodaj lub pobierz skrypty<br />
* [http://twitter.com/#!/MTAQA/ Twitter] - [http://www.youtube.com/user/MTAQA Youtube] - [http://plus.google.com/102014133442331779727/ Google+] - [http://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]<br />
</div><br />
<br />
| width="50%" style="vertical-align:top;" |<br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Accessories-text-editor.png|link=]]</div><br />
<h3>Skryptowanie</h3><br />
* [[Wstęp do pisania skryptów|Wstęp do pisania skryptów]] [[Image:Plflag.png|Artykuł w języku polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[Introduction to Scripting the GUI|Wstęp do pisania skryptów GUI]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[Debugging|Poradnik debugowania]] [[Image:usen.gif|Artykuł w języku angielskim]] - Jak znaleźć błędy w swoich skryptach<br />
* [[Resources|Wstęp do zasobów]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
** [[Resource Web Access|Dostęp WWW do zasobów]] [[Image:usen.gif|Artykuł w języku angielskim]] - Jak pisać strony WWW z wykorzystaniem zasobów<br />
** [[:Category:Resource|Katalog zasobów]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
** [[PL/Meta.xml|Meta.xml]] [[Image:Plflag.png|Artykuł w języku polskim]] - każdy zasób jest definiowany przez plik meta<br />
** [[ACL]] [[Image:usen.gif|Artykuł w języku angielskim]] - Access Control List, który jest niezbędny, aby skrypty działały<br />
* [[Writing_Gamemodes|Pisanie gamemodów]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[PL/Useful_Functions|Przydatne funkcje]] [[Image:Plflag.png|Artykuł w polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]]<br />
Linki na fora<br />
* [https://forum.mtasa.com/forum/71-scripting/ Forum na temat skryptowania]<br />
* [https://forum.mtasa.com/forum/123-tutorials/ Forum z poradnikami do skryptowania]<br />
* [https://forum.mtasa.com/topic/24702-mtasa-wiki-offline-copies-online-mirrors/ Kopie Wiki]<br />
<div style="float:right; width: 32px;">[[File:start-here.png|link=]]</div><br />
<h3>Pomoc dotycząca LUA</h3><br />
Strony zaprojektowane, by pomóc Ci zrozumieć język LUA.<br />
*[http://www.lua.org/pil/index.html "Programming in Lua" Manual]<br />
**[http://www.lua.org/manual/5.1/#index Internal Lua functions reference]<br />
*[http://lua-users.org/wiki/TutorialDirectory Lua Wiki]<br />
*[http://nixstaller.sourceforge.net/manual/0.5.1/nixstaller_10.html A general guide to Lua from Nixstaller]<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;"><br />
<div style="float:right; width: 32px;">[[File:Preferences-system.png|link=]]</div><br />
<h3>Odwołania</h3><br />
* [[PL/Funkcje po stronie klienta|Funkcje po stronie klienta]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[PL/Client Scripting Events|Zdarzenia po stronie klienta]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[Server Scripting Functions|Funkcje po stronie serwera]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[Server Scripting Events|Zdarzenia po stronie serwera]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
<!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --><br />
* [[PL/MTA Classes|Klasy MTA]] [[Image:Plflag.png|Artykuł w języku polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]] -- Szczegółowe opisy wszystkich typów MTA<br />
** [[Element|Elementy MTA]] [[Image:usen.gif|Artykuł w języku angielskim]] / [[Element tree|Drzewo elementów]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:System-file-manager.png|link=]]</div><br />
<h3>[[PL/Id|Listy ID]]</h3><br />
*[[PL/Animations|Animacje]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Character Skins|Skiny postaci]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/CJ_Clothes|Ubrania]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Garage|Garaże]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Interior IDs|Interiory]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Material IDs|Materiały]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Projectiles|Pociski]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Radar Blips|Znaczniki]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Sounds|Dźwięki]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Vehicle IDs|Pojazdy]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Vehicle Colors|Kolory pojazdów]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Vehicle Upgrades|Modyfikacje pojazdów]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[Vehicle variants|Warianty pojazdów]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
*[[PL/Vehicle component manipulation|Manipulowanie komponentami pojazdów]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Weapons|Bronie]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Weather|Pogoda]] [[Image:Plflag.png|Artykuł w języku polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]]<br />
</div><br />
<div style="padding:4px 8px 8px 8px; margin:10px;"><br />
[[File:Osi symbol.png|75px|link=http://opensource.org/|left]]<br />
'''Multi Theft Auto''' jest '''Otwartym Oprogramowaniem'''. <br />
<br/>To znaczy, że każdy może pomóc w byciu Multi Theft Auto lepszym!<br />
</div><br />
|-<br />
| colspan="2" |<br />
|}<br />
{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
<div style="padding-left: 15px; padding-right: 15px;" class="plainlinks"><br />
[[File:MTALogo_8ball.png|left|85px|link=Archive]]<br />
<ul style="list-style: none; width: 200px; float: left;"><br />
<li>'''O [[PL/Multi Theft Auto|Multi Theft Auto]]'''</li><br />
<li>[[PL/Archive|Archiwum]]</li><br />
<li>[[Press Coverage|MTA w mediach]]</li><br />
<li>[http://code.google.com/p/mtasa-blue/people/list Developerzy]</li><br />
</ul><br />
<ul style="list-style: none; width: 200px; float: left;"><br />
<li>'''Multi Theft Auto 0.5'''</li><br />
<li>[[PL/Archive#Multi_Theft_Auto_0.5|Pobierz]]</li><br />
<li>[[MTA 0.5r2 Known Issues|Zauważone problemy]]</li><br />
</ul><br />
<ul style="list-style: none; width: 200px; float: left;"><br />
<li>'''Statystyki Wiki'''</li><br />
<li>{{NUMBEROFARTICLES}} artykuły</li><br />
<li>{{NUMBEROFPAGES}} strony</li><br />
<li>{{NUMBEROFFILES}} pliki</li><br />
</ul><br />
<ul style="list-style: none; width: 240px; float: left;"><br />
<li>{{NUMBEROFEDITS}} edycji</li><br />
<li>{{NUMBEROFADMINS}} administratorów</li><br />
<li>{{NUMBEROFUSERS}} zarejestrowanych użytkowników</li><br />
<li>{{NUMBEROFACTIVEUSERS}} aktywnych użytkowników</li><br />
</ul><br />
</div><br />
|}<br />
<br />
__NOTOC__<br />
__NOEDITSECTION__<br />
{{Languages list|pl}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Client_Scripting_Functions&diff=54147Client Scripting Functions2018-03-17T16:18:29Z<p>CodyJ: Undo revision 54118 by Ciastuuś (talk)</p>
<hr />
<div><pageclass class="client"></pageclass><br />
{{Adding_Pages_to_Categories_and_Templates}}<br />
This page lists all the '''client-side''' scripting functions that have been implemented and are available as native functions from the Deathmatch mod. To request a function or event, use [[Requested Functions and Events]]<br />
<br />
For more functions, check the [[Useful_Functions|useful functions page]].<br />
__TOC__<br />
<br />
==Audio functions==<br />
{{Client_audio_functions}}<br />
<br />
==Blip functions==<br />
{{Client_blip_functions}}<br />
<br />
==Browser functions==<br />
{{CEF_functions}}<br />
<br />
==Camera functions==<br />
{{Client_camera_functions}}<br />
<br />
==Clothes and body functions==<br />
{{Client_Clothes and body functions}}<br />
<br />
==Collision shape functions==<br />
{{Client_collision_shape_functions}}<br />
<br />
==Cursor functions==<br />
{{Client_cursor_functions}}<br />
<br />
==Drawing functions==<br />
{{Drawing_functions}}<br />
<br />
==Effects functions==<br />
{{Client_Effects_functions}}<br />
<br />
==Element functions==<br />
{{Client_element_functions}}<br />
<br />
==Engine functions==<br />
{{Engine_functions}}<br />
<br />
==Event functions==<br />
{{Client_event_functions}}<br />
<br />
==Explosion functions==<br />
{{Client_explosion_functions}}<br />
<br />
==File functions==<br />
{{Client file functions}}<br />
<br />
==Fire functions==<br />
{{Client fire functions}}<br />
<br />
==GUI functions==<br />
{{GUI_functions}}<br />
<br />
==Input functions==<br />
{{Client_input_functions}}<br />
<br />
==Light functions==<br />
{{Client_light_functions}}<br />
<br />
==Marker functions==<br />
{{Client_marker_functions}}<br />
<br />
==Matrix functions==<br />
{{Shared_matrix_functions}}<br />
<br />
==Object functions==<br />
{{Client_object_functions}}<br />
<br />
==Output functions==<br />
{{Client_output_functions}}<br />
<br />
==Ped functions==<br />
{{Client_ped_functions}}<br />
<br />
==Pickup functions==<br />
{{Client_pickup_functions}}<br />
<br />
==Player functions==<br />
{{Client_player_functions}}<br />
<br />
==Projectile functions==<br />
{{Client_projectile_functions}}<br />
<br />
==Radar area functions==<br />
{{Client_radar-area_functions}}<br />
<br />
==Resource functions==<br />
{{Client_resource_functions}}<br />
<br />
==Searchlight functions==<br />
{{Client_searchlight_functions}}<br />
<br />
==Team functions==<br />
{{Client_team_functions}}<br />
<br />
==Utility functions==<br />
{{Client_utility_functions}}<br />
<br />
==UTF8 Library==<br />
{{UTF8 functions}}<br />
<br />
==Vehicle functions==<br />
{{Client_vehicle_functions}}<br />
<br />
==Water functions==<br />
{{Client_water_functions}}<br />
<br />
==Weapon functions==<br />
{{Client_weapon_functions}}<br />
<br />
==Weapon Creation functions==<br />
<strike>Documentation can be found [http://code.google.com/p/mtasa-blue/source/detail?r=4555 here] [https://github.com/multitheftauto/mtasa-blue/commit/c0ac461867e24fe5fc471fe373ec6212e8736c01 (GitHub)] and [http://code.google.com/p/mtasa-blue/source/detail?r=4557 here] [https://github.com/multitheftauto/mtasa-blue/commit/9c2464b5e0c7d0f2915a9b46273832cd950af48e (GitHub)]</strike><br />
{{Client_weapon_creation_functions}}<br />
<br />
==World functions==<br />
{{Client_world_functions}}<br />
<br />
==XML functions==<br />
{{Client XML functions}}<br />
<br />
[[ar:Client Scripting Functions]]<br />
[[pl:Funkcje po stronie klienta]]<br />
[[it:Funzioni Client-side]]<br />
[[ru:Client Scripting Functions]]<br />
[[es:Funciones del cliente]]<br />
[[de:Clientseitige_Funktionen]]<br />
[[tr:Client Taraflı Fonksiyonlar]]<br />
[[pt-br:Funções de Scripting do Cliente]]<br />
[[zh-cn:客户端脚本函数]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Client_Scripting_Events&diff=54146Client Scripting Events2018-03-17T16:18:13Z<p>CodyJ: Undo revision 54119 by Ciastuuś (talk)</p>
<hr />
<div><pageclass class="client"></pageclass><br />
This page lists all '''client-side''' scripting [[event]]s that have been implemented and are available in the Deathmatch mod.<br />
<br />
To request a function or event, use [[Requested Functions and Events]].<br />
<br />
'''Server-side scripting events can be found here: [[Server Scripting Events]]<br />
<br />
==Browser events==<br />
{{CEF_events}}<br />
<br />
==Colshape events==<br />
{{Client_colshape_events}}<br />
<br />
==Element events==<br />
{{Client_element_events}}<br />
<br />
==GUI events==<br />
{{GUI_events}}<br />
<br />
==Marker events==<br />
{{Client_marker_events}}<br />
<br />
==Ped events==<br />
{{Client_ped_events}}<br />
<br />
==Pickup events==<br />
{{Client_pickup_events}}<br />
<br />
==Player events==<br />
{{Client_player_events}}<br />
<br />
==Object events==<br />
{{Client_object_events}}<br />
<br />
==Projectile events==<br />
{{Client_projectile_events}}<br />
<br />
==Resource events==<br />
{{Client_resource_events}}<br />
<br />
==Sound events==<br />
{{Sound_events}}<br />
<br />
==Vehicle events==<br />
{{Client_vehicle_events}}<br />
<br />
==Weapon creation events==<br />
{{Client_weapon_creation_events}}<br />
<br />
==Other events==<br />
{{Client_other_events}}<br />
<br />
[[pl:Client Scripting Events]]<br />
[[ru:Client Scripting Events]]<br />
[[es:Client Scripting Events]]<br />
[[fr:Client Scripting Events]]<br />
[[tr:Client Taraflı Eventler]]<br />
[[ar:Client Scripting Events]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Server_Scripting_Functions&diff=54145Server Scripting Functions2018-03-17T16:18:06Z<p>CodyJ: Undo revision 54120 by Ciastuuś (talk)</p>
<hr />
<div><pageclass class="server"></pageclass><br />
{{Adding_Pages_to_Categories_and_Templates}}<br />
This page lists all the '''server-side''' scripting functions that have been implemented and are available as native functions. To request a function or event, use [[Requested Functions and Events]] or https://bugs.mtasa.com.<br />
<br />
Please note that the scripting functions can also be extended by loading in dynamic modules that provide new functionality, such as utility functions. These scripting functions are non-native and require the module to be loaded in order to work.<br />
<br />
Head over to [[Modules]] for a list of non-native serverside functions and modules that are available.<br />
<br />
For more functions, check the [[Useful_Functions|useful functions page]].<br />
<br />
'''Client-side scripting functions can be found here: [[Client Scripting Functions]].'''<br />
__TOC__<br />
<br />
==Account functions==<br />
{{Account_functions}}<br />
<br />
==ACL functions==<br />
{{ACL_functions}}<br />
<br />
==Admin functions==<br />
{{Admin_functions}}<br />
<br />
==Audio functions==<br />
{{Audio_functions}}<br />
<br />
==Announcement functions==<br />
{{Announce_functions}}<br />
<br />
==Blip functions==<br />
{{Blip_functions}}<br />
<br />
==Camera functions==<br />
{{Camera functions}}<br />
<br />
==Clothes and body functions==<br />
{{Clothes and body functions}}<br />
<br />
==Collision shape functions==<br />
{{Collision shape functions}}<br />
<br />
==Cursor functions==<br />
{{Cursor_functions}}<br />
<br />
==Element functions==<br />
{{Element functions}}<br />
<br />
==Event functions==<br />
{{Event_functions}}<br />
<br />
==Explosion functions==<br />
{{Explosion_functions}}<br />
<br />
==File functions==<br />
{{File_functions}}<br />
<br />
==HTTP functions==<br />
{{HTTP_functions}}<br />
<br />
==Input functions==<br />
{{Input_functions}}<br />
<br />
==Map functions==<br />
{{Map_functions}}<br />
<br />
==Marker functions==<br />
{{Marker functions}}<br />
<br />
==Matrix functions==<br />
{{Shared_matrix_functions}}<br />
<br />
==Module functions==<br />
{{Module functions}}<br />
<br />
==Object functions==<br />
{{Object functions}}<br />
<br />
==Ped functions==<br />
{{Ped_functions}}<br />
<br />
==Pickup functions==<br />
{{Pickup functions}}<br />
<br />
==Player functions==<br />
{{Player functions}}<br />
<br />
==Projectile functions==<br />
{{Projectile_functions}}<br />
<br />
==Radar area functions==<br />
{{Radar area functions}}<br />
<br />
==Resource functions==<br />
{{Resource functions}}<br />
<br />
==Server functions==<br />
{{Server functions}}<br />
<br />
==Settings registry functions==<br />
{{Settings registry functions}}<br />
<br />
==SQL functions==<br />
{{SQL_functions}}<br />
<br />
==Team functions==<br />
{{Team functions}}<br />
<br />
==Text functions==<br />
{{Text functions}}<br />
<br />
==Utility functions==<br />
{{Utility functions}}<br />
<br />
==UTF8 Library==<br />
{{UTF8 functions}}<br />
<br />
==Vehicle functions==<br />
{{Vehicle functions}}<br />
<br />
==Water functions==<br />
{{Water functions}}<br />
<br />
==Weapon functions==<br />
{{Weapon functions}}<br />
<br />
==World functions==<br />
{{World functions}}<br />
<br />
==XML functions==<br />
{{XML functions}}<br />
<br />
[[ar:Server Scripting Functions]]<br />
[[de:Server-Seitige Scripting Funktionen]]<br />
[[es:Funciones_del_Server]]<br />
[[pl:Server Scripting Functions]]<br />
[[pt-br:Funções de Scripting do Servidor]]<br />
[[ru:Server Scripting Functions]]<br />
[[tr:Server Scripting Functions]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Server_Scripting_Events&diff=54144Server Scripting Events2018-03-17T16:17:51Z<p>CodyJ: Undo revision 54121 by Ciastuuś (talk)</p>
<hr />
<div><pageclass class="server"></pageclass><br />
This page lists all '''server-side''' scripting [[event]]s that have been implemented and are available in the Deathmatch mod.<br />
<br />
To request a function or event, use [[Requested Functions and Events]].<br />
<br />
'''Client-side scripting events can be found here: [[Client Scripting Events]]<br />
<br />
==Client events==<br />
{{Client_events}}<br />
<br />
==Colshape events==<br />
{{Colshape_events}}<br />
<br />
==Element events==<br />
{{Element_events}}<br />
<br />
==Marker events==<br />
{{Marker_events}}<br />
<br />
==Pickup events==<br />
{{Pickup_events}}<br />
<br />
==Player events==<br />
{{Player_events}}<br />
<br />
==Ped events==<br />
{{Ped_events}}<br />
<br />
== Resource events==<br />
{{Resource_events}}<br />
<br />
==Server events==<br />
{{Server_events}}<br />
<br />
== Vehicle events ==<br />
{{Vehicle_events}}<br />
<br />
== Weapon events ==<br />
{{Weapon_events}}<br />
<br />
[[tr:Server Scripting Events]]<br />
[[pt-br:Eventos de Scripting do Servidor]]<br />
[[ru:Server Scripting Events]]<br />
[[fr:Server Scripting Events]]<br />
[[ru:Server Scripting Events]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Useful_Functions&diff=54143Useful Functions2018-03-17T16:17:36Z<p>CodyJ: Undo revision 54122 by Ciastuuś (talk)</p>
<hr />
<div><pageclass class="#228B22"></pageclass><br />
{{MessageBox|<br />
bordercolorhex = 000000 |<br />
bordertype = dotted |<br />
bgcolorhex = EFEFEF |<br />
image = File:Package-x-generic.png |<br />
title = Don't forget to check out the [[Useful Classes]] |<br />
subtext = <span style="font-size: 85%;">''That page lists user-made classes that are not included by default in MTA. ''</span> |<br />
}}<br />
{{Adding_Pages_to_Categories_and_Templates}}<br />
<br />
This page lists user-made Lua functions that are not included by default in MTA. Its purpose is to quickly provide some useful functions for scripters, so they do not waste time recreating them when needed.<br />
<br/><br />
{{Useful_Functions}}<br />
[[ES:Funciones Útiles]]<br />
[[ru:Useful Functions]]<br />
[[de:Nützliche_Funktionen]]<br />
[[PL:Użyteczne Funkcje]]<br />
[[Ar:وظائف مفيدة]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=MTA_Classes&diff=54142MTA Classes2018-03-17T16:17:28Z<p>CodyJ: Undo revision 54123 by Ciastuuś (talk)</p>
<hr />
<div>In order to perform operations on MTA objects via scripting, pointers to internal classes are exported to scripts as Lua userdata. Each of these classes has a number of exported scripting functions associated to them.<br />
<br />
Elements that have a physical representation in the game are also known as [[entity|Entities]].<br />
<br />
The complete list of classes to be found in scripts follows:<br />
<br />
* [[account|Account]]<br />
* [[acl|ACL]]<br />
* [[aclgroup|ACL group]]<br />
* [[Ban]]<br />
* [[element|Element]]<br />
<ul>{{Elements}}</ul><br />
* [[resource|Resource]]<br />
* [[textdisplay|Text display]]<br />
* [[textitem|Text item]]<br />
* [[timer|Timer]]<br />
* [[xmlnode|XML node]]<br />
* [[connection|Connection]]<br />
[[Category:Scripting Concepts]]<br />
[[es:Clases MTA]]<br />
[[it:Classi di MTA]]<br />
[[ru:Классы MTA]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Element&diff=54141Element2018-03-17T16:17:15Z<p>CodyJ: Undo revision 54124 by Ciastuuś (talk)</p>
<hr />
<div>{{Needs_Checking|Water must be considered as an element}}<br />
<br />
An '''element''' is a generic class that can represent almost all in-game [[entity|entities]]. The built-in element types are:<br />
<br />
{{Elements}}<br />
<br />
Any other element type can be created as an abstract element, not referring to any game [[entity]]. For example, '''resource''' and '''map''' elements are created when resources and maps are loaded to group entities they create as their children.<br />
<br />
Elements share common functions such as type and list retrieval, a destroy operation to remove both the element and the game entity it is linked to (except for some elements which can't be destroyed, for example client elements), [[element data]] storing and retrieval, and many more common operations.<br />
<br />
All elements are stored internally in a [[Element tree|tree structure]], and as such every element except the '''root''' element has a parent element, that can be the '''root''' element, a '''resource''', '''map''' or another element. This is purely for declaring the scope of function calls.<br />
<br />
==Related scripting functions==<br />
===Client===<br />
{{Client element functions}}<br />
===Server===<br />
{{Element functions}}<br />
[[Category:Scripting Concepts]]<br />
<br />
[[it:Elemento]]<br />
[[ru:Element]]<br />
[[es:Elemento]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Element_tree&diff=54140Element tree2018-03-17T16:17:05Z<p>CodyJ: Undo revision 54125 by Ciastuuś (talk)</p>
<hr />
<div>[[File:Tre.png|frame|Element tree]]<br />
MTA uses a so-called ''element tree'' to store all the elements that exist on the server and the client. This is directly related to the set of running [[resources]] and their map files' XML layout, although it can be changed at run-time by scripts.<br />
<br />
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it like a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element.<br />
<br />
All elements that are created within scripts or from .map files are child elements of the resource they belong to. Thus, most elements (except for [[client]]s) exist only within resources and are also destroyed as soon as their resource is stopped.<br />
<br />
==Tree elements==<br />
* '''root''': This is at the very base of the tree - all elements are children (or descendants) of this element.<br />
<syntaxhighlight lang="lua"><br />
getRootElement()<br />
</syntaxhighlight><br />
* '''resource''': These are direct children of the root element - with one for each ''running'' resource. This element is called the ''resource root''. Its ID holds the name of the resource.<br />
<syntaxhighlight lang="lua"><br />
getResourceRootElement()<br />
</syntaxhighlight><br />
* '''map''': Each resource element contains at least one map element, representing either a ".map" file in the resource or the one containing the elements created by scripts (this is called the ''dynamic'' map). Their IDs contain the maps' filenames, or ''dynamic'' for the dynamic map.<br />
** Map files can contain a number of other [[element]]s as well as an unlimited number of custom elements.<br />
<br />
==Example==<br />
This in an example of a serverside tree dumped to XML from a running server.<br />
''Please note that it is shortened on some places for the sake of overview.''<br />
<syntaxhighlight lang="xml"><br />
<root><br />
<console/><br />
<player dontRespawn="false"/><br />
<player dontRespawn="false" lastSpawnarea=""/><br />
<resource id="resourcebrowser"/><br />
<resource id="ajax"/><br />
<resource id="resourcemanager"/><br />
<resource id="spawnmanager"/><br />
<resource id="mapmanager"/><br />
<resource id="runcode"/><br />
<resource id="fr"><br />
<map id="dynamic"><br />
<vehicle/><br />
</map><br />
</resource><br />
<resource id="elementbrowser"/><br />
<resource id="assault"><br />
<map id="dynamic"><br />
<team/><br />
<team/><br />
<blip/><br />
<marker/><br />
<colshape/><br />
<blip/><br />
<blip/><br />
</map><br />
</resource><br />
<resource id="as-farm"><br />
<map id="dynamic"/><br />
<map id="as-farm.map"><br />
<spawngroup req="" type="attacker"><br />
<spawnarea posY="-8.3976354598999" posX="20.182683944702" skins="9" ... /><br />
</spawngroup><br />
<spawngroup req="" type="attacker"><br />
<spawnarea posY="32.166355133057" posX="-46.90763092041" skins="9" ... /><br />
</spawngroup><br />
<spawngroup req="" type="attacker"><br />
<spawnarea posY="35.214984893799" posX="-33.486911773682" skins="9" ... /><br />
</spawngroup><br />
<spawngroup req="" type="attacker"><br />
<spawnarea posY="35.214984893799" posX="-33.486911773682" skins="9" ... /><br />
</spawngroup><br />
<objective id="first" type="checkpoint" description="Breach into the farm" ... /><br />
<pickup type="weapon" ... /><br />
</map><br />
</resource><br />
</root><br />
</syntaxhighlight><br />
===Explanation===<br />
This tree consists of a number of resource root elements, the [[Element/Console|server console]] and two [[player]] elements, that are direct children of the '''root''' element. All these resources have a ''dynamic map'' as child element (it is just not shown for most of them). These contain the elements that are created dynamically by this resource using scripts, for example a [[vehicle]]. If the resource has a map file, it is also a child element, itself containing all the elements in the .map file.<br />
<br />
Let's have a closer look at the '''assault''' resource: This contains just one ''dynamic'' map that has 2 teams, 3 blips, 1 marker and 1 colshape as child elements. These are the elements that are created by the script, for example the marker, the colshape and one of the blips are probably used for the objective.<br />
<br />
The '''as-farm''' resource's function on the contrary is to be a map for the '''assault''' gamemode. The dynamic map is empty (it could contain elements if there was a script in it though), while there is a map called 'as-farm.map', that contains a number of elements. These are mostly custom elements (like spawngroup, spawnarea, objective) but also a few elements that MTA creates automactically after loading the map (like pickup). In the brackets after the element type, you can see the element data it contains. These are identical with the attributes the .map file contains within these elements, while you can also set and get element data for any other elements (e.g. players) with [[setElementData]] and [[getElementData]].<br />
<br />
==Pratical application==<br />
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes in to its own when combined with the scripting system.<br />
<br />
===Setting data for elements===<br />
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).<br />
<br />
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.<br />
<syntaxhighlight lang="lua"><br />
setMarkerSize ( getRootElement(), 2.5 )<br />
</syntaxhighlight><br />
<br />
The same can be done on any element, it is not restricted to the root element.<br />
<br />
===Map manager===<br />
The [[#Example|example above]] shows the way the [[map manager]] uses different resources. The 'assault' resource is the gamemode, that manages what happens on the server using scripts and thus by creating elements in the tree dynamically. When a map resource is started, the gamemode receives a [[resource|resource pointer]] referring to the started resource - in this case ''as-farm'' - from which you can retrieve and store the resource root element. Using this element in conjunction with functions like [[getElementsByType]], [[getElementData]] and various others, you can access any of the information that was loaded into the tree from the 'as-farm.map'-file through scripts in the gamemode resource.<br />
<br />
Another thing that has to be considered related to the tree of elements is the fact that when you change the map, you don't have to remove any elements you created within the map resource, while you '''do''' have to remove elements that are created within the gamemode resource, '''if''' they are specific to the map (which will be probably the case for those items you create based on information read from the map resource's .map files).<br />
<br />
==Element browser==<br />
You can start the resource ''elementbrowser'' to see a live view of the element tree on your server. Just start the resource and browser to your server's web page and choose the ''Element browser'' option in the sidebar (firefox only currently).<br />
[[Category:Scripting Concepts]]<br />
[[es:Árbol de elementos]]<br />
[[ru:Element tree]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Where_to_buy_GTASA&diff=54139Where to buy GTASA2018-03-17T16:16:40Z<p>CodyJ: Undo revision 54126 by Ciastuuś (talk)</p>
<hr />
<div>This page outlines some of the places Grand Theft Auto San Andreas can be bought digitally and played with MTASA (sometimes with an automatic downgrade step). Not all of these have been tested, but all should work correctly. If not, please contact support. <br />
<br />
All disc (DVD) versions of Windows GTASA are known to function fine. If you are planning on buying a DVD of GTASA, you should try to obtain a "Standard" version rather than "Second Edition" or "Greatest Hits" editions, though all will work fine.<br />
<br />
{| class="wikitable" style="width: 900px; text-align: center; table-layout: fixed;"<br />
|-<br />
!Retailer<br />
!Notes<br />
!Verified to work with MTA: SA?<br />
|-<br />
|[http://store.steampowered.com/app/12120/ Steam]<br />
|Specialized Steam version of the game. MTA installer will downgrade this for you. <br />
|{{Yes}}<br />
|-<br />
| rowspan="2" |[http://www.amazon.com/Grand-Theft-Auto-Andreas-Download/dp/B006YVXGJQ Amazon]<br />
| For the '''Standard''' edition of the game, if MTA is incompatible, try obtaining a GTA SA 1.00 No CD - any HOODLUM release will function correctly.<br />
| {{Partial|Unconfirmed (Standard)}}<br />
|-<br />
| Steam version and disc copies of GTASA will function fine<br />
| {{Yes| Yes (Steam/Boxed DVD)}}<br />
|-<br />
|[http://www.gamersgate.co.uk/DD-GTASAS/grand-theft-auto-san-andreas GamersGate]<br />
|rowspan=6|This is the Steam version of the game, and will function similarly.<br />
|rowspan="6" {{Yes}}<br />
|-<br />
|[http://www.game.co.uk/en/grand-theft-auto-san-andreas-301403 Game UK]<br />
|-<br />
|[http://digital.gamefly.co.uk/#!/download-grand-theft-auto-san-andreas/5006365 GameFly Digital]<br />
|-<br />
|[http://www.greenmangaming.com/s/gb/en/pc/games/action/grand-theft-auto-san-andreas/ GreenManGaming]<br />
|-<br />
|[http://www.gamestop.com/pc/games/grand-theft-auto-san-andreas/37409 GameStop]<br />
|-<br />
|[http://www.walmart.com/ip/Take-Two-GTASAESD-Grand-Theft-Auto-San-Andreas-PC/36754297 Walmart]<br />
|-<br />
|-<br />
|Windows App Store<br />
|This is a mobile version of the game ported to PC. '''Will never work with MTA'''.<br />
|{{No}}<br />
|-<br />
<br />
[[es:Dónde comprar GTA: SA]]<br />
[[pl:Where to buy GTASA]]<br />
[[ru:Where to buy GTASA]]<br />
[[tr:GTA:SA Nerden Alınır]]<br />
[[zh-cn:在那里可以购买GTASA]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Client_Manual&diff=54138Client Manual2018-03-17T16:16:26Z<p>CodyJ: Undo revision 54127 by Ciastuuś (talk)</p>
<hr />
<div>==Before you start==<br />
Before you install Multi Theft Auto: San Andreas, first make sure that there are no modifications to GTA:SA installed. These will conflict with MTA. If you would like to keep your single player mods, you can create two installations by reinstalling San Andreas to a second folder on your hard drive.<br />
<br />
Also make sure that your machine is capable of running the game in single player. Note that if you are running single player on the absolute minimum requirements, you will experience slowdowns in MTA as it takes up extra processing power.<br />
{{Note| <br />
* MTA:SA will only work on GTA:SA '''v1.0'''. If you bought the game recently, it is likely that you have a later version.''' [[Known_Issues_-_FAQ#Does_MTASA_work_with_v1.01_or_v2.00_of_GTA_San_Andreas.3F| (More info)]]<br />
* If you have a Steam copy of GTA: San Andreas you should [[Known_Issues_-_FAQ#I_have_the_Steam_version_of_GTA_San_Andreas._How_can_I_play_MTASA.3F|read this first]].<br />
}}<br />
<br />
===System requirements===<br />
====Minimum system requirements====<br />
The minimum system requirements for Multi Theft Auto: San Andreas are '''slightly higher''' than the original minimum requirements for Grand Theft Auto: San Andreas:<br />
* Windows 7 or newer operating system ([[Compatibility FAQ|XP and Vista work, but they are obsolete and their support is being phased out]])<br />
* Intel Pentium 4 or AMD Athlon XP<br />
* 1GB DDR RAM<br />
* Clean installation of Grand Theft Auto: San Andreas, version 1.0 (American or European)<br />
* 3.7GB of free hard disk space (3.6GB for a minimum Grand Theft Auto installation; remember that MTA caches files from the servers that you play on and require disk space)<br />
* nVidia GeForce 4 series or ATI Radeon 8xxx series (64MB VRAM and DirectX 9.0 compatible)<br />
* DirectX 9.0 compatible sound card<br />
* Keyboard and mouse<br />
* Internet access<br />
<br />
====Recommended system requirements====<br />
* Windows 7 or newer 64-bits operating system<br />
* Intel Core 2 Duo Processor or AMD equivalent<br />
* 2GB DDR RAM<br />
* Clean installation of Grand Theft Auto: San Andreas, version 1.0 (American or European)<br />
* >5GB of free hard disk space<br />
* nVidia GeForce FX series or higher, ATI Radeon 9xxx series or higher, Pixel Shader 2.0 compatible<br />
* DirectX 9.0 compatible sound card<br />
* Keyboard and mouse<br />
* Broadband internet access (for smooth online play)<br />
<br />
====Notes====<br />
* The minimum system requirements are considered the bare minimum for MTA: San Andreas, the performance can depend on the game modes that are running and the player count.<br />
* For extra loading performance, more RAM is recommended.<br />
* Make sure Windows is fully up to date.<br />
* Make sure you head over to the [[Known_Issues_-_FAQ|Known Issues]] page if you have issues, or join us on IRC @ irc://irc.multitheftauto.com/mta<br />
<br />
==Installing the game==<br />
# If you haven't already, download the MTA:SA client from the download page at [http://mtasa.com mtasa.com].<br />
# Run the installer, for Windows Vista and 7 it is required to run this with administrator rights. (The installer will ask.)<br />
# You need to accept the license that comes with MTA:SA (GPLv3).<br />
# You will be asked which components to install:<br />
#* '''Game Client''' interfaces with the game and is a required component.<br />
#* '''Dedicated Server''' enables you to host your own home-brew server.<br />
#** '''Core components''' and '''Game module''' are required components for the dedicated server.<br />
#** '''Core resources''' required resources for dedicated server.<br />
#** '''Optional resources''' additional resources for your dedicated server, gamemodes and maps.<br />
#** '''Editor''' is used to create new maps, this is an optional component.<br />
#* '''Development''' development tools.<br />
#** '''Module SDK''' development SDK for creating your own MTA server modules, this component requires C++ knowledge.<br />
#* '''Start menu group''' creates a start menu group for the installed components.<br />
#* '''Desktop icon''' creates a desktop icon for the client.<br />
# You are then asked for a folder in which to install the mod. This can by anywhere and doesn't have to be in you San Andreas directory.<br />
# Next, you will be asked for the directory where you have San Andreas installed. The default location is: '''C:\Program Files\Rockstar Games\GTA San Andreas\'''.<br />
# When the installation completes, you will be given the option to start MTA: San Andreas straight away. Choose your option and then press '''Finish'''.<br />
# You will be able to launch ''MTA San Andreas'' from your Start Menu if you wish to play.<br />
<br />
==Running the game==<br />
# Start Multi Theft Auto by clicking the icon located in your Start Menu under '''MTA:San Andreas'''.<br />
# GTA: San Andreas will start and once it is loaded, you will be presented with the MTA:SA main menu. Here you will find several options (you could also watch a how-to tutorial [http://www.youtube.com/watch?v=ShiqnOazNYw here]):<br />
<br />
{| border="0" align="center"<br />
<br />
| width="188" |<br />
[[Image:Server_Browser.jpg|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Browse servers''' – this allows you to receive a list of available servers to play on. </font><br />
<br />
<br /><br />
|-<br />
| width="188" |<br />
[[Image:Host_Game.jpg|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Host game''' – this allows you to start a local server. </font><br />
<br />
<br /><br />
|-<br />
| width="188" |<br />
[[Image:Menu_Settings.JPG|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Settings '''– this allows you to change your in-game nickname, customize controls and adjust display settings.</font><br />
<br />
<br /><br /><br />
|-<br />
| width="188" |<br />
[[Image:About_Menu.jpg|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''About '''– this gives you a list of contributors to the project.</font><br />
<br />
<br /><br />
|-<br />
| width="188" |<br />
[[Image:Map_Editor.jpg|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Map editor '''– this allows you to create your own maps, complete with checkpoints, ramps, pickups and other objects. These can then be uploaded onto a server so that you can play them with other people.</font><br />
<br />
<br /><br /><br />
|-<br />
| width="188" |<br />
<br><br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Quit '''– this returns you back to your Windows desktop.</font><br />
<br />
<br /><br /><br />
|}<br />
<br />
The easiest way to play the game is to click '''Browse Servers''' on the menu. If servers have not appeared already, press the '''Refresh''' button and MTA will scan for servers, displaying them as a list.<br />
<br />
* Under the '''Name''' tab, each server's name is displayed.<br />
* Under the '''Players''' tab, the number of players and the maximum capacity of the server is displayed, in the format of [Used Slots] / [Maximum Slots].<br />
* The '''Ping''' tab displays the ping, or latency, between your machine and the server. Ping is a measure of the time it takes for "packets" of data to be received back from the server after sending them, so a higher ping means that you will experience more lag on that particular server. Generally, servers closest to your location should have the lowest pings.<br />
* The '''Host''' is the IP address of the server. You can use this address in future to connect to the same server via the Quick Connect option on the main menu.<br />
<br />
Each tab can be clicked to arrange the respective column in ascending or descending order.<br />
<br />
For optimal performance and gameplay, look for the best balance between players and ping.<br />
<br />
Once you have picked a server, select it and click the '''Connect''' button in the top right-hand corner of the dialog. If all goes well, you should connect to the server and automatically join the game.<br />
<br />
==How to Play==<br />
<br />
MTA:SA offers a comprehensive scripting system that allows map creators to customize many elements of the game in order to create their own innovative game modes. The game incorporates as many single player elements as possible but some aspects are different.<br />
<br />
The only other people on the map are your opponents, or allies if it is a team game. You can talk with them using the chatbox located in the left-hand corner of the screen by pressing '''T'''. To chat only to your team members, press '''Y'''.<br />
<br />
MTA's map editor allows map creators to add various GTA objects to their maps including roads, exploding barrels, ramps, buildings, hills and more. Not only this, but the objects can be scripted to move, change model and disappear. This offers a great deal of fun and variation to the gameplay. <br />
<br />
Holding Tab will display the scoreboard. By default, only names and pings are displayed, but scripts can add extra columns that are specific to the particular gamemode being played. For example, a deathmatch game mode would definitely have a column listing total kills, but the map creator may choose to add extra columns for the number of deaths you have and how long you have been playing for, in order to put your score into perspective.<br />
<br />
==Default Controls==<br />
<br />
===In-Game Keys===<br />
<br />
* F8 (or Tilde Key) - Console<br />
* F11 - Show SA map ''(the following list is for use when the map is up)''<br />
**numpad /- - Zoom in and out<br />
**numpad 4, 8, 6, 2 - move map left, up, right, down<br />
**numpad 0 - toggle between attach to local player (map follows player blip) and free move (map stays stationary) <br />
* F12 - Take a screenshot<br />
* T - Chat<br />
* Y - Team Chat<br />
<br />
===Resource Specific Keys===<br />
These keys depend on the scripts that are running on the server.<br />
<br />
* F9 - In-game help (Help manager resource)<br />
* V - Push to talk, if voice is enabled on the server.<br />
* TAB - Player List (if [[Scoreboard]] resource is running on the server)<br />
<br />
==Console Commands==<br />
<br />
'''bind defaults''' Binds control defaults in the settings menu<br />
<br />
Press '''~ (tilde)''' or '''F8''' to access the console, then type a command followed by any necessary parameters (if applicable) then press Enter.<br />
<br />
;'''maps''' :This displays a list of all maps available on the server. <br />
<br />
;'''nick [nickname]''' :This changes your nickname whilst in-game to whatever you specify in the parameters.<br />
<br />
;'''msg [nickname] [message]''' or '''pm [nickname] [message]''' :This sends a private message to the person you specify in the [nickname] parameter. Only the person you specify can see the message. Both '''msg''' and '''pm''' perform the same function.<br />
<br />
;'''quit''' or '''exit''' :This disconnects you from the server and returns you to the Windows desktop. Performs the same function as the Quit button on the main menu.<br />
<br />
;'''ver''' :This displays the version number and copyright information for the software.<br />
<br />
;'''sver''' :This displays the version number of the server you are connected to.<br />
<br />
;'''time''' :This displays the current time.<br />
<br />
;'''disconnect''' :This disconnects you from the server and returns you to the main menu.<br />
<br />
;'''say [text]''' :This enables you to continue talking to people in the chat box whilst the console is open.<br />
<br />
;'''ignore [nickname]''' :This will not display any text typed by the player you wish to ignore. To stop ignoring a player, type '''ignore [nickname]''' again.<br />
{{Tip|You can use these commands in the chatbox by putting a / (forward slash) in front of them.}}<br />
<br />
A list of console commands can be seen by typing '''help''' into the console and pressing Enter. The current map may also have extra commands which can be accessed by typing '''commands''' into the console.<br />
<br />
For information on more commands see: [[Client Commands]]<br />
<br />
==Error codes and their meanings==<br />
=== Download errors ===<br />
:{| class="wikitable sortable" style="width: auto; table-layout: fixed;"<br />
|-<br />
!Code<br />
!scope="col" class="unsortable" | Meaning<br />
|-<br />
|0<br />
|UNKNOWN_ERROR<br />
|-<br />
|1<br />
|INVALID_FILE_DESCRIPTORS<br />
|-<br />
|2<br />
|INVALID_MAX_FILE_DESCRIPTOR<br />
|-<br />
|3<br />
|INVALID_SELECT_RETURN<br />
|-<br />
|4<br />
|INVALID_INITIAL_MULTI_PERFORM<br />
|-<br />
|5<br />
|INVALID_MULTI_PERFORM_CODE<br />
|-<br />
|6<br />
|INVALID_MULTI_PERFORM_CODE_NEW_DOWNLOADS<br />
|-<br />
|7<br />
|UNEXPECTED_CURL_MESSAGE<br />
|-<br />
|8<br />
|UNABLE_TO_CONNECT<br />
|-<br />
|9<br />
|UNABLE_TO_DOWNLOAD_FILE<br />
|-<br />
|10<br />
|FAILED_TO_INITIALIZE_DOWNLOAD<br />
|}<br />
===Fatal errors===<br />
:{| class="wikitable sortable" style="width: auto; table-layout: fixed;"<br />
|-<br />
!Code<br />
!scope="col" class="unsortable" | Meaning<br />
|-<br />
|1<br />
|no local player model on ingame event<br />
|-<br />
|2<br />
|no local player on ingame event<br />
|-<br />
|3<br />
|server downloads disabled<br />
|-<br />
|4<br />
|no local player model on player-list packet<br />
|-<br />
|5<br />
|no local player on player-list packet<br />
|-<br />
|6<br />
|invalid custom data length on entity-add packet<br />
|-<br />
|7<br />
|invalid bitstream data on entity-add packet<br />
|-<br />
|8<br />
|system entity on entity-add packet<br />
|-<br />
|9<br />
|failed to create object on entity-add packet<br />
|-<br />
|10<br />
|failed to create pickup on entity-add packet<br />
|-<br />
|11<br />
|failed to create vehicle on entity-add packet<br />
|-<br />
|12<br />
|invalid team-name length on entity-add packet<br />
|-<br />
|13<br />
|invalid lua-event name length in lua-event packet<br />
|-<br />
|14<br />
|invalid resource name length in resource-start packet<br />
|}<br />
<br />
==='Unable to enter vehicle' errors===<br />
:{| class="wikitable sortable" style="width: auto; table-layout: fixed;"<br />
|-<br />
!Code<br />
!scope="col" class="unsortable" | Meaning<br />
|-<br />
|1<br />
|script cancelled<br />
|-<br />
|2<br />
|script cancelled (jack)<br />
|-<br />
|3<br />
|current occupier is entering/exiting<br />
|-<br />
|4<br />
|invalid seat<br />
|-<br />
|5<br />
|not close enough<br />
|-<br />
|6<br />
|already in a vehicle<br />
|-<br />
|7<br />
|already entering/exiting<br />
|-<br />
|8<br />
|invalid vehicle (trailer)<br />
|}<br />
<br />
==Special: Playing MTA on Linux?==<br />
If you're one of those who have Linux as OS, and want to have the client working on Linux,<br />
please read the [[Client_on_Linux_Manual|Client on Linux Manual]]<br />
<br />
[[cs:Client Manual]]<br />
[[es:Manual Cliente Deathmatch]]<br />
[[de:MTA DM Client Anleitung]]<br />
[[it:Manuale del Client]]<br />
[[nl:Deathmatch Client Manual]]<br />
[[ru:Deathmatch Client Manual]]<br />
[[pl:Client Manual]]<br />
[[pt-br:Manual do Cliente]]<br />
[[hu:Client Manual]]<br />
[[zh-cn:客户端手册]]<br />
<br />
[[Category:Support]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Changes_in_1.5.5&diff=54137Changes in 1.5.52018-03-17T16:16:04Z<p>CodyJ: Undo revision 54128 by Ciastuuś (talk)</p>
<hr />
<div>{{Changelogs}}<br />
__NOTOC__<br />
* Changelog on Mantis: https://bugs.mtasa.com/changelog_page.php<br />
* Full changelog: https://github.com/multitheftauto/mtasa-blue/commits/master?page=1<br />
<br />
== Main Additions / Changes ==<br />
* Fixed a couple of crashes<br />
* Updated dependencies<br />
* Upgraded build tools and migrated to a Docker-based environment (now, we have support for VS2017 and GCC-6)<br />
* Code cleanups<br />
<br />
== Scripting ==<br />
=== Client ===<br />
* Return vectors for vehicles component funcs (#9507)<br />
* Made GUI-functions accept vectors<br />
* Added [[guiGetCursorType]]<br />
* Added ''player'' element to [[onClientChatMessage]]<br />
* Added ''soundEnable'' parameter to [[createEffect]]<br />
* Added [[setVehicleModelExhaustFumesPosition]] and [[getVehicleModelExhaustFumesPosition]]<br />
<br />
=== Server ===<br />
* Added [[getDevelopmentMode]], [[setDevelopmentMode]] (client-only before)<br />
* Added [[isResourceArchived]]<br />
<br />
=== Shared (''Client & Server side'') ===<br />
* Added [[debugSleep]]<br />
* Limit range in [[setRainLevel]]<br />
* Extended [[fetchRemote]] by request method, request headers, response headers, authentication, redirection and form fields<br />
* Added RGB parameters to [[onClientDebugMessage]]/[[onDebugMessage]]<br />
* Deprecated ''setControlState''/''getControlState'' in favour of [[setPedControlState]]/[[getPedControlState]]<br />
* Added logging a warning when some functions are used on non-joined players (e.g. when called from [[onPlayerConnect]])<br />
* Fixed [[coroutine.resume]] returning only the first argument<br />
<br />
== Client ==<br />
=== Client: Additions ===<br />
* Added 'localhost' to the hardcoded CEF whitelist<br />
* Enabled [[setPedStat]] for client side peds<br />
* Added black outline option for chat text<br />
* Added support for more gta_sa.exe variants<br />
<br />
=== Client: Bugfixes & Changes ===<br />
* Fixed [[getHeliBladeCollisionsEnabled]] accepting incorrect arguments<br />
* Fixed effect sounds playing at the wrong position (thanks to '''ZRec''')<br />
* Fixed swapped color channels in browsers on Intel integrated graphics<br />
* Changed camera mode used for vehicle targets (for [[setCameraTarget]])<br />
* Fixed [[setObjectBreakable]] not properly working with melee<br />
* Tweaked layout of chatbox settings<br />
* Added chatbox positioning settings<br />
* Fixed warpPedIntoVehicle during freefall preserves falling animation (#9381)<br />
* Fixed some tasks not being cleared if ped is warped to passenger seat<br />
* Fixed water jump animation remaining after warp<br />
* Fixed radio name not always showing<br />
* Improved disconnect time duration text<br />
* Improved client connecting through firewalls<br />
* Improved netcode<br />
* Fixed FOV setting not updating<br />
* Fixed spectate camera movement malfunctioning with vehicles with adjustable property (#5306)<br />
* Fixed crash when removing child elements during events<br />
* Fixed famous crash at offset 0x003F18CF<br />
* Updated CEF<br />
* Fixed aircraft engine sounds being missing sometimes<br />
* Fixed vehicle gear sounds being broken while sitting as passenger (#9681)<br />
* Fixed memory leak and crash in password functions<br />
* Fixed a new crouchbug variant<br />
* Added some missing translations (thanks to '''Sergeanur''')<br />
<br />
== Server ==<br />
=== Server: Additions ===<br />
* Added password append option to ''authserial'' command<br />
<br />
=== Server: Bugfixes & Changes ===<br />
* Hide account passwords from logs when using the /addaccount command<br />
* Censored [[onClientConsole]] for login command<br />
<br />
== Shared ==<br />
=== Shared: Bugfixes & Changes ===<br />
* Migrated from OpenSSL to mbedtls<br />
* Initial work on macOS server support<br />
<br />
== Resources ==<br />
* Updated ''ipb'' resource to 0.3 (includes code cleanups, tweaked GUI layout and client performance stats)<br />
* Modernised ''play'' gamemode<br />
* Fixed fast-flying glitch with hydra/hunter/jetpack on custom gravity (freeroam)<br />
* Added support for hex colors to killmessages (thanks to '''AboShanab''')<br />
* Tweaked realdriveby a lot (thanks to '''emre1702''')<br />
* Tweaked admin report system (thanks to '''Dezash''')<br />
* Fixed warping to interiors on foot (freeroam)<br />
* Added support for hex colors to joinquit<br />
* Added support for blowing off heads (headshot)<br />
* Fixed admin bugs: spectating players in another int/dimension, 'Ban serial/IP' GUI polished (admin)<br />
* Optimized the Freeroam codebase to improve performance and usage & fixed various bugs in the process (freeroam)<br />
* Added anti-bothering features to freeroam panel ('disable warp' & 'disable knifing', anti-ram vehicle ghostmode)<br />
* Fixed player being stuck sometimes when entering interior (interiors)<br />
<br />
== Editor ==<br />
<br />
<br />
== Extra information ==<br />
''More detailed information available on [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] and GitHub repositories:<br />
:* [https://github.com/multitheftauto/mtasa-blue MTA: SA Blue]<br />
:* [https://github.com/multitheftauto/mtasa-resources MTA: SA Official Resources]<br />
<br />
[[Category:Changelog]]<br />
[[Category:Incomplete]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Known_Issues_-_FAQ&diff=54136Known Issues - FAQ2018-03-17T16:15:49Z<p>CodyJ: Undo revision 54129 by Ciastuuś (talk)</p>
<hr />
<div>{{Note_box|Before you check the known issues make sure everything is [[Up-to-date]].}}<br />
Post here your proposed Q&A, regarding the known problems with MTA:SA and their solutions, especially the problems we are encountering now, that might be also encountered by users in the final release. You are also welcome to edit them grammar/style wise.<br />
<br />
* [[Resource:Editor#FAQ|Map editor FAQ/known issues can be found here.]]<br><br />
* [[MTA 0.5r2 Known Issues|Known issues for MTA 0.5r2 can be found here.]]<br />
* [[Compatibility FAQ|Compatibility FAQ]]<br />
<br />
== Client ==<br />
=== General ===<br />
==== I have the Steam version of GTA San Andreas. How can I play MTASA? ====<br />
:The Steam version of GTASA is currently incompatible with MTASA, just like it is with some other mods. However, it can be made to work with it.<br />
<br />
:'''If you just want to play the newest version of the mod, all you need to do is download the mod from our home page and then install it'''. The installer will detect your Steam's GTASA installation and will make some adjustments automatically.<br />
:No original files are modified in the process, so the single player mode will work the same way as it did before.<br />
<br />
<br />
:If you want to play some older MTA:SA version (1.3.2 or older), follow a few simple steps, and the Steam version will be compatible with it:<br />
:* '''Option 1:''' Find a '''GTA SA 1.00 No CD''' (Google will give useful results). You should obtain a 1.00 Cracked/NoCd EXE, not a Disc image. Any HOODLUM release will work fine.<br />
:** Open the download with Winrar or other similar archive tools, and inside there should be a gta_sa.exe. Place this file inside your installation directory. This is normally '''C:\Program Files\Steam\steamapps\common\grand theft auto san andreas'''. No files need to be replaced during this process.<br />
:This procedure will not affect your Steam version of GTASA, but will allow MTASA to boot alongside it.<br />
:* '''Option 2:''' Use the unofficial [https://forums.steampowered.com/forums/showthread.php?t=1952458 steam downgrade patch], be sure to downgrade to 1.0 and not 1.01.<br />
<br />
==== Does MTASA work with v1.01 or v2.00 of GTA San Andreas? ====<br />
:No. It can be made to work with them however - please see [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ this forum topic] for instructions on patching the exe.<br />
<br />
==== Initial black screen/hanging GTA splash screens ====<br />
:* '''MTA shows a permanent black screen or hanging GTA splash screens.'''<br />
<br />
:It may be necessary that during/after the logo splash screens in Grand Theft Auto you have to give some input in order to skip the videos correctly. Try to click your left-mouse button a few times, or tapping a few keys.<br />
<br />
:* '''MTA shows a permanent black screen after the GTA splash screens (possibly with text in the bottom right corner).'''<br />
<br />
:This can be related to a lack of support for DirectX or video card features, on your system, which are needed to run the dynamically rendered menu. This dynamic menu is enabled by default. You can disable it by opening your [[coreconfig.xml]] configuration file located in the ''GTA San Andreas\MTA'' directory, and changing the value of ''menu_options'' to ''248''.<br />
<br />
==== Halt after MTA splash screen ====<br />
:* '''Nothing happens after the 'Stop playing with yourself' splash screen'''<br />
<br />
:If you use nVidia GeForce, try turning off nView Desktop Manager before starting MTA.<br />
<br />
:Also try deleting GTA San Andreas settings file ("gta_sa.set") in "Documents\GTA San Andreas User Files" folder.<br />
<br />
:If it all fails and you run Kaspersky Anti-Virus or Internet Security, make sure status of "multi theft auto.exe" in not restricted. Other anti-virus software may block MTA from running.<br />
<br />
==== Crash after MTA splash screen ====<br />
:* '''MTA crashes after the 'Stop playing with yourself' logo. Both single player and the MTA: Race ran fine before.'''<br />
<br />
:Try downloading the latest DirectX Runtime files from [https://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&DisplayLang=en Microsoft]. Also check in Task Manager, if :gta_sa.exe process isn't already running.<br />
<br />
:If you run at any substandard resolutions (e.g. 960x720), try to change your resolution to a commonly supported one (e.g. 640×480, 800×600, 1024×768, 1152×864, 1280×1024) by launching Grand Theft Auto: San Andreas in normal mode, setting the new resolution and exiting.<br />
<br />
:If you are a user of Windows Vista or Windows 7, try the following:<br />
:* Enable Windows XP SP3 compatiblity mode for both Multi Theft Auto.exe and gta_sa.exe, setting their privilege level to "Run this program as an administrator".<br />
:* Configure Data Execution Prevention: Use the setting ''Turn DEP for all programs and services except those I select''. Click ''add'' and find "Multi Theft Auto.exe" and "gta_sa.exe" and add them.<br />
:* Run MTASA as administrator.<br />
<br />
==== Crash after connecting to any server ====<br />
:* '''MTASA crashes upon connecting to any server. Single player runs fine.'''<br />
<br />
:Single player mods can affect the way MTA:SA works, potentially causing crashes - you should always use a clean GTASA install for MTA:SA.<br />
<br />
:This might also occur on non-modded installs, when your GTASA executable is in an unsupported by MTA:SA version (eg. 1.0 German or Australian). To resolve this, use [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ our converter].<br />
<br />
==== Controls not working ====<br />
:* '''My controls don't seem to work as they should.'''<br />
<br />
:Try using the 'copygtacontrols' command in the console.<br />
<br />
==== Incorrect models ====<br />
:* '''Woman model's breasts look awkward ingame / I'm seeing odd, spider-like shaped player models.'''<br />
<br />
:This is caused by the way GTA handles player stats. To fix this, be sure to set both fat and muscles player stats to 0, when you're changing player skin.<br />
<br />
==== Incorrect drive-by functionality ====<br />
:* '''Drivebys arent working as they should'''<br />
<br />
:Drivebys are handled by script, and will change depending on the loaded gamemode.<br />
<br />
==== Unsaved settings ====<br />
:* '''My MTA setting(s) didn't get saved (...) I crashed.'''<br />
<br />
:First, configure the MTA the way you want to, then exit the game and launch it again. Settings should get saved. Alternatively, try removing the coreconfig.xml file, then configure it and quit the game.<br />
<br />
==== Gamepad support ====<br />
:* '''MTA doesn't recognise my gamepad'''<br />
<br />
:Ensure that your controller is the first controller recognised by Windows (MTA will only use the first controller). You can configure your gamepad in options in MTASA's main menu.<br />
<br />
==== Free mouselook not working properly ====<br />
:* '''MTA doesnt recognise my mouse'''<br />
<br />
:Some people got problems with their mouse in MTA. They can use it in the menu, connect to a server, but they can't use the mouse for free look.<br />
:This problem can be solved by entering a server, click your Win/Windows key at your keyboard once, and then click your mouse.<br />
:If that doesn't work try starting GTA in Singleplayer, go to options > controler setup and set "Configuration" to "Mouse + Keys" instead of "Joypad".<br />
<br />
==== Server browser not working ====<br />
:* '''The in-game server browser shows "Loading" but does not come up with any servers'''<br />
<br />
:Depending on the type and status of the internet connection you are using, it can take up to a few seconds for the server browser to retrieve all the servers. Please wait a little longer for the results to appear.<br />
<br />
==== Invalid serial number ====<br />
:* '''I am getting an 'Invalid serial number' error when trying to launch or play the game'''<br />
<br />
:You are running an outdated version of Multi Theft Auto. Head over to the [https://mtasa.com/ main page] and download the latest version of Multi Theft Auto.<br />
<br />
==== 'Network module not compatible!' on MTA:SA launch ====<br />
:* '''I am getting 'Network module not compatible!' error message upon launching MTA:SA<br />
<br />
:This could mean that your MTA:SA install is incomplete or broken. Reinstall it.<br />
<br />
==== 'No such mod installed (deathmatch)' ====<br />
:* '''I am getting a 'No such mod installed (deathmatch)' error message when trying to connect to any server<br />
<br />
:'''Option 1:''' Simply re-install MTA. <br><br />
:'''Option 2:''' Run both gta_sa.exe and Multi Theft Auto.exe with administrator privileges.<br />
<br />
==== D3dx9_**.dll is not found ====<br />
:* '''When I start Multi Theft Auto: San Andreas I am getting an error D3dx9_**.dll (** = a number) cannot be found.<br />
<br />
:This means that DirectX 9 is not installed or not up to date.<br />
:To install/update DirectX download the [https://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3 DirectX End-User Runtime Web Installer] from the Microsoft download site.<br />
<br />
==== CRC mismatch ====<br />
:* '''When joining a server, the chatbox shows 'CRC mismatch'<br />
:This is a server problem. Tell the owner to look at the server section of this page.<br />
<br />
==== 'Error loading netc.dll module! (Error 14001)' on MTA:SA launch ====<br />
:* Full error message:<br />
:''Error loading netc.dll module! (Error 14001: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.)''<br />
<br />
:Make sure you have installed Microsoft Visual C++ 2008 regular and SP1 redistributable packages (x86):<br />
<br />
:[https://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en Microsoft Visual C++ 2008 Redistributable package (x86)]<br />
<br />
:[https://www.microsoft.com/download/en/details.aspx?id=5582 Microsoft Visual C++ 2008 SP1 Redistributable package (x86)]<br />
<br />
==== 'Error 1935. An error occurred during the installation of assembly 'Microsoft.VC90.ATL...' ====<br />
: Download the 'Fix it' helper from here: [https://support.microsoft.com/default.aspx?scid=kb;en-us;946414]<br />
<br />
==== Your virus scanner warns you about MTA:SA ====<br />
:* '''Your virus scanner informs you that the MTA:SA or setup executable is a virus or malware.'''<br />
:MTA does '''NOT''' contain any viruses, malware, adware or spyware. You should re-download MTASA [https://mtasa.com here] if you doubt the validity of your copy of MTA.<br />
<br />
==== When downloading large maps, progress halts ====<br />
:* '''When downloading large maps, progress often halts, while transmission is still taking place.'''<br />
:This issue is fixed in [https://forum.mtasa.com/topic/33297-multi-theft-auto-san-andreas-13-released/ MTA:SA 1.3].<br />
<br />
=== Windows Vista® / Windows 7-specific ===<br />
<br />
==== Crash on connect ====<br />
:* '''I seem to crash whenever I connect to a server just before I go in-game on Vista'''<br />
<br />
:This seems to be an issue with the Microsoft DirectX April 2006 SDK Redistributable DLL file (d3dx9_30.dll) when running in compatibility mode. Please make sure that compatibility mode is competely turned off for '''both''' your GTA_SA.exe and Multi Theft Auto.exe executables.<br />
<br />
==== Clock manipulation error ====<br />
:* '''I am getting 'Clock manipulation detected!' error message upon launching MTA:SA<br />
<br />
:This is caused by incorrect system date/time being set (which could be a result of wrong settings or a faulty battery on the pc's motherboard). Setting time and date again should fix the problem.<br />
<br />
:It might also happen if you are using an AMD Athlon 64 X2 processor with some old drivers. Update them at [https://support.amd.com/en-us/download AMD's site].<br />
<br />
==== Halt on launch ====<br />
:* '''When I launch MTA:SA, nothing happens (GTA_SA.exe is running but not loading up)<br />
<br />
:Run MTA:SA with Administrator privileges. To do this, right click on the installer executable, choose 'Properties', go into 'Compatibility' tab and tick the check box on the last field and try again.<br />
<br />
==== General GTA problems ====<br />
:* '''I have unexplainable GTA problems or crashes'''<br />
<br />
:Make sure your computer as well as your GTA install meet the [[Deathmatch_Client_Manual#System_requirements|minimum requirements]] and that you are not running in any 98/2000/XP/2003 compatibility modes.<br />
<br />
:Also try the solutions from these pages:<br />
:* http://gtaforums.com/topic/307992-san-andreas-v1-works-on-windows-vista/<br />
:* [https://web.archive.org/web/20160330172922/http://pullmonkey.com/2007/4/30/how-i-got-gta-san-andreas-to-work-with-a-crappy-os-vista http://pullmonkey.com/2007/4/30/how-i-got-gta-san-andreas-to-work-with-a-crappy-os-vista]<br />
<br />
==== Performance Issues Sandy Bridge / Second Generation Intel Core ====<br />
:* '''Slow MTA performance on Sandy Bridge Processors while other games and San Andreas Singleplayer run fine.'''<br />
:There seems to be a issue in combination with the Windows power profile running in power saving mode, you can solve this issue by changing the power profile to high performance when playing MTA:SA.<br />
:* Topic about this issue: [https://forum.mtasa.com/topic/26441-solved-sandy-bridge-performance-issues/ Sandy Bridge performance issues?]<br />
<br />
== Server ==<br />
<br />
=== General ===<br />
==== Fatal error 3 ====<br />
:* '''I'm getting ''Fatal Error 3'' whenever I connect to my server'''<br />
<br />
:This error happens when the server you are trying to connect to is unable to provide you the required downloads, because it does not have http downloading enabled. Be sure to set the '''httpdownload''' configuration tag in your configuration to '''1'''.<br />
==== Download error 9: Error downloading requested files ====<br />
:* '''I'm getting ''Download Error 9: Error downloading requested files'' whenever I connect to my server'''<br />
<br />
:This error happens when the server you are trying to connect to is unable to provide you with a valid link. This results in a 404 (Not found) HTTP error and an error at your end.<br />
<br />
:* If you are running the built-in server ('''httpserver''' is set to '''1''' and '''httpdownloadurl''' is empty), make sure that your HTTP server is accessible (you can try to access it by using a browser) for everyone.<br />
<br />
:* If you have configured an external web server ('''httpdownloadurl''' is set to your custom URL), make sure that your HTTP is accessible and make sure you have read the [[Deathmatch_Server_Manual#Configuring_an_external_web_server | Configuring an external web server]] guide.<br />
<br />
==== CRC mismatch ====<br />
:* '''When clients join my server, their chatbox shows 'CRC mismatch'<br />
:CRC mismatch occurs when either:<br />
:* The server files have been changed, but the resource has not been restarted/refreshed<br />
:* An external http server is being used and the files are not synchronized<br />
<br />
==== Accounts missing ====<br />
:The file ''accounts.xml'' is not used from 1.0.4, it has been replaced by a file called ''internal.db''. To ensure your old accounts information is migrated:<br />
:*Stop the server<br />
:*Make sure your old ''accounts.xml'' is correct<br />
:*Delete ''internal.db''<br />
:*Start the server<br />
<br />
==== Resources missing ====<br />
:From 1.0.4, resource names cannot contain dots.<br />
<br />
==== Download error 28 ====<br />
:Try closing anti-virus or firewall applications. If it then works, try adding an exception to your firewall to allow your http port through.<br />
<br />
==== Accounts disappearing ====<br />
:Account information (or anything else) not being saved correctly can be caused by database corruption. From build 2836, the server checks the integrity of the sqlite database files on startup. If it reports a database error, please read [[How to repair the database files]].<br />
:If you are running an earlier version and are having troubles such as accounts disappearing, you should upgrade your server to the [https://nightly.multitheftauto.com/ lastest build]<br />
<br />
=== Windows-related ===<br />
:No known reported issues in {{Current Version|full}}.<br />
<br />
=== Linux-related ===<br />
====Default nohup creates infinitely big nohup.out====<br />
<br />
:Temporary fix, disable the nohup file: 'nohup ./mta_server > /dev/null &'<br />
<br />
[[es:Problemas Conocidos - FAQ]]<br />
[[it:Bugs noti e FAQ]]<br />
[[ru:Known Issues - FAQ]]<br />
[[de:Known Issues - FAQ]]<br />
[[pt-br:Soluções de Problemas - FAQ]]<br />
[[hu:Known Issues - FAQ]]<br />
[[zh-cn:已知问题 - 常见问题]]<br />
<br />
[[Category:Support]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Upgrading_from_MTA:Race&diff=54135Upgrading from MTA:Race2018-03-17T16:15:29Z<p>CodyJ: Undo revision 54130 by Ciastuuś (talk)</p>
<hr />
<div>{{Historical}}<br />
__NOTOC__<br />
MTASA:Race was the first Multi Theft Auto release for Grand Theft Auto San Andreas. Since its release, we've seen thousands of maps and a vast, active community develop and mature. Despite this, for everything there is a time to move on. Multi Theft Auto: San Andreas {{padleft:|3|{{Current Version|full}}}}, in conjunction with the latest version of the [[Resource:Race]] gamemode provides a stable platform for server admins and gamers alike to upgrade to the most powerful GTA Race experience yet.<br />
<br />
== Why upgrade? ==<br />
Although it may seem that its safer to stick what works, the release of {{padleft:|3|{{Current Version|full}}}} will provide a significant step-up in the multiplayer experience.<br />
<br />
=== Scripting ===<br />
With the arrival of MTA:SA {{padleft:|3|{{Current Version|full}}}}, comes a powerful and flexible Lua scripting interface. This surpasses previous scripting abilities of Race servers in every single way. By utilising the Lua script interface, server admins and players alike can take advantage of features such as:<br />
* '''Fully fledged built-in scripting.''' No more external mIRC clients to run your Admin interface<br />
* '''Take full advantage of the Plugins system of Race.''' By developing Lua plugins, the bounds to extend Race are limitless. Examples that are included in the release package are the Traffic Sensor, which uses HUD to display when cars are behind you, and a Top Times plugin, which displays the person with the best record in a certain race.<br />
* '''Extend the possibilities of any map.''' By attaching a Lua script to your map, you can have virtually anything happen during gameplay. Custom models, moving objects, timed explosives and upside down gravity tracks are all possibilities by taking advantage of scripting.<br />
* '''Full customisability.''' Customisable UI, along with a possibility to add custom pictures, objects, sounds, and vehicle models, specific to your server. Imagine being able to display your server's logo during gameplay on the screen.<br />
<br />
=== Gameplay ===<br />
The MTA:SA {{padleft:|3|{{Current Version|full}}}} platform is much more versatile and therefore makes the gameplay experience superior to MTA:Race. On top of this, the Race gamemode has had hundreds of improvements to make the racing experience much more fun.<br />
* Have up to '''4096 players''' in your Race server. That's a lot more than ''32''. You may wonder "How on earth do 4096 people fit on the track?". No problem, the latest Race offers a '''ghostmode''' feature so that high player counts are feasable.<br />
* Support for newest Microsoft Windows operating systems like Windows Vista, Windows 2008, Windows 7, Windows 8/8.1 and Windows 10 in both x86 and x64 flavours. Due to the open-source nature of MTA:SA {{padleft:|3|{{Current Version|full}}}}, compatiblity is mantained constantly.<br />
* Much more accurate vehicle synchronisation. When switching to {{padleft:|3|{{Current Version|full}}}}, the first thing racers will notice is the amazing vehicle synchronisation. It now is incredibly smooth, and synced much more precisely - an essential to any racing game.<br />
* The Traffic Sensor addon means nearby opponents are displayed on the screen. At last, you can be aware of which way those tailgating opponents are challenging you!<br />
* The all new open-sourced [[Resource:Editor|Map Editor]] means you can create your race maps with ease.<br />
* MTA:SA {{padleft:|3|{{Current Version|full}}}} provides a single mod for '''all''' your online GTA needs.<br />
<br />
=== Server owner's paradise ===<br />
With the latest Race, server owner's are in control: you are able to customise the Race experience. Become a truly unique server.<br />
* '''Improved ingame Admin.''' MTA:SA {{padleft:|3|{{Current Version|full}}}} offers an ingame Admin interface where you can easily point and click to effortlessly moderate a server.<br />
* '''Improved stability, performance and bandwidth usage'''. The {{padleft:|3|{{Current Version|full}}}} and Race platform have been tested extremely thoroughly, and this has meant the bar has been raised much higher than the original MTA:Race. Bandwidth has been paid special attention to, and upgrading server owners will reap the benefits of optimized bandwidth usage for their servers.<br />
* '''Framelimiter'''. We've all seen it - that frustrating FPS limit in MTA:Race. The arrival of {{padleft:|3|{{Current Version|full}}}} means server owners can set the FPS limit of their particular server.<br />
* '''Customisability'''. As mentioned several times - everything is in your control. Using Lua you can modify and improve the open-source Race experience. The new Plugins system means you can easily add or remove components that extend MTA:Race<br />
<br />
=== Community ===<br />
If you ever have any issues, we'll be happy to assist you in our forums. The growing amount of scripters for MTA:SA {{padleft:|3|{{Current Version|full}}}} has also meant we have a much more alive and vibrant community than previously with MTA:Race.<br />
<br />
== How do I upgrade ==<br />
=== Race players ===<br />
Upgrading your client to MTA:SA {{padleft:|3|{{Current Version|full}}}} is simple. And better yet, you have nothing to lose. MTA:SA {{padleft:|3|{{Current Version|full}}}} can be installed alongside your original MTA:Race installation without conflict.<br />
<br />
All you have to do is head to the [http://www.mtasa.com/ download page] and install MTA:SA {{padleft:|3|{{Current Version|full}}}}.<br />
<br />
=== Server Owners ===<br />
Server owners can easily upgrade to MTA:SA {{padleft:|3|{{Current Version|full}}}}. Races are fully compatible after a short upgrade process. Simply install the latest server package, and use our [http://files.mtasa.com/apps/1.0/raceconv.zip batch converter] to convert your maps into MTA:SA {{padleft:|3|{{Current Version|full}}}} resource format. From then on, your converted maps work with the [[Resource:race|race gamemode]] and can be managed through the [[Resource:mapmanager|map manager]] and the [[Resource:votemanager|vote manager]].<br />
<br />
[[pt-br:Migrando do MTA:Race ao MTA:SA 1.3]]<br />
[[ru:Upgrading from MTA:Race]]<br />
<br />
[[Category:Support]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Server_Manual&diff=54134Server Manual2018-03-17T16:15:13Z<p>CodyJ: Undo revision 54131 by Ciastuuś (talk)</p>
<hr />
<div>__TOC__<br />
<br />
==Getting started==<br />
It is much easier than it looks to get a server up and running for your internet or LAN buddies; follow this wiki article and you will hopefully be on your way to hosting your own MTA:SA server in no time!<br />
<br />
==Installing the server==<br />
The dedicated server application is available in different flavours depending on the platform of the server.<br />
<br />
===Linux installation===<br />
There are different ways of getting a Linux server up and running:<br />
* [https://linux.mtasa.com Getting a precompiled package]<br />
* [[Installing and Running MTASA Server on GNU Linux]]<br />
* [[Building MTASA Server on GNU Linux]]<br />
<br />
<br />
Should you have any problems with errors when starting the server some common problems and solutions are listed here:<br />
* [[Building MTASA Server on GNU Linux#Troubleshooting]]<br />
<br />
===FreeBSD installation===<br />
<br />
You can run MTA:SA under FreeBSD using Linux emulation.<br />
* Enable [https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/linuxemu-lbc-install.html Linux binary compatibility]<br />
* Install following packages or compile them from ports: hs-terminfo, linux_base-f10, linux-f10-sqlite3<br />
* Install [https://linux.mtasa.com/ Linux precompiled package]<br />
<br />
===Windows installation===<br />
Installation of the MTA:SA server on Windows is easy as pie.<br />
*Go to the [https://mtasa.com/ download page] and download the installer.<br />
*Once the installer is downloaded, open it.<br />
*Select a folder where you want to install the server.<br />
*Click Install.<br />
*Done!<br />
<br />
''For a full explanation of acl.xml (access control list) read: [[Access_Control_List|Access Control List]]''<br/><br/><br />
<br />
==Configuring your server==<br />
The Multi Theft Auto dedicated server is initially configurable through it's console window, from within the game, and from a webbrowser. In order to make use of the two last options, it is necessary to add at least one administrator user to your configuration file.<br />
<br />
===General configuration===<br />
All general configuration options can be found in the 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]' file and can be opened by any regular text editor.<br />
<br />
This file is fairly straightforward; every variable has a [[Server_mtaserver.conf|description of what to do with it and how to change it]].<br />
<br />
===Port forwarding===<br />
If you run your server on your own private computer, and you have an router between the internet and your computer. You need to forward 3 ports.<br />
<br />
First of all open the file 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]' and search for the next lines:<br />
<syntaxhighlight lang="xml"><br />
<serverport>22003</serverport> <br />
<httpport>22005</httpport><br />
</syntaxhighlight><br />
<br />
The ports are needed to setup the server correctly. We explain later how to set them, but first if you want your server to appear in the server browser there is another port we need, and that is the ASE port. <br />
(quick example for how to turn ASE on or off):<br />
<syntaxhighlight lang="xml"><br />
<ase>1</ase> <!-- 0 = off, 1 = on --><br />
</syntaxhighlight><br />
<br />
Now we going to forward the ports in your router, which is not needed if you already have all ports open, or if you don't have a router with a firewall. If so, skip this part.<br />
<br />
If you don't know how port forwarding works in your router, go to the [https://portforward.com/ Port Forward website], find your router model there, and follow the instructions there.<br />
<br />
In almost every router you can set the port type: UDP or TCP. The following list will explain which port type is needed for what:<br />
<br />
<br />
Main server port: UDP<br />
<br />
HTTP Port: TCP<br />
<br />
ASE Port: UDP (this is needed if you want your server to appear in the server list)<br />
<br />
<br />
The ASE port is also simple to get:<br />
<br />
ASE port = Main server port + 123<br />
<br />
So, if you have the main server port set to 22003, then the ASE port will be 22126.<br />
<br />
Good luck!<br />
<br />
''In the latest version of the server, you can check the port status by using the server command [[Server_Commands#openports|openports]].''<br />
<br />
===Client Checks===<br />
<br />
The MTA server can be configured to disable the anti-cheat. It can also allow specific or all files to be modified (e.g. carmods.dat), and make sure clients are of a minimum version.<br />
<br />
All of these settings are within the file 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]'. See the [[Anti-cheat_guide|Anti-cheat guide]] for more details.<br/><br />
<br />
If you want to force a minimum client version, search for the following line:<br />
<syntaxhighlight lang="xml"><br />
<minclientversion></minclientversion><br />
</syntaxhighlight><br />
Accepted values look like: 1.1.1-9.02320<br />
<br />
===Adding administrators===<br />
It is strongly recommended to add at least one administrator to your server in order to make use of the built-in webserver to easily maintain and configure your server. This administrator will then also be able to log-in from within the game and control the server.<br />
<br />
To add an administrator to your server, follow these steps:<br><br />
<ol><br />
<li>While the server is running, add a new account by typing '''[[Server_Commands#addaccount|addaccount name password]]''' into the server window. For example, to add user BennyLava you could type:<br />
<div style="margin: 10px 10px 10px 10px;"><br />
<syntaxhighlight lang="xml"><br />
addaccount BennyLava 123password<br />
</syntaxhighlight><br />
</div><br />
<div style="margin: 10px 10px 10px 20px;"><br />
''Note: If you do not have access to the server window, and the 'admin' resource is running, you can add the example account by issuing the client console (F8) command '''register BennyLava 123password'''''<br />
</div><br />
<li>The server should display a message confirming the account has been added.<br />
<li>Next, shutdown the server by typing '''shutdown''' into the server window.<br />
<li>Make sure your server is stopped; if your server is still running, the following changes you make will be overwritten</li><br />
<li>Open the file 'mods/deathmatch/acl.xml' with any text editor</li><br />
<li>Add the account to the ''Admin'' group by using the XML-syntax below<br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml"><br />
<acl><br />
...<br />
<group name="Admin"><br />
<acl name="Admin"/><br />
...<br />
<object name="user.BennyLava" /><br />
</group><br />
...<br />
</acl><br />
</syntaxhighlight><br />
</div><br />
<br />
You're done! You can add as many administrators or users as you want this way, take a look at some of the other groups and ACLs for example. The ACL is also accessible through the [[Access_Control_List|Lua scripting engine]].<br><br />
<br />
It is recommended to take a look at the web interface, we will explain how to do this below.<br />
</li><br />
</ol><br />
'''Note''': There are also ways to add accounts and edit rights for the server while it's running. "[[Server_Commands#addaccount|addaccount <user> <password>]]" is an internal command to add accounts, but you will have to use the web interface to add these accounts to specific groups/ACLs!<br /><br />
<br />
===Using the web interface===<br />
The dedicated server comes with a few Lua [[resources]] that provide a nice little web interface to your server. This can be used to easily maintain your server, as it allows you to add users, start/stop resources, and more.<br />
<br />
The web interface resources are enabled by default and are served through the built-in HTTP web server. To make sure the built-in HTTP web server runs on a port you like (22005 by default), follow these steps:<br />
<ol><br />
<li>Make sure your server is stopped<br />
<li>Open the file 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]' with any text editor</li><br />
<li>Verify that the HTTP server is enabled:<br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml"><br />
<httpserver>1</httpserver><br />
</syntaxhighlight><br />
</div><br />
</li><br />
<li>Change the HTTP server port to your liking:<br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml"><br />
<httpport>22005</httpport><br />
</syntaxhighlight><br />
</div><br />
</li><br />
<li>Save and close the configuration file</li><br />
<li>Start your server</li><br />
<li>If you happened to have changed the start-up resources in your configuration file, make sure the following resources are started:<br />
<br />
# resourcebrowser<br />
# resourcemanager<br />
# webadmin<br />
# webmap<br />
<br />
These are automatically started in the default configuration file, in case you just installed your server.<br />
</li><br />
<li>Open a web browser (Internet Explorer 6 or 7 are NOT supported; use [https://www.mozilla.com/firefox Mozilla Firefox], [https://www.google.com/chrome Google Chrome], [https://www.apple.com/safari/download Apple Safari], [https://www.opera.com Opera] or others) and navigate to the HTTP server URL: '''http://server:port/'''. For example, If you are running a local server on HTTP port 22005, use '''http://127.0.0.1:22005/'''.</li><br />
<li>Enter the username and password of the administrator you added in the previous section.</li><br />
</ol><br />
<br />
<br /><br />
You should now be able to maintain your server from the web interface.<br />
<br />
=== Configuring an external web server ===<br />
<br />
The built-in web server is also used to serve files that are required by resources running on your server to any player that is connected to your server. For example, if you are running a game script with a scripted graphical user interface, or custom models, these need to be transferred to every connected player in order to function properly. This is done by either the built-in web server, or an external web server (that is usually a bit faster) but needs to be set up separately.<br />
<br />
For performance or consistency reasons during the game, you could choose to make use of such an external web server if you have one set up. The external web server needs to be accessible for the public, so any client will be able to download the necessary client-side files in order to join and play on your server.<br />
<br />
To enable downloading off an external web server, you should configure the [[Server_mtaserver.conf#httpdownloadurl|httpdownloadurl]] tag in your server configuration:<br />
<br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml"> <br />
<httpdownloadurl>http://www.myserver.tld/directory/here</httpdownloadurl><br />
</syntaxhighlight></div><br />
<br />
When you launch the server, the directory '''<SERVER>/mods/deathmatch/resource-cache/http-client-files''' will contain the correct client files for hosting on an external web server. If the web server is on the same machine, you can simply link the appropriate web server directory to '''http-client-files'''. If the web server is on a separate machine, ensure it has access to '''http-client-files''' via a network path, or maintain a remote copy using synchronization software.<br />
<br />
'''Note 1''': Please try to avoid any special characters (e.g. ~, !) in your download URLs.<br /><br />
'''Note 2''': Please do not use a trailing slash in your download URL (e.g. ''<nowiki>http://www.myserver.tld/directory</nowiki>'' rather than ''<nowiki>http://www.myserver.tld/directory/</nowiki>'')<br /><br />
'''Note 3''': The web server must use 'ContentType: application/octet-stream' for Lua files. Most web servers will do this by default, or you can add the following line to the .htaccess file:<br /><br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml">AddType application/octet-stream .lua<br />
</syntaxhighlight></div><br />
<br />
Instructions on how to install and configure Nginx as an external web server for MTA is here: [[Installing and Configuring Nginx as an External Web Server]]<br />
<br />
==Starting your server==<br />
Begin by making sure that you have finished all configuration of your server, starting your server is the last stage so everything must be ready!<br />
<br />
To start your server double click on MTA Server.exe, make sure you allow it through any firewalls and forward ports where necessary.<br />
<br />
==Installing/Updating resources on your server==<br />
Resources can come in two formats, either a ZIP format or just a normal folder with the script files inside it. The MTA:SA server supports both these methods.<br />
<br />
# Move or copy the new resource to your <SERVER>\mods\deathmatch\resources folder.<br />
# In the server window type in the command [[Server_Commands#refresh|refresh]], this will re-scan the resources folder and update the live resources where necessary.<br />
<br />
==Uninstalling resources==<br />
Resources can easily be removed from your server if you no longer want them.<br />
<br />
# Delete the ZIP file or the folder of the resource you wish to uninstall<br />
# In the server window type in the command "refresh" (without the quotes), this will re-scan the resources folder and update the live resources where necessary.<br />
<br />
==Administrating your server==<br />
You can start resources by typing the command "start resourcename" in the server console, or stop ones with "stop resourcename".<br />
<br />
It's also possible to execute these and other admin commands from the in-game console (which you can bring up with the ` key or F8); for this to work, you first need to log in with the command "[[Server_Commands#login|login username password]]". Additionally, you can press the p key to bring up the admin panel: this is a graphical interface which allows you to easily kick or ban misbehaving players, among others.<br />
<br />
For further commands, type [[Server_Commands#help|help]] in a console.<br />
<br />
==Starting a map/gamemode==<br />
See the commands section of the documentation for [[Resource:Map manager|mapmanager]] for more information.<br />
<br />
==Useful Notes==<br />
<br />
# You may also update the resources while in-game as long as you have the correct access levels by typing "refresh" in the clients console or "/refresh" in the chat window. This may cause a second of lag if you have many resources.<br />
# In the above instructions, <SERVER> is the path to your server's main directory. In most cases this is C:\Program Files\MTA San Andreas\server<br />
# You can choose a different config file for the server to use by passing it in the command line after a --config argument, e.g. mtaserver.exe --config anotherconfig.cfg.<br />
# Do not be alarmed by the warning regarding the parsing of the settings.xml file. This happens because your server installation is still clean and unused.<br />
<br />
====Need further help?====<br />
Why not pop over to our [https://forum.mtasa.com/ Forums] or join us on [irc://irc.multitheftauto.com/mta IRC] (irc.multitheftauto.com #mta - [https://www.mirc.com mIRC])<br />
<br />
[[es:Manual del Servidor]]<br />
[[de:Server Anleitung]]<br />
[[it:Manuale del Server]]<br />
[[nl:Server Manual]]<br />
[[ru:Server Manual]]<br />
[[pl:Server Manual]]<br />
[[pt-br:Manual do Servidor]]<br />
[[hu:Server Manual]]<br />
<br />
[[Category:Support]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=Resource:Mapmanager&diff=54133Resource:Mapmanager2018-03-17T16:13:45Z<p>CodyJ: Undo revision 54132 by Ciastuuś (talk)</p>
<hr />
<div>{{Resource page}}<br />
The map manager is a resource included in the MTA DM server suite. It offers commands, functions and events for the gamemodes to dynamically manage their maps. For example, when a race server needs to load different tracks for each race, instead of having all of them in the same resource as the main script, they can be stored in separate resources and then loaded simply with the "changeGamemodeMap" function when a new race starts. <br />
<br />
Specifically, the map manager lists gamemodes/maps and manages gamemode/map loading. It applies certain map settings affecting the game world and sets ASE game type and map name rule values as well. It includes a web listing which auto updates and highlights the current mode/map combination.<br />
<br />
==A simple tutorial==<br />
In this section we are going to continue the basic gamemode we created in the [[Scripting Introduction|Introduction to Scripting]]. We will add a simple map resource that only contains the spawnpoint data for the players, and load the data in the main script when the player needs to spawn.<br />
<br />
First of all, we make a folder under /Your MTA Server/mods/deathmatch/resources/, and name it "mymap". Then under /mymap/ directory, create a text file and name it "meta.xml", which is required for every resource.<br />
<br />
Enter the following codes in the ''meta.xml'' file:<br />
<syntaxhighlight lang="xml"><br />
<meta><br />
<info type="map" gamemodes="myserver"/><br />
<map src="mymap.map"/><br />
</meta><br />
</syntaxhighlight><br />
Note that this resource is "linked" to the main resource with the ''gamemodes=""'' tag, which contains the name of the main resource. In the ''map'' tag, it indicates the name of the .map file which contains the actual map data.<br />
<br />
Now let's create another text file under /mymap/ and name it "mymap.map", and enter the following codes:<br />
<syntaxhighlight lang="xml"><br />
<map><br />
<spawnpoint id="spawnpoint1" posX="1959.5487060547" posY="-1714.4613037109" posZ="18" rot="63.350006103516" model="0"/><br />
</map><br />
</syntaxhighlight><br />
Note that "spawnpoint" is the type of the element, used in [[getElementsByType]] function; likewise, "id" is used in [[getElementByID]] function. <br />
<br />
To load the map data, the main script needs access to the map resource itself. Now let's edit the script.lua file in "myserver" resource. Enter the following code:<br />
<br />
<syntaxhighlight lang="lua"><br />
function loadMap(startedMap)<br />
mapRoot = getResourceRootElement(startedMap)<br />
end<br />
<br />
addEventHandler("onGamemodeMapStart", getRootElement(), loadMap)<br />
</syntaxhighlight><br />
Basically, the "onGamemodeMapStart" event gives us the handle of the map ("startedMap"), which we used to extract the handle of the resource containing the map ("mapRoot").<br />
<br />
With the resource handle, we can extract the spawnpoint information from it. Look at the joinHandler() function in script.lua, instead of specifying x, y and z, we can use the map data as the following:<br />
<syntaxhighlight lang="lua"><br />
function joinHandler()<br />
local spawn = getElementsByType("spawnpoint", mapRoot)<br />
local x,y,z,r<br />
for key, value in pairs(spawn) do<br />
x = getElementData(value, "posX")<br />
y = getElementData(value, "posY")<br />
z = getElementData(value, "posZ")<br />
r = getElementData(value, "rot")<br />
end<br />
spawnPlayer(source, x, y, z)<br />
fadeCamera(source, true)<br />
end<br />
</syntaxhighlight><br />
Now you may start the gamemode in the server console with the following command:<br />
<br />
'''gamemode myserver mymap'''<br />
<br />
==Usage==<br />
To use the map manager, your resources must first be marked as either gamemodes or maps.<br />
<br />
You have to tag the '''gamemode resource''' with the correct type in its info tag:<br />
<syntaxhighlight lang="xml"><info description="A gamemode" type="gamemode" /></syntaxhighlight><br />
<br />
'''Map resources''' also need the ''type="map"'' tag, plus a ''gamemodes'' tag listing the gamemode resources they're compatible with in a comma-separated list ''without spaces''.<br />
<syntaxhighlight lang="xml"><info description="A gamemode map" type="map" gamemodes="ctv,koth" /></syntaxhighlight><br />
<br />
There can be only one gamemode and one gamemode map loaded at once.<br />
<br />
==Optional resource attributes==<br />
These attributes all go in the corresponding resource's info tag.<br />
<br />
'''name:''' A friendly name for your gamemode or map, to be displayed in the start messages or map listings instead of the filename.<br />
<br />
==Commands==<br />
'''changemap newmap [newgamemode]''' (changes the gamemode map to a new one, optionally changing the gamemode as well)<br />
<br />
'''changemode newgamemode [newmap]''' (changes to a new gamemode, optionally starting a map with it)<br />
<br />
'''gamemode newgamemode [newmap]''' (same as previous one)<br />
<br />
'''stopmode''' (stops the current mode and mode map)<br />
<br />
'''stopmap''' (stops the current mode map)<br />
<br />
'''maps [gamemode]''' (lists all maps in the server, optionally all maps compatible with a gamemode)<br />
<br />
'''gamemodes''' (lists all gamemodes)<br />
<br />
==Settings==<br />
'''*mapmanager.color''' [hex color string] (changes the mapmanager's output messages' color) (default: #E1AA5A)<br />
<br />
'''*mapmanager.messages''' [boolean] (whether map/gm changes are enabled) (default: true)<br />
<br />
'''*mapmanager.ASE''' [boolean] (whether the manager will set ASE gametype / mapname) (default: true)<br />
<br />
==Exported functions==<br />
<syntaxhighlight lang="lua">bool changeGamemode ( resource newGamemode, [ resource mapToLoadWith ] )</syntaxhighlight><br />
Changes the gamemode to a new one, optionally specifying an initial map for it (will load without a map by default).<br />
<syntaxhighlight lang="lua">bool changeGamemodeMap ( resource newMap, [ resource gamemodeToChangeTo ] )</syntaxhighlight><br />
Changes the GM map to a new one, optionally specifying a gamemode to change to before loading it (will load with the current gamemode by default).<br />
<syntaxhighlight lang="lua">table getGamemodes ( )</syntaxhighlight><br />
Returns a table of all gamemode resource pointers.<br />
<syntaxhighlight lang="lua">table getGamemodesCompatibleWithMap ( resource theMap )</syntaxhighlight><br />
Returns a table of compatible gamemode resource pointers.<br />
<syntaxhighlight lang="lua">table getMaps ( )</syntaxhighlight><br />
Returns a table of all map resource pointers.<br />
<syntaxhighlight lang="lua">table getMapsCompatibleWithGamemode ( [ resource theGamemode ] )</syntaxhighlight><br />
Returns a table of compatible map resource pointers. If the gamemode is left blank, it returns all maps which aren't compatible with any gamemode.<br />
<syntaxhighlight lang="lua">resource getRunningGamemode ( )</syntaxhighlight><br />
Returns the currently running gamemode's resource pointer.<br />
<syntaxhighlight lang="lua">resource getRunningGamemodeMap ( )</syntaxhighlight><br />
Returns the currently running GM map's resource pointer.<br />
<syntaxhighlight lang="lua">bool isGamemode ( resource theGamemode )</syntaxhighlight><br />
Determines if a resource is a gamemode or not.<br />
<syntaxhighlight lang="lua">bool isGamemodeCompatibleWithMap ( resource theGamemode, resource theMap )</syntaxhighlight><br />
Determines if a gamemode is compatible with a map or not.<br />
<syntaxhighlight lang="lua">bool isMap ( resource theMap )</syntaxhighlight><br />
Determines if a resource is a map or not.<br />
<syntaxhighlight lang="lua">bool isMapCompatibleWithGamemode ( resource theMap, resource theGamemode )</syntaxhighlight><br />
Determines if a map is compatible with a gamemode or not.<br />
<syntaxhighlight lang="lua">bool stopGamemode ( )</syntaxhighlight><br />
Stops the current gamemode and its map.<br />
<syntaxhighlight lang="lua">bool stopGamemodeMap ( )</syntaxhighlight><br />
Stop the current GM map.<br />
Determines if a map is compatible with a gamemode or not.<br />
<br />
==Fired events==<br />
''(For all these events, "source" is the resource's root element.)''<br />
<syntaxhighlight lang="lua">onGamemodeStart ( resource startedGamemode )</syntaxhighlight><br />
Fired before a gamemode starts.<br />
<syntaxhighlight lang="lua">onGamemodeStop ( resource stoppedGamemode )</syntaxhighlight><br />
Fired before a gamemode is stopped.<br />
<syntaxhighlight lang="lua">onGamemodeMapStart ( resource startedMap )</syntaxhighlight><br />
Fired before a GM map starts.<br />
<syntaxhighlight lang="lua">onGamemodeMapStop ( resource stoppedMap )</syntaxhighlight><br />
Fired before a GM map is stopped.<br />
<br />
==Supported map settings==<br />
The following settings from the [[settings system|registry]] are applied by the map manager when a map is started:<br />
<br>'''gamespeed''' [number]: The map's game speed.<br />
<br>'''gravity''' [number]: The map's gravity.<br />
<br>'''time''' [string of the form '''hh:mm''']: The map's time.<br />
<br>'''weather''' [number]: The map's weather ID.<br />
<br>'''waveheight''' [number]: The map's wave height.<br />
<br>'''locked_time''' [boolean]: Whether the set time will be frozen by the manager or not.<br />
<br>'''minplayers''' [number]: The required minimum number of players to start the map.<br />
<br>'''maxplayers''' [number]: The allowed maximum number of players to start the map.<br />
<br />
[[it:Map manager]]<br />
[[ru:Resource:Mapmanager]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=GetSearchLightEndRadius&diff=51361GetSearchLightEndRadius2017-06-25T18:19:25Z<p>CodyJ: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{Needs_Example}}<br />
<br />
This function gets the end radius of a [[Element/Searchlight|searchlight]] element.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
searchlight getSearchLightEndRadius ( searchlight theSearchLight )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:getEndRadius|endRadius|setSearchLightEndRadius}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to get the radius of the searchlight's light cone in its end.<br />
<br />
===Returns===<br />
If the specified searchlight element is valid, this function will return one ''float'', which is the searchlight's end radius. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- TODO<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=GetSearchLightStartRadius&diff=51360GetSearchLightStartRadius2017-06-25T18:19:12Z<p>CodyJ: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{Needs_Example}}<br />
<br />
This function gets the start radius of a [[Element/Searchlight|searchlight]] element.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
searchlight getSearchLightStartRadius ( searchlight theSearchLight )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:getStartRadius|startRadius|setSearchLightStartRadius}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to get the radius of the searchlight's light cone in its beginning. <br />
<br />
===Returns===<br />
If the specified searchlight element is valid, this function will return one ''float'', which is the searchlight's start radius. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- TODO<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=GetSearchLightEndPosition&diff=51359GetSearchLightEndPosition2017-06-25T18:18:59Z<p>CodyJ: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{Needs_Example}}<br />
<br />
This function gets the end position of a [[Element/Searchlight|searchlight]] element.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
float float float getSearchLightEndPosition ( searchlight theSearchLight )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:getEndPosition|endPosition|setSearchLightEndPosition}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to get the position where the searchlight's light cone ends.<br />
<br />
===Returns===<br />
If the specified searchlight element is valid, this function will return three ''float'', which are the three coordinates of searchlight's end position. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- TODO<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=GetSearchLightStartPosition&diff=51358GetSearchLightStartPosition2017-06-25T18:18:44Z<p>CodyJ: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{Needs_Example}}<br />
<br />
This function gets the start position of a [[Element/Searchlight|searchlight]] element.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
searchlight getSearchLightStartPosition ( searchlight theSearchLight )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:getStartPosition|startPosition|setSearchLightStartPosition}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to get the position where the searchlight's light cone starts.<br />
<br />
===Returns===<br />
If the specified searchlight element is valid, this function will return three ''float'', which are the three coordinates of searchlight's start position. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- TODO<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=SetSearchLightEndRadius&diff=51357SetSearchLightEndRadius2017-06-25T18:18:27Z<p>CodyJ: Undo revision 51354 by CodyJ (talk)</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{Needs_Example}}<br />
<br />
This function sets the end radius of a [[Element/Searchlight|searchlight]] element.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
searchlight setSearchLightEndRadius ( searchlight theSearchlight, float endRadius )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:setEndRadius|endRadius|getSearchLightEndRadius}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to modify the property of.<br />
*'''endRadius''': the radius of the searchlight's light cone in its end.<br />
<br />
===Returns===<br />
If every argument is correct, this function returns ''true''. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- TODO<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=SetSearchLightStartRadius&diff=51356SetSearchLightStartRadius2017-06-25T18:17:57Z<p>CodyJ: Undo revision 51353 by CodyJ (talk)</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{Needs_Example}}<br />
<br />
This function sets the start radius of a [[Element/Searchlight|searchlight]] element.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
searchlight setSearchLightStartRadius ( searchlight theSearchlight, float startRadius )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:setStartRadius|startRadius|getSearchLightStartRadius}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to modify the property of.<br />
*'''startRadius''': the radius of the searchlight's light cone in its beginning.<br />
<br />
===Returns===<br />
If every argument is correct, this function returns ''true''. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- TODO<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=SetSearchLightStartPosition&diff=51355SetSearchLightStartPosition2017-06-25T18:17:21Z<p>CodyJ: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
<br />
This function sets the start position of a [[Element/Searchlight|searchlight]] element.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
searchlight setSearchLightStartPosition ( searchlight theSearchLight, float startX, float startY, float startZ )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:setStartPosition|startPosition|getSearchLightStartPosition}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to modify the property of.<br />
*'''startX''': the X coordinate where the searchlight light cone will start.<br />
*'''startY''': the Y coordinate where the searchlight light cone will start.<br />
*'''startZ''': the Z coordinate where the searchlight light cone will start.<br />
<br />
===Returns===<br />
If every argument is correct, this function returns ''true''. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
This example creates a searchlight that originates in the camera position and targets the center of the map.<br />
<syntaxhighlight lang="lua"><br />
local searchLight = createSearchLight(0, 0, 0, 0, 0, 0, 0, 10)<br />
<br />
if searchLight then<br />
local function updateSearchLight()<br />
-- Set its start position to the camera position<br />
setSearchLightStartPosition(searchLight, getCameraMatrix())<br />
end<br />
addEventHandler("onClientPreRender", root, updateSearchLight)<br />
end<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=SetSearchLightEndRadius&diff=51354SetSearchLightEndRadius2017-06-25T18:16:42Z<p>CodyJ: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{Needs_Example}}<br />
<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
searchlight setSearchLightEndRadius ( searchlight theSearchlight, float endRadius )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:setEndRadius|endRadius|getSearchLightEndRadius}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to modify the property of.<br />
*'''endRadius''': the radius of the searchlight's light cone in its end.<br />
<br />
===Returns===<br />
If every argument is correct, this function returns ''true''. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- TODO<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=SetSearchLightStartRadius&diff=51353SetSearchLightStartRadius2017-06-25T18:16:27Z<p>CodyJ: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{Needs_Example}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
searchlight setSearchLightStartRadius ( searchlight theSearchlight, float startRadius )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:setStartRadius|startRadius|getSearchLightStartRadius}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to modify the property of.<br />
*'''startRadius''': the radius of the searchlight's light cone in its beginning.<br />
<br />
===Returns===<br />
If every argument is correct, this function returns ''true''. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- TODO<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=SetSearchLightEndPosition&diff=51352SetSearchLightEndPosition2017-06-25T18:15:01Z<p>CodyJ: Functional in 1.5</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
searchlight setSearchLightEndPosition ( searchlight theSearchLight, float endX, float endY, float endZ )<br />
</syntaxhighlight><br />
{{OOP||[[Element/Searchlight|searchLight]]:setEndPosition|endPosition|getSearchLightEndPosition}}<br />
<br />
===Required Arguments===<br />
*'''theSearchLight''': the searchlight to modify the property of.<br />
*'''endX''': the X coordinate where the searchlight light cone will end.<br />
*'''endY''': the Y coordinate where the searchlight light cone will end.<br />
*'''endZ''': the Z coordinate where the searchlight light cone will end.<br />
<br />
===Returns===<br />
If every argument is correct, this function returns ''true''. If not, it will return ''false'' plus an error message.<br />
<br />
==Example==<br />
This example creates a searchlight that originates in the camera position and targets to the front of it.<br />
<syntaxhighlight lang="lua"><br />
local searchLight = createSearchLight(0, 0, 0, 0, 0, 0, 0, 10)<br />
<br />
if searchLight then<br />
local function updateSearchLight()<br />
-- Get camera position and look at point<br />
local sx, sy, sz, ex, ey, ez = getCameraMatrix()<br />
-- Set searchlight's start position to the camera position, and end position to the look at point<br />
setSearchLightStartPosition(searchLight, sx, sy, sz)<br />
setSearchLightEndPosition(searchLight, ex, ey, ez)<br />
end<br />
addEventHandler("onClientPreRender", root, updateSearchLight)<br />
end<br />
</syntaxhighlight><br />
<br />
==See also==<br />
{{Client_searchlight_functions}}</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=AddAccount&diff=51351AddAccount2017-06-25T18:12:52Z<p>CodyJ: Fixed the last example that would prevent any other player from logging in, instead it now stores the players in a table. Iffy example, but better then the previous.</p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function adds an [[account]] to the list of registered accounts of the current server.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua">account addAccount ( string name, string pass[, bool allowCaseVariations = false] )<br />
</syntaxhighlight><br />
{{OOP|This function is a static function underneath the Account class.|[[Account]].add ||}}<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Optional Arguments===<br />
*'''allowCaseVariations:''' Whether the username is case sensitive (if this is set to true, usernames "Bob" and "bob" will refer to different accounts)<br />
<br />
===Returns===<br />
Returns an [[account]] or ''false'' if the account already exists or an error occured.<br />
<br />
===Limits===<br />
*'''name:'''<br />
** Minimal account name length is 1 character.<br />
** Account names are case-sensitive.<br />
** Account name can not be equal to "*****"<br />
*'''pass:'''<br />
** Minimal account password length is 1 character.<br />
** Maximum account password length is 30 characters.<br />
** Account password can not be equal to "*****"<br />
<br />
==Example== <br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
bRegisteredOnce = {}<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and not bRegisteredOnce[source]) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce[source] = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce[source] == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}<br />
<br />
[[ar:addAcount]]<br />
[[es:addAcount]]<br />
[[ru:addAccount]]<br />
[[pl:addAccount]]</div>CodyJhttps://wiki.multitheftauto.com/index.php?title=GetLowLODElement&diff=49956GetLowLODElement2016-12-22T02:43:39Z<p>CodyJ: </p>
<hr />
<div><br />
__NOTOC__<br />
{{Server client function}}<br />
This function return the low LOD element that an element is associated with.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
element getLowLODElement ( element theElement )<br />
</syntaxhighlight><br />
{{OOP||[[element]]:getLowLOD|lowLOD|setLowLODElement}} <br />
<br />
===Required Arguments=== <br />
*'''theElement:''' The [[element]] whose low LOD version we want to get.<br />
<br />
===Returns===<br />
Returns a low LOD element if successful, ''false'' otherwise.<br />
<br />
==Example==<br />
<section name="Clientside example" class="client" show="true"><br />
This example is not done yet:<br />
<syntaxhighlight lang="lua"><br />
local obj = createObject(1488,0,0,3,0,0,90) -- Create object<br />
local lod_obj = createObject(1337,0,0,3,0,0,90,true) -- Create OD object<br />
<br />
setLowLODElement(obj,lod_obj) -- Setting LOD, 'attach' to obj<br />
<br />
local lod_get = getLowLODElement(obj) -- Get LOD from obj<br />
<br />
--lod_get = lod_obj <br />
<br />
</syntaxhighlight><br />
</section><br />
<br />
==Requirements==<br />
{{Requirements|1.2|1.2}}<br />
==See Also==<br />
{{Element_functions}}</div>CodyJ