<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Makaveli</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Makaveli"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Makaveli"/>
	<updated>2026-04-28T08:56:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetCameraFieldOfView&amp;diff=82577</id>
		<title>SetCameraFieldOfView</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetCameraFieldOfView&amp;diff=82577"/>
		<updated>2025-10-26T01:04:46Z</updated>

		<summary type="html">&lt;p&gt;Makaveli: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{client function}}&lt;br /&gt;
{{New feature/item|3.0151|1.5.1|7397|This function sets the field of view of the ''dynamic camera'' - this is the field of view of the ''non-fixed camera'' - yes, the camera that the user can control whilst on foot or in a vehicle. The higher the field of view angle, the more you will be able to see to your sides.}}&lt;br /&gt;
{{Note|This function omits (but doesn't override) the user game option in '''''Settings -&amp;gt; Video -&amp;gt; FOV'''''}}&lt;br /&gt;
{{Note|It doesn't affect the FOV for the following camera modes: 1) Player aiming 2) Vehicle front bumper camera 3) Fixed camera}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setCameraFieldOfView ( string cameraMode, float fieldOfView [, bool instant = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||Camera.setFieldOfView||getCameraFieldOfView}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
'''Note:''' after 100, some unexpected things may happen to the camera, particularly in vehicles, use carefully!&lt;br /&gt;
*'''cameraMode:''' the camera mode to set the field of view of:&lt;br /&gt;
** &amp;quot;player&amp;quot;: whilst walking/running&lt;br /&gt;
** &amp;quot;vehicle&amp;quot;: whilst in vehicle&lt;br /&gt;
** &amp;quot;vehicle_max&amp;quot;: the max the field of view can go to when the vehicle is moving at a high speed (must be higher than &amp;quot;vehicle&amp;quot; | the normal difference between &amp;quot;vehicle&amp;quot; and &amp;quot;vehicle_max&amp;quot; is 10)&lt;br /&gt;
*'''fieldOfView:''' The field of view angle, 0 to 179.&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|23300|&lt;br /&gt;
*'''instant''': If set to ''true'', the value is applied immediately, without delay (does not work with &amp;quot;vehicle_max&amp;quot;).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the arguments are valid, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
In this example, the field of view for 'player walking/running' camera is set to 20, once resource fully starts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function changeCameraFovOnClientResourceStart()&lt;br /&gt;
    setCameraFieldOfView(&amp;quot;player&amp;quot;, 20)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, changeCameraFovOnClientResourceStart)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client camera functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:setCameraFieldOfView]]&lt;br /&gt;
[[RO:setCameraFieldOfView]]&lt;/div&gt;</summary>
		<author><name>Makaveli</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerTriggerEventThreshold&amp;diff=82415</id>
		<title>OnPlayerTriggerEventThreshold</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerTriggerEventThreshold&amp;diff=82415"/>
		<updated>2025-08-24T13:52:10Z</updated>

		<summary type="html">&lt;p&gt;Makaveli: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22313|This event is triggered when a player exceeds the maximum threshold for events via [[triggerServerEvent]].}}&lt;br /&gt;
