<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.rage.mp/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Almeidowski</id>
	<title>RAGE Multiplayer Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.rage.mp/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Almeidowski"/>
	<link rel="alternate" type="text/html" href="https://wiki.rage.mp/wiki/Special:Contributions/Almeidowski"/>
	<updated>2026-06-23T23:33:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Blip::Blip&amp;diff=20020</id>
		<title>Blip::Blip</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Blip::Blip&amp;diff=20020"/>
		<updated>2020-09-13T13:48:32Z</updated>

		<summary type="html">&lt;p&gt;Almeidowski: Research results&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SharedFunctionJS}}&lt;br /&gt;
&lt;br /&gt;
Creates a blip to display on your map &amp;amp; minimap.&lt;br /&gt;
Blips created server-side seem to be impossible to attach to the map. If you create the same blip server-side and client-side, only the second will stay attached to the map (the scale won&#039;t change if you zoom in or out).&lt;br /&gt;
&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.blips.new(sprite, position,&lt;br /&gt;
{&lt;br /&gt;
    name: name,&lt;br /&gt;
    scale: scale,&lt;br /&gt;
    color: color,&lt;br /&gt;
    alpha: alpha,&lt;br /&gt;
    drawDistance: drawDistance,&lt;br /&gt;
    shortRange: shortRange,&lt;br /&gt;
    rotation: rotation,&lt;br /&gt;
    dimension: dimension,&lt;br /&gt;
    radius: radius,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
*&#039;&#039;&#039;{{Required}}sprite&#039;&#039;&#039;: {{RageType|Int}} ([[Blips#Blip_model|Blip sprites]])&lt;br /&gt;
*&#039;&#039;&#039;{{Required}}position&#039;&#039;&#039;: {{RageType|Vector3}}&lt;br /&gt;
*&#039;&#039;&#039;name&#039;&#039;&#039;: {{RageType|String}}&lt;br /&gt;
*&#039;&#039;&#039;scale&#039;&#039;&#039;: {{RageType|Float}}: How big the blip shows on the map&lt;br /&gt;
*&#039;&#039;&#039;color&#039;&#039;&#039;: {{RageType|Color ID}} ([[Blips#Blip_colors|Blip colors]])&lt;br /&gt;
*&#039;&#039;&#039;alpha&#039;&#039;&#039;: {{RageType|Int}} [0:255]&lt;br /&gt;
*&#039;&#039;&#039;drawDistance&#039;&#039;&#039;: {{RageType|Float}}&lt;br /&gt;
*&#039;&#039;&#039;shortRange&#039;&#039;&#039;: {{RageType|Boolean}}: If it&#039;s hidden in the minimap until the player is close&lt;br /&gt;
*&#039;&#039;&#039;rotation&#039;&#039;&#039;: {{RageType|Float}}&lt;br /&gt;
*&#039;&#039;&#039;dimension&#039;&#039;&#039;: {{RageType|Int}}&lt;br /&gt;
*&#039;&#039;&#039;radius&#039;&#039;&#039;: {{RageType|Float}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
This creates a blip at the police station. The blip is assigned to the variable &#039;&#039;&#039;policeBlip&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{SharedCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let policeBlip = mp.blips.new(60, new mp.Vector3(427.95, -981.05, 0),&lt;br /&gt;
    {&lt;br /&gt;
        name: &#039;Los Santos Police Station&#039;,&lt;br /&gt;
        color: 3,&lt;br /&gt;
        shortRange: true,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
{{Blip_definition}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Blip API]]&lt;br /&gt;
[[Category:Shared Function]]&lt;/div&gt;</summary>
		<author><name>Almeidowski</name></author>
	</entry>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Getting_Started_with_Entity_variables&amp;diff=20011</id>
		<title>Getting Started with Entity variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Getting_Started_with_Entity_variables&amp;diff=20011"/>
		<updated>2020-09-08T21:27:43Z</updated>

		<summary type="html">&lt;p&gt;Almeidowski: Grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
In this page you&#039;ll learn about how to use &#039;&#039;&#039;Entity&#039;&#039;&#039; variables. This is a list of functions that are related to the entity variables:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Functions&#039;&#039;&#039;:&lt;br /&gt;
**[[Entity::getVariable|getVariable]]&lt;br /&gt;
**[[Entity::setVariable|setVariable]]&lt;br /&gt;
**[[Events::addDataHandler|addDataHandler]]&lt;br /&gt;
&lt;br /&gt;
== What is entity variables? ==&lt;br /&gt;
&lt;br /&gt;
Entity variables are custom assigned data to a certain entity to identify it either locally or globally to all other clients on the server. You have the flexibility to choose weather to keep it private or public.&lt;br /&gt;
&lt;br /&gt;
== Synced entity variables ==&lt;br /&gt;
Synced entity variables are custom data that are assigned to the entity globally so other clients can read these data. Synced entity variables are only writable server-side, which means no one can overwrite data from client-side. &lt;br /&gt;
Let&#039;s say you need to keep your scoreboard updated every 3 seconds and it displays every player&#039;s cash, ping, job, and etc. To keep things up to date you&#039;ll definitely need to use synced entity variables to display updated values since for example a player made an transaction then his cash is updated server-side, then the scoreboard should automatically update it in the next refresh call by getting each player&#039;s synced variable. There are many applications for entity synced variables and you can explore [https://rage.mp/files/category/3-scripts/ resources] to get to know more about it.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
We&#039;ll do a short example about money HUD and how it works with entity synced variables.&lt;br /&gt;
&lt;br /&gt;
Firstly we&#039;ll setup our server-side simple money API&lt;br /&gt;
&lt;br /&gt;
In server-side we did a small manager that accepts withdrawal/deposit money and updates the synced entity variable of the player that requested the operation.&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.add({&lt;br /&gt;
    &#039;playerReady&#039;: (player) =&amp;gt; {&lt;br /&gt;
        if (player) {&lt;br /&gt;
            /*&lt;br /&gt;
             * Setting our start cash value by 0&lt;br /&gt;
             * You can sync it via Database if you got one.&lt;br /&gt;
             * player.data.cash = 0 can work too &lt;br /&gt;
             */&lt;br /&gt;
            player.setVariable(&#039;cash&#039;, 0);&lt;br /&gt;
            // player.data.cash = 0&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
    &#039;withdraw&#039;: (player, amount) =&amp;gt; {&lt;br /&gt;
        let currentMoney = player.getVariable(&#039;cash&#039;); // Getting base cash from entity.&lt;br /&gt;
        if (currentMoney &amp;amp;&amp;amp; currentMoney &amp;gt;= 0 &amp;amp;&amp;amp; amount &amp;gt; 0) {&lt;br /&gt;
            currentMoney += amount;&lt;br /&gt;
            player.setVariable(&#039;cash&#039;, currentMoney); // Setting base cash of entity to new value.&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
    &#039;deposit&#039;: (player, amount) =&amp;gt; {&lt;br /&gt;
        let currentMoney = player.getVariable(&#039;cash&#039;); // Getting base cash from entity.&lt;br /&gt;
        if (currentMoney &amp;amp;&amp;amp; currentMoney &amp;gt;= 0 &amp;amp;&amp;amp; currentMoney &amp;gt;= amount) {&lt;br /&gt;
            currentMoney -= amount;&lt;br /&gt;
            player.setVariable(&#039;cash&#039;, currentMoney); // Setting base cash of entity to new value.&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now on client-side we should do a small money HUD that&#039;ll display the cash and update once an operation has been made.&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: [[Events::addDataHandler|addDataHandler]] triggers on all clients when one entity updates its synced variable, so make sure to specify your scope if its per player operation.&lt;br /&gt;
{{ClientsideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
const localPlayer = mp.players.local;&lt;br /&gt;
let currentMoney;&lt;br /&gt;
&lt;br /&gt;
mp.events.add(&#039;render&#039;, () =&amp;gt; {&lt;br /&gt;
    if (currentMoney) { // Draws money HUD only if currentMoney is initalized&lt;br /&gt;
        mp.game.graphics.drawText(&#039;$&#039; + currentMoney, [0.85, 0.1], { &lt;br /&gt;
            font: 7, &lt;br /&gt;
            color: [133, 187, 101, 185], &lt;br /&gt;
            scale: [0.8, 0.8], &lt;br /&gt;
            outline: true&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
mp.events.addDataHandler(&#039;cash&#039;, (entity, newCash, oldCash) =&amp;gt; {&lt;br /&gt;
    if (entity &amp;amp;&amp;amp; entity.remoteId === localPlayer.remoteId &amp;amp;&amp;amp; newCash !== oldCash) { // Make sure the money update is for the money operation requester since addDataHandler triggers on any entity synced variable change&lt;br /&gt;
        currentMoney = newCash;&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Local Entity variables ==&lt;br /&gt;
You can also set variables to entities for local scope like on server-side or client-side only to help protect sensitive data from public if needed.&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.add(&#039;playerReady&#039;, (player) =&amp;gt; {&lt;br /&gt;
  player.whatever = &#039;something&#039;; // that initializes an object property to player that can be used serverside only&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ClientsideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  mp.gui.chat.push(&#039;Scope Test: &#039; mp.players.local.whatever); // Displays: &amp;quot;Scope Test: undefined&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Final notes ==&lt;br /&gt;
Entity variables are destroyed once the entity is no longer available in the world. Like player reconnecting or quit or vehicle delete.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
{{ScriptingTutorials}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Almeidowski</name></author>
	</entry>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Blip::Blip&amp;diff=20003</id>
		<title>Blip::Blip</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Blip::Blip&amp;diff=20003"/>
		<updated>2020-09-05T11:37:47Z</updated>

		<summary type="html">&lt;p&gt;Almeidowski: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SharedFunctionJS}}&lt;br /&gt;
&lt;br /&gt;
Creates a blip to display on your map &amp;amp; minimap.&lt;br /&gt;
&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.blips.new(sprite, position,&lt;br /&gt;
{&lt;br /&gt;
    name: name,&lt;br /&gt;
    scale: scale,&lt;br /&gt;
    color: color,&lt;br /&gt;
    alpha: alpha,&lt;br /&gt;
    drawDistance: drawDistance,&lt;br /&gt;
    shortRange: shortRange,&lt;br /&gt;
    rotation: rotation,&lt;br /&gt;
    dimension: dimension,&lt;br /&gt;
    radius: radius,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
*&#039;&#039;&#039;{{Required}}sprite&#039;&#039;&#039;: {{RageType|Int}} ([[Blips#Blip_model|Blip sprites]])&lt;br /&gt;
*&#039;&#039;&#039;{{Required}}position&#039;&#039;&#039;: {{RageType|Vector3}}&lt;br /&gt;
*&#039;&#039;&#039;name&#039;&#039;&#039;: {{RageType|String}}&lt;br /&gt;
*&#039;&#039;&#039;scale&#039;&#039;&#039;: {{RageType|Float}}: How big the blip shows on the map&lt;br /&gt;
*&#039;&#039;&#039;color&#039;&#039;&#039;: {{RageType|Color ID}} ([[Blips#Blip_colors|Blip colors]])&lt;br /&gt;
*&#039;&#039;&#039;alpha&#039;&#039;&#039;: {{RageType|Int}} [0:255]&lt;br /&gt;
*&#039;&#039;&#039;drawDistance&#039;&#039;&#039;: {{RageType|Float}}&lt;br /&gt;
*&#039;&#039;&#039;shortRange&#039;&#039;&#039;: {{RageType|Boolean}}: If it&#039;s hidden in the minimap until the player is close&lt;br /&gt;
*&#039;&#039;&#039;rotation&#039;&#039;&#039;: {{RageType|Float}}&lt;br /&gt;
*&#039;&#039;&#039;dimension&#039;&#039;&#039;: {{RageType|Int}}&lt;br /&gt;
*&#039;&#039;&#039;radius&#039;&#039;&#039;: {{RageType|Float}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
This creates a blip at the police station. The blip is assigned to the variable &#039;&#039;&#039;policeBlip&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{SharedCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let policeBlip = mp.blips.new(60, new mp.Vector3(427.95, -981.05, 0),&lt;br /&gt;
    {&lt;br /&gt;
        name: &#039;Los Santos Police Station&#039;,&lt;br /&gt;
        color: 3,&lt;br /&gt;
        shortRange: true,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
{{Blip_definition}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Blip API]]&lt;br /&gt;
[[Category:Shared Function]]&lt;/div&gt;</summary>
		<author><name>Almeidowski</name></author>
	</entry>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Pool::forEach&amp;diff=19985</id>
		<title>Pool::forEach</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Pool::forEach&amp;diff=19985"/>
		<updated>2020-09-02T11:35:09Z</updated>

		<summary type="html">&lt;p&gt;Almeidowski: Adding a third and easier to understand example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This function is used for calling a function for each element in a pool.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pool.forEach(Function callingFunction);&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*&#039;&#039;&#039;callingFunction:&#039;&#039;&#039; Function, what will be called.&lt;br /&gt;
&lt;br /&gt;
==Example #1== &lt;br /&gt;
This example will generate text with all player nicknames.&lt;br /&gt;
&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let getNicknamesText = () =&amp;gt; {&lt;br /&gt;
	let text = ``;&lt;br /&gt;
	mp.players.forEach(&lt;br /&gt;
		(player, id) =&amp;gt; {&lt;br /&gt;
			text = text == `` ? player.name : `${text} , ${player.name}`;&lt;br /&gt;
		}&lt;br /&gt;
	);&lt;br /&gt;
	return text;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
let blahBlah = getNicknamesText();&lt;br /&gt;
console.log(blahBlah != `` ? blahBlah : `Server not have players.`);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example #2== &lt;br /&gt;
This example will add a command to remove all server vehicles by forEach.&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.addCommand(`removeAll`, &lt;br /&gt;
	(player) =&amp;gt; {&lt;br /&gt;
		mp.vehicles.forEach(&lt;br /&gt;
			(vehicle) =&amp;gt; {&lt;br /&gt;
				vehicle.destroy();&lt;br /&gt;
			}&lt;br /&gt;
		);&lt;br /&gt;
		mp.players.broadcast(`${player.name} DESTROY ALL CARS!`);&lt;br /&gt;
	}&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
==Example #3==&lt;br /&gt;
This example will teleport a player that types the command /port to the player whose name he writes as 1st argument.&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.addCommand(&#039;port&#039;, (player, name) =&amp;gt; {&lt;br /&gt;
	mp.players.forEach(_player =&amp;gt; {&lt;br /&gt;
		if(_player.name === name)&lt;br /&gt;
			player.position = _player.position;&lt;br /&gt;
	});&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{EntityPool_function}}&lt;/div&gt;</summary>
		<author><name>Almeidowski</name></author>
	</entry>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Getting_Started_with_Events&amp;diff=19984</id>
		<title>Getting Started with Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Getting_Started_with_Events&amp;diff=19984"/>
		<updated>2020-08-31T16:45:07Z</updated>

		<summary type="html">&lt;p&gt;Almeidowski: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Events are the core scripting system for RAGE:MP. They are registered upon your request and triggered in a certain situation, For example, [[PlayerEnterCheckpoint|PlayerEnterCheckpoint]] triggers when a player enters a checkpoint, so the event is automatically triggered and returns for you the &#039;&#039;&#039;Player&#039;&#039;&#039; that entered the checkpoint and the &#039;&#039;&#039;Checkpoint&#039;&#039;&#039; that he entered.&lt;br /&gt;
&lt;br /&gt;
== Events system ==&lt;br /&gt;
&lt;br /&gt;
In-order to use the events you need to register the event into the events tree using [[Events::add|addEvent]].&amp;lt;br&amp;gt; &lt;br /&gt;
There are 2 types of &#039;&#039;&#039;Events&#039;&#039;&#039;:&lt;br /&gt;
*Built in events&lt;br /&gt;
*Custom events&lt;br /&gt;
&lt;br /&gt;
=== Built in events ===&lt;br /&gt;
&lt;br /&gt;
They are events provided by &#039;&#039;&#039;RAGE:MP&#039;&#039;&#039; to be auto-triggered in a certain situation as we mentioned in the beginning (a &#039;&#039;&#039;Player&#039;&#039;&#039; entering a &#039;&#039;&#039;Checkpoint&#039;&#039;&#039;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are listed on the following pages:&lt;br /&gt;
*[[Server-side_events|Server-side events]]&lt;br /&gt;
*[[Client-side_events|Client-side events]]&lt;br /&gt;
&lt;br /&gt;
=== Custom events ===&lt;br /&gt;
&lt;br /&gt;
They are events build for you to control/call them anytime you want and in any situation you create for the &#039;&#039;&#039;Player&#039;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using events ==&lt;br /&gt;
&lt;br /&gt;
=== Registering an event ===&lt;br /&gt;
&lt;br /&gt;
You always have to register an event to the events tree before using it anywhere.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Registering it is pretty simple, but you have to keep in mind in which area it&#039;ll be called.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if your event will be for server-side use only then you can register it the way you want.&lt;br /&gt;
&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.add(&#039;eventName&#039;, (arg1, arg2, etc.) =&amp;gt; {&lt;br /&gt;
// code&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
if your event will be called from client-side and you registered it in server-side. You have to add &#039;&#039;&#039;player&#039;&#039;&#039; argument as a main first argument because client-side delivers the localPlayer with your data, so you can know which player is it.&lt;br /&gt;
&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.add(&#039;eventName&#039;, (player, arg1, arg2, etc.) =&amp;gt; {&lt;br /&gt;
// code&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;CEF&#039;&#039;&#039; you&#039;re not allowed to register any events. You can only call the functions that are registered in your &#039;&#039;&#039;CEF&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Calling methods ==&lt;br /&gt;
&lt;br /&gt;
It is pretty important to know how to call your events on each side, or you&#039;ll be totally lost in your development. We made it easier for you with the following calling methods, so you can know how the events calling system is working.&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
===Calling server-side or client-side local events===&lt;br /&gt;
====Syntax====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.call(&#039;eventName&#039;, args);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Calling client-side events from server-side (the server-side calls client-side)===&lt;br /&gt;
Notice: arguments must be inside an array.&lt;br /&gt;
====Make a player call their client-side====&lt;br /&gt;
=====Syntax=====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.call(&#039;eventName&#039;, [arg1, arg2]);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Examples=====&lt;br /&gt;
======Example 1======&lt;br /&gt;
With this example we&#039;ll add a server-side command that calls a client-side event that starts a screen effect on the player who types the command.&lt;br /&gt;
As show below, once a player types /effect [effect] (for example, /effect ChopVision) it will send whatever the player typed on the first argument to the event created on the client-side (&#039;startEffectEvent&#039;).&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.addCommand(&#039;effect&#039;, (player, fullText, effect) =&amp;gt; {&lt;br /&gt;
    player.call(&#039;startEffectEvent&#039;, [effect]);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
On the client-side, it will received whatever the player typed on the first argument and replace it on the effect.&lt;br /&gt;
{{ClientsideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.add(&#039;startEffectEvent&#039;, (effect) =&amp;gt; {&lt;br /&gt;
    mp.game.graphics.startScreenEffect(effect, 10000, false);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
====Make all players in the server call their client-side====&lt;br /&gt;
=====Syntax=====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.players.call(&#039;eventName&#039;, [arg1, arg2]);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Make server-side call a filtered player&#039;s client-side====&lt;br /&gt;
The example below filters a player with the name &#039;&#039;&#039;WeirdNewbie&#039;&#039;&#039; to call his client-side.&lt;br /&gt;
=====Syntax=====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.players.call(mp.players.toArray().filter((_player) =&amp;gt; _player.name == &#039;WeirdNewbie&#039;), &#039;eventName&#039;, [args]);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Calling server-side events from client-side (the client-side calls server-side)===&lt;br /&gt;
====Syntax====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.callRemote(&#039;eventName&#039;, args);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Calling a function registered in CEF from client-side (the client-side calls CEF)===&lt;br /&gt;
====Syntax====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mbrowser.execute(´javascriptFunction(&#039;${variable1}&#039;,&#039;${variable2}&#039;);´);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Calling a client-side event from CEF (the CEF calls client-side)===&lt;br /&gt;
Notice: You can&#039;t communicate between CEF and server-side&lt;br /&gt;
====Syntax====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.trigger(&#039;eventName&#039;, args);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Cancelling events ==&lt;br /&gt;
&lt;br /&gt;
There are 2 ways to cancel a event:&lt;br /&gt;
*Pausing it for future use.&lt;br /&gt;
*Removing it from events tree.&lt;br /&gt;
&lt;br /&gt;
=== Pausing ===&lt;br /&gt;
&lt;br /&gt;
In-order to pause a event you are required to use a special function to add that event ([[Events::Event|mp.Event]]).&amp;lt;br&amp;gt;&lt;br /&gt;
A small example of how to use it:&lt;br /&gt;
&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let ev = new mp.Event(&amp;quot;playerDeath&amp;quot;, (player, reason, killer) =&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    mp.players.broadcast(&#039;First blood!&#039;);&lt;br /&gt;
    ev.destroy(); // this event handler will be not called anymore since it&#039;s destroyed&lt;br /&gt;
});&lt;br /&gt;
// ev.enable(); due to this line the event will be re-enabled.&lt;br /&gt;
// ev.destroy(); due to this line the event is never going to be executed if we call this before it&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Removing ===&lt;br /&gt;
&lt;br /&gt;
Here are all the methods to remove events:&lt;br /&gt;
&lt;br /&gt;
{{SharedCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Remove specified handler of specified event&lt;br /&gt;
function playerJoinHandler(player)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
mp.events.add(&amp;quot;playerJoin&amp;quot;, playerJoinHandler);&lt;br /&gt;
mp.events.remove(&amp;quot;playerJoin&amp;quot;, playerJoinHandler);&lt;br /&gt;
&lt;br /&gt;
// Remove handler(s) specified event(s)&lt;br /&gt;
mp.events.remove(&amp;quot;playerJoin&amp;quot;);&lt;br /&gt;
mp.events.remove([&amp;quot;playerJoin&amp;quot;, &amp;quot;playerQuit&amp;quot;]);&lt;br /&gt;
&lt;br /&gt;
// Reset whole event tree.&lt;br /&gt;
mp.events.reset();&lt;br /&gt;
&lt;br /&gt;
// Get all handlers of specified event&lt;br /&gt;
mp.events.getAllOf(&amp;quot;playerJoin&amp;quot;).forEach(_ev =&amp;gt; _ev(null));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
{{ScriptingTutorials}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Almeidowski</name></author>
	</entry>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Object::Object&amp;diff=19982</id>
		<title>Object::Object</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Object::Object&amp;diff=19982"/>
		<updated>2020-08-30T12:18:44Z</updated>

		<summary type="html">&lt;p&gt;Almeidowski: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SharedFunctionJS}}&lt;br /&gt;
&lt;br /&gt;
Creates a new Object.&lt;br /&gt;
 &lt;br /&gt;
*&#039;&#039;&#039;[https://cdn.rage.mp/public/odb/index.html Objects gallery]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
==Syntax==&lt;br /&gt;
{{SharedCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.objects.new(model, position,&lt;br /&gt;
{&lt;br /&gt;
    rotation: rotation,&lt;br /&gt;
    alpha: alpha,&lt;br /&gt;
    dimension: dimension&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*&#039;&#039;&#039;model&#039;&#039;&#039;: {{RageType|Hash}}&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039;: {{RageType|Vector3}}&lt;br /&gt;
*&#039;&#039;&#039;rotation&#039;&#039;&#039;: {{RageType|Vector3}}&lt;br /&gt;
*&#039;&#039;&#039;alpha&#039;&#039;&#039;: {{RageType|Number}}: The object&#039;s transparency.&lt;br /&gt;
*&#039;&#039;&#039;dimension&#039;&#039;&#039;: {{RageType|Number}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.addCommand(&#039;flag&#039;, (player) =&amp;gt; {&lt;br /&gt;
    mp.objects.new(&#039;apa_prop_flag_portugal, player.position,&lt;br /&gt;
        {&lt;br /&gt;
            rotation: player.rotation,&lt;br /&gt;
            alpha: 250,&lt;br /&gt;
            dimension: player.dimension&lt;br /&gt;
        });&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
//Following this code, you&#039;ll create a portuguese flag (apa_prop_flag_portugal) at the players position, facing the same way the player is facing, with no transparency (250 on alpha) and at the same dimension the player is.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Object API]]&lt;br /&gt;
[[Category:Shared Function]]&lt;br /&gt;
[[Category:TODO: Example]]&lt;/div&gt;</summary>
		<author><name>Almeidowski</name></author>
	</entry>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Object::Object&amp;diff=19981</id>
		<title>Object::Object</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Object::Object&amp;diff=19981"/>
		<updated>2020-08-30T12:13:19Z</updated>

		<summary type="html">&lt;p&gt;Almeidowski: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SharedFunctionJS}}&lt;br /&gt;
&lt;br /&gt;
Creates a new Object.&lt;br /&gt;
 &lt;br /&gt;
*&#039;&#039;&#039;[https://cdn.rage.mp/public/odb/index.html Objects gallery]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
==Syntax==&lt;br /&gt;
{{SharedCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.objects.new(model, position,&lt;br /&gt;
{&lt;br /&gt;
    rotation: rotation,&lt;br /&gt;
    alpha: alpha,&lt;br /&gt;
    dimension: dimension&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*&#039;&#039;&#039;model&#039;&#039;&#039;: {{RageType|Hash}}&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039;: {{RageType|Vector3}}&lt;br /&gt;
*&#039;&#039;&#039;rotation&#039;&#039;&#039;: {{RageType|Vector3}}&lt;br /&gt;
*&#039;&#039;&#039;alpha&#039;&#039;&#039;: {{RageType|Number}}: The object&#039;s transparency.&lt;br /&gt;
*&#039;&#039;&#039;dimension&#039;&#039;&#039;: {{RageType|Number}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.addCommand(&#039;flag&#039;, (player) =&amp;gt; {&lt;br /&gt;
    mp.objects.new(&#039;apa_prop_flag_portugal, player.position,&lt;br /&gt;
        {&lt;br /&gt;
            rotation: player.rotation,&lt;br /&gt;
            alpha: 100,&lt;br /&gt;
            dimension: player.dimension&lt;br /&gt;
        });&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
//Following this code, you&#039;ll create a portuguese flag (apa_prop_flag_portugal) at the players position, facing the same way the player is facing, with no transparency (100 on alphaa) and at the same dimension the player is.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Object API]]&lt;br /&gt;
[[Category:Shared Function]]&lt;br /&gt;
[[Category:TODO: Example]]&lt;/div&gt;</summary>
		<author><name>Almeidowski</name></author>
	</entry>
</feed>