<?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=MtaUser154</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=MtaUser154"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/MtaUser154"/>
	<updated>2026-04-10T22:27:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CountPlayersInRange&amp;diff=26076</id>
		<title>CountPlayersInRange</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CountPlayersInRange&amp;diff=26076"/>
		<updated>2011-06-15T14:25:56Z</updated>

		<summary type="html">&lt;p&gt;MtaUser154: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
This function allows you to set '''moving''' element speed in kph or mph units.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementSpeed (element theElement, [ int/string unit=&amp;quot;kph&amp;quot;, int speed=0 ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theElement''': Element you want to set speed of&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''unit''': Units in which speed should be set. This can be 1 or &amp;quot;mph&amp;quot; for mph, any other value for kph.&lt;br /&gt;
* '''speed''': Speed in selected unit&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
{{RequiredFunctions|getElementSpeed}}&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&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;
function setElementSpeed(element, unit, speed) -- only work if element is moving!&lt;br /&gt;
	if (unit == nil) then unit = 0 end&lt;br /&gt;
	if (speed == nil) then speed = 0 end&lt;br /&gt;
	speed = tonumber(speed)&lt;br /&gt;
	local acSpeed = getElementSpeed(element, unit)&lt;br /&gt;
	if (acSpeed~=false) then -- if true - element is valid, no need to check again&lt;br /&gt;
		local diff = speed/acSpeed&lt;br /&gt;
		local x,y,z = getElementVelocity(element)&lt;br /&gt;
		setElementVelocity(element,x*diff,y*diff,z*diff)&lt;br /&gt;
		return true&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server-side example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds command that set player vehicle speed to provided one (in predefined unit kph). Note: It doesn't care if player is driver or passenger.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;setmyspeed&amp;quot;,&lt;br /&gt;
function (player, cmd, arg1)&lt;br /&gt;
  local veh = getPedOccupiedVehicle(player)&lt;br /&gt;
  if (veh) then&lt;br /&gt;
    setElementSpeed(veh, &amp;quot;kph&amp;quot;, tonumber(arg1))&lt;br /&gt;
  else&lt;br /&gt;
    outputChatBox(&amp;quot;You have to sit in vehicle&amp;quot;, player)&lt;br /&gt;
  end&lt;br /&gt;
end&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;
By '''varez'''.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>MtaUser154</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleEngineState&amp;diff=25889</id>
		<title>GetVehicleEngineState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleEngineState&amp;diff=25889"/>
		<updated>2011-05-23T11:15:27Z</updated>

		<summary type="html">&lt;p&gt;MtaUser154: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns a vehicle's engine state (on or off).&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 getVehicleEngineState ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle''': The [[vehicle]] you wish to get the engine state of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns '''true''' if the vehicle's engine is started, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will switch the vehicle engine state with the command &amp;quot;/switchengine&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function switchEngine ( playerSource )&lt;br /&gt;
    local theVehicle = getPedOccupiedVehicle ( playerSource )&lt;br /&gt;
&lt;br /&gt;
    -- Check if the player is in any vehicle and if he is the driver&lt;br /&gt;
    if theVehicle and getVehicleController ( theVehicle ) == playerSource then&lt;br /&gt;
        local state = getVehicleEngineState ( theVehicle )&lt;br /&gt;
        setVehicleEngineState ( theVehicle, not state )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;switchengine&amp;quot;, switchEngine )&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;
{{Vehicle functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Changes_in_1.0]]&lt;/div&gt;</summary>
		<author><name>MtaUser154</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:GetVehicleHandling&amp;diff=25888</id>
		<title>Talk:GetVehicleHandling</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:GetVehicleHandling&amp;diff=25888"/>
		<updated>2011-05-23T06:16:20Z</updated>

		<summary type="html">&lt;p&gt;MtaUser154: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Qais: Is this page correct?&lt;br /&gt;
&lt;br /&gt;
MtaUser154: I get a nil-pointer error when I try to use this function with MTA:SA Server v1.1-unstable 2468&lt;/div&gt;</summary>
		<author><name>MtaUser154</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:Weather&amp;diff=25781</id>
		<title>Talk:Weather</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:Weather&amp;diff=25781"/>
		<updated>2011-05-09T16:49:02Z</updated>

		<summary type="html">&lt;p&gt;MtaUser154: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The page lists ID's up to 45, however the setWeather() function returns false if you try to set an ID over 19, should those above 19 be removed?&lt;br /&gt;
It is possible to use all the IDs listed on the page by manually editing the memory of your game.&lt;br /&gt;
:Are the IDs over 19 useful? Remove them for now, but if they're useful we can consider re-adding them. [[User:EAi|eAi]] 17:34, 17 April 2008 (CDT)&lt;br /&gt;
::They could be usefull after a future build is released if the Weather scripting functions are changed to allow ID's over 19.--[[User:Stevvo|Stevvo]] 23:08, 17 April 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
I discoverd, that using weather ID=100 with setWeather() causes all 3d-object to disapper. It seems like you have zero-sight with this weather. Should this be documentated here? [[User:MtaUser154|MtaUser154]] 18:49, 9 May 2011 (CEST)&lt;/div&gt;</summary>
		<author><name>MtaUser154</name></author>
	</entry>
</feed>