&lt;br /&gt;
During each interval (''player_triggered_event_interval''), all usage of [[triggerServerEvent]] will be counted for each player. This includes registered events, non-registered events and non-remote events.&lt;br /&gt;
&lt;br /&gt;
If the count exceeds ''max_player_triggered_events_per_interval'', this event will be fired. The count is reset each interval.&lt;br /&gt;
&lt;br /&gt;
You can set these options via [[setServerConfigSetting]].&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|23281|'''eventName:''' the name of last called event.}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] who exceeded the threshold.&lt;br /&gt;
&lt;br /&gt;
===Canceling===&lt;br /&gt;
Canceling this event has no effect.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function processPlayerTriggerEventThreshold(eventName)&lt;br /&gt;
    kickPlayer(source, &amp;quot;Event spam | Event name: &amp;quot; .. eventName)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerTriggerEventThreshold&amp;quot;, root, processPlayerTriggerEventThreshold)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Makaveli</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=82227</id>
		<title>GetElementsByType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=82227"/>
		<updated>2025-07-12T19:30:58Z</updated>

		<summary type="html">&lt;p&gt;Makaveli: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server_client_function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all elements of the specified type. This can be useful, as it disregards ''where'' in the element tree it is. It can be used with either the built in types (listed below) or with any custom type used in a .map file. For example, if there is an element of type &amp;quot;flag&amp;quot; (e.g. &amp;lt;flag /&amp;gt;) in the .map file, the using &amp;quot;flag&amp;quot; as the type argument would find it.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getElementsByType ( string theType, [ element startat=getRootElement() ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getElementsByType ( string theType, [ element startat=getRootElement(), bool streamedIn=false ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{OOP|This function is a static function underneath the Element class.|[[Element]].getAllByType||}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theType:''' The type of element you want a list of. This is the same as the tag name in the .map file, so this can be used with a custom element type if desired. Built in types can be found here: [[Element]]&lt;br /&gt;
**'''&amp;quot;player&amp;quot;:''' A player connected to the server&lt;br /&gt;
**'''&amp;quot;ped&amp;quot;:''' A ped&lt;br /&gt;
**'''&amp;quot;water&amp;quot;:''' A water polygon&lt;br /&gt;
**'''&amp;quot;sound&amp;quot;:''' A playing sound&lt;br /&gt;
**'''&amp;quot;vehicle&amp;quot;:''' A vehicle&lt;br /&gt;
**'''&amp;quot;object&amp;quot;:''' An object&lt;br /&gt;
**'''&amp;quot;pickup&amp;quot;:''' A pickup&lt;br /&gt;
**'''&amp;quot;marker&amp;quot;:''' A marker&lt;br /&gt;
**'''&amp;quot;colshape&amp;quot;:''' A collision shape&lt;br /&gt;
**'''&amp;quot;blip&amp;quot;:''' A blip&lt;br /&gt;
**'''&amp;quot;radararea&amp;quot;:''' A radar area&lt;br /&gt;
**'''&amp;quot;team&amp;quot;:''' A team&lt;br /&gt;
**'''&amp;quot;spawnpoint&amp;quot;:''' A spawnpoint&lt;br /&gt;
**'''&amp;quot;console&amp;quot;:''' The server Console&lt;br /&gt;
**'''&amp;quot;projectile&amp;quot;:''' A clientside projectile&lt;br /&gt;
**'''&amp;quot;effect&amp;quot;:''' A clientside effect&lt;br /&gt;
**'''&amp;quot;light&amp;quot;:''' A clientside light&lt;br /&gt;
**'''&amp;quot;searchlight&amp;quot;:''' A clientside searchlight&lt;br /&gt;
**'''&amp;quot;shader&amp;quot;:''' A shader&lt;br /&gt;
**'''&amp;quot;texture&amp;quot;:''' A texture&lt;br /&gt;
**'''&amp;quot;gui-window&amp;quot;:''' A GUI window (there's others like this for other GUI types)&lt;br /&gt;
**'''&amp;quot;building&amp;quot;:''' A building (client side only)&lt;br /&gt;
**'''&amp;quot;resource&amp;quot;:''' All the loaded resources&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''startat:''' The [[element]] the search should start at. Children of this element are searched, siblings or parents will not be found. By default, this is the root element which should suit most uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
*'''streamedIn:''' If true, function will only return elements that are streamed in.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the elements of the specified type. Returns an empty ''table'' if there are no elements of the specified type. Returns ''false'' if the string specified is invalid (or not a string).&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example retrieves a table of the players in the server, and checks whether or not each one is in a vehicle:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local players = getElementsByType ( &amp;quot;player&amp;quot; ) -- get a table of all the players in the server&lt;br /&gt;
for theKey,thePlayer in ipairs(players) do -- use a generic for loop to step through each player&lt;br /&gt;
   if ( isPlayerInVehicle ( thePlayer ) ) then -- if the player is in a vehicle, announce it&lt;br /&gt;
      outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; is in a vehicle&amp;quot; )&lt;br /&gt;
   else -- if the player isn't in a vehicle, announce that he/she is on foot&lt;br /&gt;
      outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; is on foot&amp;quot; )&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example retrieves a table of the teams in the server, and display them in chat:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local teams = getElementsByType(&amp;quot;team&amp;quot;)&lt;br /&gt;
for i,team in ipairs(teams) do&lt;br /&gt;
   local teamName = getTeamName(team) -- get the team name&lt;br /&gt;
   outputChatBox(teamName) -- display the team name in chat&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This shows how you could create a new element to describe a gas station:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createGasStations(below)&lt;br /&gt;
    local gasstations = getElementsByType ( &amp;quot;gasstation&amp;quot;, below ) -- get a table of all the gas station elements in the element tree&lt;br /&gt;
    for theKey,theGasStation in ipairs(gasstations) do &lt;br /&gt;
        local x = getElementData(theGasStation, &amp;quot;posX&amp;quot;) -- get the position of the element&lt;br /&gt;
        local y = getElementData(theGasStation, &amp;quot;posY&amp;quot;)&lt;br /&gt;
        local z = getElementData(theGasStation, &amp;quot;posZ&amp;quot;)&lt;br /&gt;
        setElementParent(createColSphere(x, y, z, 10), theGasStation) -- create a colshape for the gas station at the gas station's position&lt;br /&gt;
        addEventHandler(&amp;quot;onColShapeHit&amp;quot;, theGasStation, giveGas) -- when the player hits&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function mapLoad()&lt;br /&gt;
    createGasStations(source) -- create gas stations for the map that's just loaded&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, mapLoad)&lt;br /&gt;
&lt;br /&gt;
function giveGas(hittingElement)&lt;br /&gt;
    local theGasStation = source&lt;br /&gt;
    if getElementType(hittingElement) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        local gas_left = getElementData(theGasStation, &amp;quot;amount&amp;quot;)&lt;br /&gt;
        local gas_speed = getElementData(theGasStation, &amp;quot;speed&amp;quot;)&lt;br /&gt;
        if gas_left &amp;gt; 0 then&lt;br /&gt;
&lt;br /&gt;
            local gas_to_remove = gas_speed &lt;br /&gt;
            if gas_left &amp;lt; gas_speed then&lt;br /&gt;
                gas_to_remove = gas_left&lt;br /&gt;
&lt;br /&gt;
            local current_vehicle_gas = getElementData(hittingElement, &amp;quot;gas&amp;quot;)&lt;br /&gt;
            current_vehicle_gas = current_vehicle_gas + gas_to_remove&lt;br /&gt;
            gas_left = gas_left - gas_to_remove&lt;br /&gt;
&lt;br /&gt;
            setElementData(hittingElement, &amp;quot;gas&amp;quot;, current_vehicle_gas)&lt;br /&gt;
            setElementData(theGasStation, &amp;quot;amount&amp;quot;, gas_left)&lt;br /&gt;
        else&lt;br /&gt;
            outputChatBox(&amp;quot;Pump is out of gas!&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 4:''' This example loops trough all connected players and redirects them to another server host:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local serverIP = &amp;quot;99.88.77.66&amp;quot; -- Change to your server IP to redirect everyone&lt;br /&gt;
local serverPort = 22005 -- The destination server's port&lt;br /&gt;
&lt;br /&gt;
function redirectAllPlayers()&lt;br /&gt;
	for _,p in ipairs (getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
		if p then&lt;br /&gt;
			redirectPlayer (p, serverIP, serverPort)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler (&amp;quot;onResourceStart&amp;quot;, resourceRoot, redirectAllPlayers)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Makaveli</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementOnFire&amp;diff=81683</id>
		<title>SetElementOnFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementOnFire&amp;diff=81683"/>
		<updated>2025-01-09T18:21:42Z</updated>

		<summary type="html">&lt;p&gt;Makaveli: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Shared function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22864|&lt;br /&gt;
This function can be used to set a [[element]] on fire or extinguish a fire on it. Supported types are [[ped]], [[vehicle]] and [[object]].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Function on the client side only works on elements created on the client side.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementOnFire ( element theElement, bool isOnFire )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setOnFire|onFire|isElementOnFire}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] that we want to set/unset.&lt;br /&gt;
*'''isOnFire:''' ''true'' to set the [[element]] on fire, ''false'' to extinguish any fire on it.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' This example defines a command handler for the command ''fireelement''. This will fire up a player or their vehicle if the state is true. Otherwise the fire will be gone.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local stringToBoolean = {&lt;br /&gt;
    [&amp;quot;true&amp;quot;] = true,&lt;br /&gt;
    [&amp;quot;false&amp;quot;] = false&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;fireelement&amp;quot;,&lt;br /&gt;
    function(sourcePlayer, commandName, fireState)&lt;br /&gt;
        -- if the player didn't complete the command.&lt;br /&gt;
        if not (fireState) then&lt;br /&gt;
            local text = string.format(&amp;quot;[Usage]: #FFFFFF/%s [%s]&amp;quot;, commandName, &amp;quot;State&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            return outputChatBox(text, sourcePlayer, 255, 100, 100, true)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        -- the state will automatically be a string so we change it to boolean.&lt;br /&gt;
        local fireState = stringToBoolean[fireState]&lt;br /&gt;
&lt;br /&gt;
        -- if the state isn't boolean then we return it.&lt;br /&gt;
        if type(fireState) ~= &amp;quot;boolean&amp;quot; then&lt;br /&gt;
            return outputChatBox(&amp;quot;[Error]: #FFFFFFThe state has to be true or false.&amp;quot;, sourcePlayer, 255, 100, 100, true)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        local playerVehicle = getPedOccupiedVehicle(sourcePlayer)&lt;br /&gt;
&lt;br /&gt;
        if playerVehicle then -- if the player is in a vehicle&lt;br /&gt;
            setElementOnFire(playerVehicle, fireState)&lt;br /&gt;
        else -- if the player is not in a vehicle&lt;br /&gt;
            setElementOnFire(sourcePlayer, fireState)&lt;br /&gt;
        end&lt;br /&gt;
    end, false, false&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Makaveli</name></author>
	</entry>
</feed>