<?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=Jefte</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=Jefte"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Jefte"/>
	<updated>2026-05-06T00:00:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62363</id>
		<title>Slothman/Slothbot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62363"/>
		<updated>2019-03-18T02:46:55Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* CARACTERISTICAS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a resource designed to allow scripts or gamemodes to insert a ped into the game that roughly simulates combat with a real player. Gamemodes can implement the bots as opponents to actual players or as teammates. &lt;br /&gt;
&lt;br /&gt;
=CARACTERISTICAS=&lt;br /&gt;
'''Teamplay:'''&lt;br /&gt;
O bot é capaz de identificar amigo de inimigo.&lt;br /&gt;
&lt;br /&gt;
'''Map Navigation:'''&lt;br /&gt;
Quando o bot é colocado em um mapa que tem caminhos adequadamente marcados (veja abaixo como fazer isso), o bot navegará no mapa, procurando inimigos. Sem caminhos, um robô pode pensar ainda por si mesmo, mas não se movimentará como proficientemente.&lt;br /&gt;
&lt;br /&gt;
'''Aggressiveness:'''&lt;br /&gt;
Os Bots atacarão qualquer ped, jogador ou bot que não esteja em seu time.&lt;br /&gt;
&lt;br /&gt;
'''Cooperation:'''&lt;br /&gt;
Os bots podem automaticamente se juntar-se aos colegas de equipe (seja jogador ou bot) encontrando-se com eles e se unindo.&lt;br /&gt;
&lt;br /&gt;
'''Advanced movement:'''&lt;br /&gt;
Se houver obstáculos bloqueando um caminho de bots, o bot tentará contorná-lo ou ultrapassá-lo, em vez de apenas entrar em uma parede por toda a eternidade.&lt;br /&gt;
&lt;br /&gt;
'''Vários modos de jogar:'''&lt;br /&gt;
*&amp;quot;hunting&amp;quot; - O bot fará vários trajetos no mapa do jogo até encontrar um inimigo ou colega de equipe.&lt;br /&gt;
*&amp;quot;waiting&amp;quot; - O bot fica parado até que um inimigo do companheiro de equipe venha à vista.&lt;br /&gt;
*&amp;quot;guarding&amp;quot; - O bot atacará qualquer inimigo que esteja à vista, mas não se moverá de sua posição de origem&lt;br /&gt;
*&amp;quot;following&amp;quot; - O bot seguirá um jogador ou outro bot enquanto estiver atacando inimigos.&lt;br /&gt;
*&amp;quot;chasing&amp;quot; - o bot atacará um bot ou jogador inimigo&lt;br /&gt;
&lt;br /&gt;
'''Gamemode/Script integration:'''&lt;br /&gt;
Esse script fornece várias funções e eventos para permitir que outros recursos vejam e controlem o que os bots estão fazendo e até mesmo controlem certos comportamentos.&lt;br /&gt;
&lt;br /&gt;
'''EDF for map path creation:'''&lt;br /&gt;
Integrado ao editor de mapas, os designers de mapas podem facilmente colocar caminhos para os bots seguirem em seus mapas. Isso aumentou muito a capacidade dos bots de simular o verdadeiro jogo.&lt;br /&gt;
&lt;br /&gt;
=Server Events=&lt;br /&gt;
&lt;br /&gt;
==onBotFindEnemy==&lt;br /&gt;
This triggers when a bot locates an enemy, This event can be cancelled to prevent the bot from chasing players&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element enemy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''enemy''': The Player or Ped the bot has spotted&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that has found an enemy&lt;br /&gt;
&lt;br /&gt;
==onBotWasted==&lt;br /&gt;
This triggers when a bot is killed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element attacker, float weapon, float bodypart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''attacker''': The Element that killed the bot&lt;br /&gt;
*'''weapon''': The weapon id used to kill the bot&lt;br /&gt;
*'''bodypart''': The bodypart id that was hit to kill the bot&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that died&lt;br /&gt;
&lt;br /&gt;
==onBotSpawned==&lt;br /&gt;
This triggers when a bot is spawned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that spawned&lt;br /&gt;
&lt;br /&gt;
==onBotFollow==&lt;br /&gt;
This triggers when a bot starts following a teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element leader&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''leader''': The Player or Ped the bot has started following&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that starts following a teammate&lt;br /&gt;
&lt;br /&gt;
=Server Functions=&lt;br /&gt;
All of these functions will have to be used through the [[call]] function, otherwise they won't work&lt;br /&gt;
&lt;br /&gt;
==spawnBot==&lt;br /&gt;
This function spawns a bot ingame, will return the bot element, or false if there was a problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil, int weapon = 0, string theMode = &amp;quot;hunting&amp;quot;, element theModesubject = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''x:''' The x co-ordinate to spawn the bot at&lt;br /&gt;
*'''y:''' The y co-ordinate to spawn the bot at&lt;br /&gt;
*'''z:''' The z co-ordinate to spawn the bot at&lt;br /&gt;
*'''rotation:''' Rotation of the bot on spawn&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''skinID:''' Bots skin on spawn&lt;br /&gt;
*'''interior:''' Interior the bot will spawn into&lt;br /&gt;
*'''dimension:''' The ID of the [[dimension]] that the bot should be in&lt;br /&gt;
*'''theTeam:''' The team the bot will join&lt;br /&gt;
*'''weapon:''' The weapon the ped will carry&lt;br /&gt;
*'''theMode:''' The action the bot will be performing when spawned (see &amp;quot;modes of playing&amp;quot; above)&lt;br /&gt;
*'''theModeSubject:''' If theMode is &amp;quot;chasing&amp;quot; or &amp;quot;following&amp;quot; this arg is needed to tell the bot what opponent to chase or teammate to follow&lt;br /&gt;
&lt;br /&gt;
==setBotHunt==&lt;br /&gt;
makes the bot travel pathways until finding an enemy or teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotHunt ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to hunt&lt;br /&gt;
&lt;br /&gt;
==setBotWait==&lt;br /&gt;
makes the bot stand still until an enemy of teammate comes into view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWait ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to wait&lt;br /&gt;
&lt;br /&gt;
==setBotChase==&lt;br /&gt;
makes the bot attack an anemy bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotChase ( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the chasing&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be chased&lt;br /&gt;
&lt;br /&gt;
==setBotFollow==&lt;br /&gt;
makes the bot follow a teammate bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotFollow( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the following&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be followed&lt;br /&gt;
&lt;br /&gt;
==setBotGuard==&lt;br /&gt;
makes the bot move to the specific coords and stay there while attacking any enemies&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotGuard( element theBot, float x, float y, float z, [ bool priority = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to do the guarding&lt;br /&gt;
*'''x:''' The X coords you want the bot to guard&lt;br /&gt;
*'''y:''' The Y coords you want the bot to guard&lt;br /&gt;
*'''z:''' The Z coords you want the bot to guard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''priority:''' Set to true only if you want the bot to only shoot once it has reached the location to guard&lt;br /&gt;
&lt;br /&gt;
==getBotTeam==&lt;br /&gt;
returns the Team the bot is on, false if no team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotTeam ( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the team of&lt;br /&gt;
&lt;br /&gt;
==setBotTeam==&lt;br /&gt;
changes the bot's team and loyalties&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotTeam ( element theBot, team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to change the team of&lt;br /&gt;
*'''theTeam:''' The team the bot should join&lt;br /&gt;
&lt;br /&gt;
==getBotAttackEnabled==&lt;br /&gt;
returns true if the bot is allowed to attack, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getBotAttackEnabled( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check if it can attack&lt;br /&gt;
&lt;br /&gt;
==setBotAttackEnabled==&lt;br /&gt;
allow or disallow the bot to attack (press fire)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotAttackEnabled( element theBot, bool enabled)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set if it can attack&lt;br /&gt;
*'''enabled:''' set to false to remove the bots ability to attack, true to allow it&lt;br /&gt;
&lt;br /&gt;
==getBotMode==&lt;br /&gt;
returns the mode the bot is in (&amp;quot;chasing&amp;quot;, &amp;quot;waiting&amp;quot;, &amp;quot;guarding&amp;quot;, &amp;quot;hunting&amp;quot;, &amp;quot;following&amp;quot;) or if the bot is chasing or following, it will return the mode and the target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotMode( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the status of&lt;br /&gt;
&lt;br /&gt;
==isPedBot==&lt;br /&gt;
returns true if the ped is a bot, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPedbot( element thePed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''thePed:''' The ped you want to check if its a bot&lt;br /&gt;
&lt;br /&gt;
==setBotWeapon==&lt;br /&gt;
sets the bots weapon id (ammo is always infinite)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWeapon( element theBot, float weapon)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set the weapon of&lt;br /&gt;
*'''weapon:''' the weapon id you want to give the bot&lt;br /&gt;
&lt;br /&gt;
=Credits=&lt;br /&gt;
*'''Slothman:''' Bot creator, main scripter&lt;br /&gt;
*'''Gamesnert:''' EDF creator, scripting, testing&lt;br /&gt;
*'''Dragon:''' Gamemode creator, testing, scripting help&lt;br /&gt;
*'''EvGeniz:''' early testing, mapping&lt;br /&gt;
'''Thanks to Everyone else who made suggestions, tested the script, helped when i was stuck, etc'''&lt;br /&gt;
[[Category:Resource]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Slothbot]]&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62362</id>
		<title>Slothman/Slothbot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62362"/>
		<updated>2019-03-18T02:42:38Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* CARACTERISTICAS */ Traduzido para o português por Jefte Souza&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a resource designed to allow scripts or gamemodes to insert a ped into the game that roughly simulates combat with a real player. Gamemodes can implement the bots as opponents to actual players or as teammates. &lt;br /&gt;
&lt;br /&gt;
=CARACTERISTICAS=&lt;br /&gt;
'''Teamplay:'''&lt;br /&gt;
O bot é capaz de identificar amigo de inimigo.&lt;br /&gt;
&lt;br /&gt;
'''Map Navigation:'''&lt;br /&gt;
Quando o bot é colocado em um mapa que tem caminhos adequadamente marcados (veja abaixo como fazer isso), o bot navegará no mapa, procurando inimigos. Sem caminhos, um robô pode pensar ainda por si mesmo, mas não se movimentará como proficientemente.&lt;br /&gt;
&lt;br /&gt;
'''Aggressiveness:'''&lt;br /&gt;
Os Bots atacarão qualquer ped, jogador ou bot que não esteja em seu time.&lt;br /&gt;
&lt;br /&gt;
'''Cooperation:'''&lt;br /&gt;
Os bots podem automaticamente se juntar-se aos colegas de equipe (seja jogador ou bot) encontrando-se com eles e se unindo.&lt;br /&gt;
&lt;br /&gt;
'''Advanced movement:'''&lt;br /&gt;
Se houver obstáculos bloqueando um caminho de bots, o bot tentará contorná-lo ou ultrapassá-lo, em vez de apenas entrar em uma parede por toda a eternidade.&lt;br /&gt;
&lt;br /&gt;
'''Vários modos de jogar:'''&lt;br /&gt;
*&amp;quot;hunting&amp;quot; - travel pathways until finding an enemy or teammate&lt;br /&gt;
*&amp;quot;waiting&amp;quot; - O bot fica parado até que um inimigo do companheiro de equipe venha à vista.&lt;br /&gt;
*&amp;quot;guarding&amp;quot; - O bot atacará qualquer inimigo que esteja à vista, mas não se moverá de sua posição de origem&lt;br /&gt;
*&amp;quot;following&amp;quot; - O bot seguirá um jogador ou outro bot enquanto estiver atacando inimigos.&lt;br /&gt;
*&amp;quot;chasing&amp;quot; - o bot atacará um bot ou jogador inimigo&lt;br /&gt;
&lt;br /&gt;
'''Gamemode/Script integration:'''&lt;br /&gt;
Esse script fornece várias funções e eventos para permitir que outros recursos vejam e controlem o que os bots estão fazendo e até mesmo controlem certos comportamentos.&lt;br /&gt;
&lt;br /&gt;
'''EDF for map path creation:'''&lt;br /&gt;
Integrado ao editor de mapas, os designers de mapas podem facilmente colocar caminhos para os bots seguirem em seus mapas. Isso aumentou muito a capacidade dos bots de simular o verdadeiro jogo.&lt;br /&gt;
&lt;br /&gt;
=Server Events=&lt;br /&gt;
&lt;br /&gt;
==onBotFindEnemy==&lt;br /&gt;
This triggers when a bot locates an enemy, This event can be cancelled to prevent the bot from chasing players&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element enemy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''enemy''': The Player or Ped the bot has spotted&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that has found an enemy&lt;br /&gt;
&lt;br /&gt;
==onBotWasted==&lt;br /&gt;
This triggers when a bot is killed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element attacker, float weapon, float bodypart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''attacker''': The Element that killed the bot&lt;br /&gt;
*'''weapon''': The weapon id used to kill the bot&lt;br /&gt;
*'''bodypart''': The bodypart id that was hit to kill the bot&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that died&lt;br /&gt;
&lt;br /&gt;
==onBotSpawned==&lt;br /&gt;
This triggers when a bot is spawned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that spawned&lt;br /&gt;
&lt;br /&gt;
==onBotFollow==&lt;br /&gt;
This triggers when a bot starts following a teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element leader&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''leader''': The Player or Ped the bot has started following&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that starts following a teammate&lt;br /&gt;
&lt;br /&gt;
=Server Functions=&lt;br /&gt;
All of these functions will have to be used through the [[call]] function, otherwise they won't work&lt;br /&gt;
&lt;br /&gt;
==spawnBot==&lt;br /&gt;
This function spawns a bot ingame, will return the bot element, or false if there was a problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil, int weapon = 0, string theMode = &amp;quot;hunting&amp;quot;, element theModesubject = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''x:''' The x co-ordinate to spawn the bot at&lt;br /&gt;
*'''y:''' The y co-ordinate to spawn the bot at&lt;br /&gt;
*'''z:''' The z co-ordinate to spawn the bot at&lt;br /&gt;
*'''rotation:''' Rotation of the bot on spawn&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''skinID:''' Bots skin on spawn&lt;br /&gt;
*'''interior:''' Interior the bot will spawn into&lt;br /&gt;
*'''dimension:''' The ID of the [[dimension]] that the bot should be in&lt;br /&gt;
*'''theTeam:''' The team the bot will join&lt;br /&gt;
*'''weapon:''' The weapon the ped will carry&lt;br /&gt;
*'''theMode:''' The action the bot will be performing when spawned (see &amp;quot;modes of playing&amp;quot; above)&lt;br /&gt;
*'''theModeSubject:''' If theMode is &amp;quot;chasing&amp;quot; or &amp;quot;following&amp;quot; this arg is needed to tell the bot what opponent to chase or teammate to follow&lt;br /&gt;
&lt;br /&gt;
==setBotHunt==&lt;br /&gt;
makes the bot travel pathways until finding an enemy or teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotHunt ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to hunt&lt;br /&gt;
&lt;br /&gt;
==setBotWait==&lt;br /&gt;
makes the bot stand still until an enemy of teammate comes into view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWait ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to wait&lt;br /&gt;
&lt;br /&gt;
==setBotChase==&lt;br /&gt;
makes the bot attack an anemy bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotChase ( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the chasing&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be chased&lt;br /&gt;
&lt;br /&gt;
==setBotFollow==&lt;br /&gt;
makes the bot follow a teammate bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotFollow( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the following&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be followed&lt;br /&gt;
&lt;br /&gt;
==setBotGuard==&lt;br /&gt;
makes the bot move to the specific coords and stay there while attacking any enemies&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotGuard( element theBot, float x, float y, float z, [ bool priority = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to do the guarding&lt;br /&gt;
*'''x:''' The X coords you want the bot to guard&lt;br /&gt;
*'''y:''' The Y coords you want the bot to guard&lt;br /&gt;
*'''z:''' The Z coords you want the bot to guard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''priority:''' Set to true only if you want the bot to only shoot once it has reached the location to guard&lt;br /&gt;
&lt;br /&gt;
==getBotTeam==&lt;br /&gt;
returns the Team the bot is on, false if no team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotTeam ( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the team of&lt;br /&gt;
&lt;br /&gt;
==setBotTeam==&lt;br /&gt;
changes the bot's team and loyalties&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotTeam ( element theBot, team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to change the team of&lt;br /&gt;
*'''theTeam:''' The team the bot should join&lt;br /&gt;
&lt;br /&gt;
==getBotAttackEnabled==&lt;br /&gt;
returns true if the bot is allowed to attack, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getBotAttackEnabled( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check if it can attack&lt;br /&gt;
&lt;br /&gt;
==setBotAttackEnabled==&lt;br /&gt;
allow or disallow the bot to attack (press fire)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotAttackEnabled( element theBot, bool enabled)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set if it can attack&lt;br /&gt;
*'''enabled:''' set to false to remove the bots ability to attack, true to allow it&lt;br /&gt;
&lt;br /&gt;
==getBotMode==&lt;br /&gt;
returns the mode the bot is in (&amp;quot;chasing&amp;quot;, &amp;quot;waiting&amp;quot;, &amp;quot;guarding&amp;quot;, &amp;quot;hunting&amp;quot;, &amp;quot;following&amp;quot;) or if the bot is chasing or following, it will return the mode and the target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotMode( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the status of&lt;br /&gt;
&lt;br /&gt;
==isPedBot==&lt;br /&gt;
returns true if the ped is a bot, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPedbot( element thePed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''thePed:''' The ped you want to check if its a bot&lt;br /&gt;
&lt;br /&gt;
==setBotWeapon==&lt;br /&gt;
sets the bots weapon id (ammo is always infinite)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWeapon( element theBot, float weapon)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set the weapon of&lt;br /&gt;
*'''weapon:''' the weapon id you want to give the bot&lt;br /&gt;
&lt;br /&gt;
=Credits=&lt;br /&gt;
*'''Slothman:''' Bot creator, main scripter&lt;br /&gt;
*'''Gamesnert:''' EDF creator, scripting, testing&lt;br /&gt;
*'''Dragon:''' Gamemode creator, testing, scripting help&lt;br /&gt;
*'''EvGeniz:''' early testing, mapping&lt;br /&gt;
'''Thanks to Everyone else who made suggestions, tested the script, helped when i was stuck, etc'''&lt;br /&gt;
[[Category:Resource]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Slothbot]]&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62361</id>
		<title>Slothman/Slothbot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62361"/>
		<updated>2019-03-18T02:33:26Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* CARACTERISTICAS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a resource designed to allow scripts or gamemodes to insert a ped into the game that roughly simulates combat with a real player. Gamemodes can implement the bots as opponents to actual players or as teammates. &lt;br /&gt;
&lt;br /&gt;
=CARACTERISTICAS=&lt;br /&gt;
'''Teamplay:'''&lt;br /&gt;
O bot é capaz de identificar amigo de inimigo.&lt;br /&gt;
&lt;br /&gt;
'''Map Navigation:'''&lt;br /&gt;
Quando o bot é colocado em um mapa que tem caminhos adequadamente marcados (veja abaixo como fazer isso), o bot navegará no mapa, procurando inimigos. Sem caminhos, um robô pode pensar ainda por si mesmo, mas não se movimentará como proficientemente.&lt;br /&gt;
&lt;br /&gt;
'''Aggressiveness:'''&lt;br /&gt;
Os Bots atacarão qualquer ped, jogador ou bot que não esteja em seu time.&lt;br /&gt;
&lt;br /&gt;
'''Cooperation:'''&lt;br /&gt;
Os bots podem automaticamente se juntar-se aos colegas de equipe (seja jogador ou bot) encontrando-se com eles e se unindo.&lt;br /&gt;
&lt;br /&gt;
'''Advanced movement:'''&lt;br /&gt;
If there's obstacles blocking a bots path, the bot will attempt to get around or over it instead of just walking into a wall for eternity&lt;br /&gt;
&lt;br /&gt;
'''Multiple modes of playing:'''&lt;br /&gt;
*&amp;quot;hunting&amp;quot; - travel pathways until finding an enemy or teammate&lt;br /&gt;
*&amp;quot;waiting&amp;quot; - stand still until an enemy of teammate comes into view&lt;br /&gt;
*&amp;quot;guarding&amp;quot; - the bot will attack any enemy that comes within sight, but not move from its spawn position&lt;br /&gt;
*&amp;quot;following&amp;quot; - the bot will follow a player or bot while attacking enemies&lt;br /&gt;
*&amp;quot;chasing&amp;quot; - the bot will attack an enemy bot or player&lt;br /&gt;
&lt;br /&gt;
'''Gamemode/Script integration:'''&lt;br /&gt;
This script provides several functions and events to allow other resources to see and control what the bot's are doing, and even take control of certain behavior.&lt;br /&gt;
&lt;br /&gt;
'''EDF for map path creation:'''&lt;br /&gt;
Integrated into the map editor, map designers can easily place paths for bots to follow along in their maps. this greatly increased the bots ability to simulate true playing.&lt;br /&gt;
&lt;br /&gt;
=Server Events=&lt;br /&gt;
&lt;br /&gt;
==onBotFindEnemy==&lt;br /&gt;
This triggers when a bot locates an enemy, This event can be cancelled to prevent the bot from chasing players&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element enemy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''enemy''': The Player or Ped the bot has spotted&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that has found an enemy&lt;br /&gt;
&lt;br /&gt;
==onBotWasted==&lt;br /&gt;
This triggers when a bot is killed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element attacker, float weapon, float bodypart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''attacker''': The Element that killed the bot&lt;br /&gt;
*'''weapon''': The weapon id used to kill the bot&lt;br /&gt;
*'''bodypart''': The bodypart id that was hit to kill the bot&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that died&lt;br /&gt;
&lt;br /&gt;
==onBotSpawned==&lt;br /&gt;
This triggers when a bot is spawned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that spawned&lt;br /&gt;
&lt;br /&gt;
==onBotFollow==&lt;br /&gt;
This triggers when a bot starts following a teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element leader&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''leader''': The Player or Ped the bot has started following&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that starts following a teammate&lt;br /&gt;
&lt;br /&gt;
=Server Functions=&lt;br /&gt;
All of these functions will have to be used through the [[call]] function, otherwise they won't work&lt;br /&gt;
&lt;br /&gt;
==spawnBot==&lt;br /&gt;
This function spawns a bot ingame, will return the bot element, or false if there was a problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil, int weapon = 0, string theMode = &amp;quot;hunting&amp;quot;, element theModesubject = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''x:''' The x co-ordinate to spawn the bot at&lt;br /&gt;
*'''y:''' The y co-ordinate to spawn the bot at&lt;br /&gt;
*'''z:''' The z co-ordinate to spawn the bot at&lt;br /&gt;
*'''rotation:''' Rotation of the bot on spawn&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''skinID:''' Bots skin on spawn&lt;br /&gt;
*'''interior:''' Interior the bot will spawn into&lt;br /&gt;
*'''dimension:''' The ID of the [[dimension]] that the bot should be in&lt;br /&gt;
*'''theTeam:''' The team the bot will join&lt;br /&gt;
*'''weapon:''' The weapon the ped will carry&lt;br /&gt;
*'''theMode:''' The action the bot will be performing when spawned (see &amp;quot;modes of playing&amp;quot; above)&lt;br /&gt;
*'''theModeSubject:''' If theMode is &amp;quot;chasing&amp;quot; or &amp;quot;following&amp;quot; this arg is needed to tell the bot what opponent to chase or teammate to follow&lt;br /&gt;
&lt;br /&gt;
==setBotHunt==&lt;br /&gt;
makes the bot travel pathways until finding an enemy or teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotHunt ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to hunt&lt;br /&gt;
&lt;br /&gt;
==setBotWait==&lt;br /&gt;
makes the bot stand still until an enemy of teammate comes into view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWait ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to wait&lt;br /&gt;
&lt;br /&gt;
==setBotChase==&lt;br /&gt;
makes the bot attack an anemy bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotChase ( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the chasing&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be chased&lt;br /&gt;
&lt;br /&gt;
==setBotFollow==&lt;br /&gt;
makes the bot follow a teammate bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotFollow( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the following&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be followed&lt;br /&gt;
&lt;br /&gt;
==setBotGuard==&lt;br /&gt;
makes the bot move to the specific coords and stay there while attacking any enemies&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotGuard( element theBot, float x, float y, float z, [ bool priority = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to do the guarding&lt;br /&gt;
*'''x:''' The X coords you want the bot to guard&lt;br /&gt;
*'''y:''' The Y coords you want the bot to guard&lt;br /&gt;
*'''z:''' The Z coords you want the bot to guard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''priority:''' Set to true only if you want the bot to only shoot once it has reached the location to guard&lt;br /&gt;
&lt;br /&gt;
==getBotTeam==&lt;br /&gt;
returns the Team the bot is on, false if no team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotTeam ( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the team of&lt;br /&gt;
&lt;br /&gt;
==setBotTeam==&lt;br /&gt;
changes the bot's team and loyalties&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotTeam ( element theBot, team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to change the team of&lt;br /&gt;
*'''theTeam:''' The team the bot should join&lt;br /&gt;
&lt;br /&gt;
==getBotAttackEnabled==&lt;br /&gt;
returns true if the bot is allowed to attack, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getBotAttackEnabled( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check if it can attack&lt;br /&gt;
&lt;br /&gt;
==setBotAttackEnabled==&lt;br /&gt;
allow or disallow the bot to attack (press fire)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotAttackEnabled( element theBot, bool enabled)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set if it can attack&lt;br /&gt;
*'''enabled:''' set to false to remove the bots ability to attack, true to allow it&lt;br /&gt;
&lt;br /&gt;
==getBotMode==&lt;br /&gt;
returns the mode the bot is in (&amp;quot;chasing&amp;quot;, &amp;quot;waiting&amp;quot;, &amp;quot;guarding&amp;quot;, &amp;quot;hunting&amp;quot;, &amp;quot;following&amp;quot;) or if the bot is chasing or following, it will return the mode and the target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotMode( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the status of&lt;br /&gt;
&lt;br /&gt;
==isPedBot==&lt;br /&gt;
returns true if the ped is a bot, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPedbot( element thePed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''thePed:''' The ped you want to check if its a bot&lt;br /&gt;
&lt;br /&gt;
==setBotWeapon==&lt;br /&gt;
sets the bots weapon id (ammo is always infinite)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWeapon( element theBot, float weapon)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set the weapon of&lt;br /&gt;
*'''weapon:''' the weapon id you want to give the bot&lt;br /&gt;
&lt;br /&gt;
=Credits=&lt;br /&gt;
*'''Slothman:''' Bot creator, main scripter&lt;br /&gt;
*'''Gamesnert:''' EDF creator, scripting, testing&lt;br /&gt;
*'''Dragon:''' Gamemode creator, testing, scripting help&lt;br /&gt;
*'''EvGeniz:''' early testing, mapping&lt;br /&gt;
'''Thanks to Everyone else who made suggestions, tested the script, helped when i was stuck, etc'''&lt;br /&gt;
[[Category:Resource]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Slothbot]]&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62360</id>
		<title>Slothman/Slothbot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62360"/>
		<updated>2019-03-18T02:31:27Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* CARACTERÍSTICAS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a resource designed to allow scripts or gamemodes to insert a ped into the game that roughly simulates combat with a real player. Gamemodes can implement the bots as opponents to actual players or as teammates. &lt;br /&gt;
&lt;br /&gt;
=CARACTERISTICAS=&lt;br /&gt;
'''Teamplay:'''&lt;br /&gt;
O bot é capaz de identificar amigo de inimigo.&lt;br /&gt;
&lt;br /&gt;
'''Map Navigation:'''&lt;br /&gt;
Quando o bot é colocado em um mapa que tem caminhos adequadamente marcados (veja abaixo como fazer isso), o bot navegará no mapa, procurando inimigos. Sem caminhos, um robô pode pensar ainda por si mesmo, mas não se movimentará como proficientemente.&lt;br /&gt;
&lt;br /&gt;
'''Aggressiveness:'''&lt;br /&gt;
Bots atacará qualquer ped, jogador ou bot que não esteja em seu time.&lt;br /&gt;
&lt;br /&gt;
'''Cooperation:'''&lt;br /&gt;
Bots can automatically team up with teammates (either player or bot) by meeting up with them and sticking together&lt;br /&gt;
&lt;br /&gt;
'''Advanced movement:'''&lt;br /&gt;
If there's obstacles blocking a bots path, the bot will attempt to get around or over it instead of just walking into a wall for eternity&lt;br /&gt;
&lt;br /&gt;
'''Multiple modes of playing:'''&lt;br /&gt;
*&amp;quot;hunting&amp;quot; - travel pathways until finding an enemy or teammate&lt;br /&gt;
*&amp;quot;waiting&amp;quot; - stand still until an enemy of teammate comes into view&lt;br /&gt;
*&amp;quot;guarding&amp;quot; - the bot will attack any enemy that comes within sight, but not move from its spawn position&lt;br /&gt;
*&amp;quot;following&amp;quot; - the bot will follow a player or bot while attacking enemies&lt;br /&gt;
*&amp;quot;chasing&amp;quot; - the bot will attack an enemy bot or player&lt;br /&gt;
&lt;br /&gt;
'''Gamemode/Script integration:'''&lt;br /&gt;
This script provides several functions and events to allow other resources to see and control what the bot's are doing, and even take control of certain behavior.&lt;br /&gt;
&lt;br /&gt;
'''EDF for map path creation:'''&lt;br /&gt;
Integrated into the map editor, map designers can easily place paths for bots to follow along in their maps. this greatly increased the bots ability to simulate true playing.&lt;br /&gt;
&lt;br /&gt;
=Server Events=&lt;br /&gt;
&lt;br /&gt;
==onBotFindEnemy==&lt;br /&gt;
This triggers when a bot locates an enemy, This event can be cancelled to prevent the bot from chasing players&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element enemy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''enemy''': The Player or Ped the bot has spotted&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that has found an enemy&lt;br /&gt;
&lt;br /&gt;
==onBotWasted==&lt;br /&gt;
This triggers when a bot is killed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element attacker, float weapon, float bodypart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''attacker''': The Element that killed the bot&lt;br /&gt;
*'''weapon''': The weapon id used to kill the bot&lt;br /&gt;
*'''bodypart''': The bodypart id that was hit to kill the bot&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that died&lt;br /&gt;
&lt;br /&gt;
==onBotSpawned==&lt;br /&gt;
This triggers when a bot is spawned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that spawned&lt;br /&gt;
&lt;br /&gt;
==onBotFollow==&lt;br /&gt;
This triggers when a bot starts following a teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element leader&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''leader''': The Player or Ped the bot has started following&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that starts following a teammate&lt;br /&gt;
&lt;br /&gt;
=Server Functions=&lt;br /&gt;
All of these functions will have to be used through the [[call]] function, otherwise they won't work&lt;br /&gt;
&lt;br /&gt;
==spawnBot==&lt;br /&gt;
This function spawns a bot ingame, will return the bot element, or false if there was a problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil, int weapon = 0, string theMode = &amp;quot;hunting&amp;quot;, element theModesubject = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''x:''' The x co-ordinate to spawn the bot at&lt;br /&gt;
*'''y:''' The y co-ordinate to spawn the bot at&lt;br /&gt;
*'''z:''' The z co-ordinate to spawn the bot at&lt;br /&gt;
*'''rotation:''' Rotation of the bot on spawn&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''skinID:''' Bots skin on spawn&lt;br /&gt;
*'''interior:''' Interior the bot will spawn into&lt;br /&gt;
*'''dimension:''' The ID of the [[dimension]] that the bot should be in&lt;br /&gt;
*'''theTeam:''' The team the bot will join&lt;br /&gt;
*'''weapon:''' The weapon the ped will carry&lt;br /&gt;
*'''theMode:''' The action the bot will be performing when spawned (see &amp;quot;modes of playing&amp;quot; above)&lt;br /&gt;
*'''theModeSubject:''' If theMode is &amp;quot;chasing&amp;quot; or &amp;quot;following&amp;quot; this arg is needed to tell the bot what opponent to chase or teammate to follow&lt;br /&gt;
&lt;br /&gt;
==setBotHunt==&lt;br /&gt;
makes the bot travel pathways until finding an enemy or teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotHunt ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to hunt&lt;br /&gt;
&lt;br /&gt;
==setBotWait==&lt;br /&gt;
makes the bot stand still until an enemy of teammate comes into view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWait ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to wait&lt;br /&gt;
&lt;br /&gt;
==setBotChase==&lt;br /&gt;
makes the bot attack an anemy bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotChase ( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the chasing&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be chased&lt;br /&gt;
&lt;br /&gt;
==setBotFollow==&lt;br /&gt;
makes the bot follow a teammate bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotFollow( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the following&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be followed&lt;br /&gt;
&lt;br /&gt;
==setBotGuard==&lt;br /&gt;
makes the bot move to the specific coords and stay there while attacking any enemies&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotGuard( element theBot, float x, float y, float z, [ bool priority = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to do the guarding&lt;br /&gt;
*'''x:''' The X coords you want the bot to guard&lt;br /&gt;
*'''y:''' The Y coords you want the bot to guard&lt;br /&gt;
*'''z:''' The Z coords you want the bot to guard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''priority:''' Set to true only if you want the bot to only shoot once it has reached the location to guard&lt;br /&gt;
&lt;br /&gt;
==getBotTeam==&lt;br /&gt;
returns the Team the bot is on, false if no team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotTeam ( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the team of&lt;br /&gt;
&lt;br /&gt;
==setBotTeam==&lt;br /&gt;
changes the bot's team and loyalties&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotTeam ( element theBot, team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to change the team of&lt;br /&gt;
*'''theTeam:''' The team the bot should join&lt;br /&gt;
&lt;br /&gt;
==getBotAttackEnabled==&lt;br /&gt;
returns true if the bot is allowed to attack, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getBotAttackEnabled( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check if it can attack&lt;br /&gt;
&lt;br /&gt;
==setBotAttackEnabled==&lt;br /&gt;
allow or disallow the bot to attack (press fire)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotAttackEnabled( element theBot, bool enabled)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set if it can attack&lt;br /&gt;
*'''enabled:''' set to false to remove the bots ability to attack, true to allow it&lt;br /&gt;
&lt;br /&gt;
==getBotMode==&lt;br /&gt;
returns the mode the bot is in (&amp;quot;chasing&amp;quot;, &amp;quot;waiting&amp;quot;, &amp;quot;guarding&amp;quot;, &amp;quot;hunting&amp;quot;, &amp;quot;following&amp;quot;) or if the bot is chasing or following, it will return the mode and the target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotMode( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the status of&lt;br /&gt;
&lt;br /&gt;
==isPedBot==&lt;br /&gt;
returns true if the ped is a bot, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPedbot( element thePed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''thePed:''' The ped you want to check if its a bot&lt;br /&gt;
&lt;br /&gt;
==setBotWeapon==&lt;br /&gt;
sets the bots weapon id (ammo is always infinite)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWeapon( element theBot, float weapon)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set the weapon of&lt;br /&gt;
*'''weapon:''' the weapon id you want to give the bot&lt;br /&gt;
&lt;br /&gt;
=Credits=&lt;br /&gt;
*'''Slothman:''' Bot creator, main scripter&lt;br /&gt;
*'''Gamesnert:''' EDF creator, scripting, testing&lt;br /&gt;
*'''Dragon:''' Gamemode creator, testing, scripting help&lt;br /&gt;
*'''EvGeniz:''' early testing, mapping&lt;br /&gt;
'''Thanks to Everyone else who made suggestions, tested the script, helped when i was stuck, etc'''&lt;br /&gt;
[[Category:Resource]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Slothbot]]&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62359</id>
		<title>Slothman/Slothbot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=62359"/>
		<updated>2019-03-18T02:30:58Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* Traduzindo todas as explicações para linguá portugues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a resource designed to allow scripts or gamemodes to insert a ped into the game that roughly simulates combat with a real player. Gamemodes can implement the bots as opponents to actual players or as teammates. &lt;br /&gt;
&lt;br /&gt;
=CARACTERÍSTICAS=&lt;br /&gt;
'''Teamplay:'''&lt;br /&gt;
O bot é capaz de identificar amigo de inimigo.&lt;br /&gt;
&lt;br /&gt;
'''Map Navigation:'''&lt;br /&gt;
Quando o bot é colocado em um mapa que tem caminhos adequadamente marcados (veja abaixo como fazer isso), o bot navegará no mapa, procurando inimigos. Sem caminhos, um robô pode pensar ainda por si mesmo, mas não se movimentará como proficientemente.&lt;br /&gt;
&lt;br /&gt;
'''Aggressiveness:'''&lt;br /&gt;
Bots atacará qualquer ped, jogador ou bot que não esteja em seu time.&lt;br /&gt;
&lt;br /&gt;
'''Cooperation:'''&lt;br /&gt;
Bots can automatically team up with teammates (either player or bot) by meeting up with them and sticking together&lt;br /&gt;
&lt;br /&gt;
'''Advanced movement:'''&lt;br /&gt;
If there's obstacles blocking a bots path, the bot will attempt to get around or over it instead of just walking into a wall for eternity&lt;br /&gt;
&lt;br /&gt;
'''Multiple modes of playing:'''&lt;br /&gt;
*&amp;quot;hunting&amp;quot; - travel pathways until finding an enemy or teammate&lt;br /&gt;
*&amp;quot;waiting&amp;quot; - stand still until an enemy of teammate comes into view&lt;br /&gt;
*&amp;quot;guarding&amp;quot; - the bot will attack any enemy that comes within sight, but not move from its spawn position&lt;br /&gt;
*&amp;quot;following&amp;quot; - the bot will follow a player or bot while attacking enemies&lt;br /&gt;
*&amp;quot;chasing&amp;quot; - the bot will attack an enemy bot or player&lt;br /&gt;
&lt;br /&gt;
'''Gamemode/Script integration:'''&lt;br /&gt;
This script provides several functions and events to allow other resources to see and control what the bot's are doing, and even take control of certain behavior.&lt;br /&gt;
&lt;br /&gt;
'''EDF for map path creation:'''&lt;br /&gt;
Integrated into the map editor, map designers can easily place paths for bots to follow along in their maps. this greatly increased the bots ability to simulate true playing.&lt;br /&gt;
&lt;br /&gt;
=Server Events=&lt;br /&gt;
&lt;br /&gt;
==onBotFindEnemy==&lt;br /&gt;
This triggers when a bot locates an enemy, This event can be cancelled to prevent the bot from chasing players&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element enemy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''enemy''': The Player or Ped the bot has spotted&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that has found an enemy&lt;br /&gt;
&lt;br /&gt;
==onBotWasted==&lt;br /&gt;
This triggers when a bot is killed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element attacker, float weapon, float bodypart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''attacker''': The Element that killed the bot&lt;br /&gt;
*'''weapon''': The weapon id used to kill the bot&lt;br /&gt;
*'''bodypart''': The bodypart id that was hit to kill the bot&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that died&lt;br /&gt;
&lt;br /&gt;
==onBotSpawned==&lt;br /&gt;
This triggers when a bot is spawned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that spawned&lt;br /&gt;
&lt;br /&gt;
==onBotFollow==&lt;br /&gt;
This triggers when a bot starts following a teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element leader&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''leader''': The Player or Ped the bot has started following&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that starts following a teammate&lt;br /&gt;
&lt;br /&gt;
=Server Functions=&lt;br /&gt;
All of these functions will have to be used through the [[call]] function, otherwise they won't work&lt;br /&gt;
&lt;br /&gt;
==spawnBot==&lt;br /&gt;
This function spawns a bot ingame, will return the bot element, or false if there was a problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil, int weapon = 0, string theMode = &amp;quot;hunting&amp;quot;, element theModesubject = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''x:''' The x co-ordinate to spawn the bot at&lt;br /&gt;
*'''y:''' The y co-ordinate to spawn the bot at&lt;br /&gt;
*'''z:''' The z co-ordinate to spawn the bot at&lt;br /&gt;
*'''rotation:''' Rotation of the bot on spawn&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''skinID:''' Bots skin on spawn&lt;br /&gt;
*'''interior:''' Interior the bot will spawn into&lt;br /&gt;
*'''dimension:''' The ID of the [[dimension]] that the bot should be in&lt;br /&gt;
*'''theTeam:''' The team the bot will join&lt;br /&gt;
*'''weapon:''' The weapon the ped will carry&lt;br /&gt;
*'''theMode:''' The action the bot will be performing when spawned (see &amp;quot;modes of playing&amp;quot; above)&lt;br /&gt;
*'''theModeSubject:''' If theMode is &amp;quot;chasing&amp;quot; or &amp;quot;following&amp;quot; this arg is needed to tell the bot what opponent to chase or teammate to follow&lt;br /&gt;
&lt;br /&gt;
==setBotHunt==&lt;br /&gt;
makes the bot travel pathways until finding an enemy or teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotHunt ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to hunt&lt;br /&gt;
&lt;br /&gt;
==setBotWait==&lt;br /&gt;
makes the bot stand still until an enemy of teammate comes into view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWait ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to wait&lt;br /&gt;
&lt;br /&gt;
==setBotChase==&lt;br /&gt;
makes the bot attack an anemy bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotChase ( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the chasing&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be chased&lt;br /&gt;
&lt;br /&gt;
==setBotFollow==&lt;br /&gt;
makes the bot follow a teammate bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotFollow( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the following&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be followed&lt;br /&gt;
&lt;br /&gt;
==setBotGuard==&lt;br /&gt;
makes the bot move to the specific coords and stay there while attacking any enemies&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotGuard( element theBot, float x, float y, float z, [ bool priority = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to do the guarding&lt;br /&gt;
*'''x:''' The X coords you want the bot to guard&lt;br /&gt;
*'''y:''' The Y coords you want the bot to guard&lt;br /&gt;
*'''z:''' The Z coords you want the bot to guard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''priority:''' Set to true only if you want the bot to only shoot once it has reached the location to guard&lt;br /&gt;
&lt;br /&gt;
==getBotTeam==&lt;br /&gt;
returns the Team the bot is on, false if no team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotTeam ( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the team of&lt;br /&gt;
&lt;br /&gt;
==setBotTeam==&lt;br /&gt;
changes the bot's team and loyalties&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotTeam ( element theBot, team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to change the team of&lt;br /&gt;
*'''theTeam:''' The team the bot should join&lt;br /&gt;
&lt;br /&gt;
==getBotAttackEnabled==&lt;br /&gt;
returns true if the bot is allowed to attack, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getBotAttackEnabled( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check if it can attack&lt;br /&gt;
&lt;br /&gt;
==setBotAttackEnabled==&lt;br /&gt;
allow or disallow the bot to attack (press fire)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotAttackEnabled( element theBot, bool enabled)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set if it can attack&lt;br /&gt;
*'''enabled:''' set to false to remove the bots ability to attack, true to allow it&lt;br /&gt;
&lt;br /&gt;
==getBotMode==&lt;br /&gt;
returns the mode the bot is in (&amp;quot;chasing&amp;quot;, &amp;quot;waiting&amp;quot;, &amp;quot;guarding&amp;quot;, &amp;quot;hunting&amp;quot;, &amp;quot;following&amp;quot;) or if the bot is chasing or following, it will return the mode and the target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotMode( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the status of&lt;br /&gt;
&lt;br /&gt;
==isPedBot==&lt;br /&gt;
returns true if the ped is a bot, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPedbot( element thePed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''thePed:''' The ped you want to check if its a bot&lt;br /&gt;
&lt;br /&gt;
==setBotWeapon==&lt;br /&gt;
sets the bots weapon id (ammo is always infinite)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWeapon( element theBot, float weapon)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set the weapon of&lt;br /&gt;
*'''weapon:''' the weapon id you want to give the bot&lt;br /&gt;
&lt;br /&gt;
=Credits=&lt;br /&gt;
*'''Slothman:''' Bot creator, main scripter&lt;br /&gt;
*'''Gamesnert:''' EDF creator, scripting, testing&lt;br /&gt;
*'''Dragon:''' Gamemode creator, testing, scripting help&lt;br /&gt;
*'''EvGeniz:''' early testing, mapping&lt;br /&gt;
'''Thanks to Everyone else who made suggestions, tested the script, helped when i was stuck, etc'''&lt;br /&gt;
[[Category:Resource]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Slothbot]]&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlayVideo&amp;diff=62358</id>
		<title>PlayVideo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlayVideo&amp;diff=62358"/>
		<updated>2019-03-18T02:25:12Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /*  tradução de idiomas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
This function allows you to create a videoplayer on the screen. This function is to be used client-side.&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool playVideo (float posX, float posY, float width, float height, string url, int duration [, bool canClose, bool postGUI])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''posX:''' The absolute X coordinate of the top left corner of the video&lt;br /&gt;
*'''posY:''' The absolute Y coordinate of the top left corner of the video&lt;br /&gt;
*'''width:''' The absolute width of the video&lt;br /&gt;
*'''height:''' The absolute height of the video&lt;br /&gt;
*'''url:''' The video link. This must be an youtube embed link. You can use the following codes in it:&lt;br /&gt;
**'''/embed/''' Use this on place of '''watch?v=''' normal url. This is a required code.&lt;br /&gt;
**'''(videoID)''' The video ID. This is a required code.&lt;br /&gt;
**'''autoplay=1''' This will auto play the video, otherwise the player will only see the video thumbnail. This is a required code.&lt;br /&gt;
**'''controls=0''' Hide the youtube's video controls and video progress bar. This and the following codes are all optional.&lt;br /&gt;
**'''disablekb=1''' Disable keyboard video controls.&lt;br /&gt;
**'''rel=0''' Disable related videos from other channels after the reproduction. It will show only videos from the embed video's channel.&lt;br /&gt;
**'''start=67''' This will start the video on the time 1:07 instead of 0:00 by default. You can use any integer number here.&lt;br /&gt;
**'''end=72''' This will stop the video on the time 1:12 instead of their end by default. You can use any integer number here.&lt;br /&gt;
**'''cc_load_policy=1''' This will enable closed captions on the video if it have one.&lt;br /&gt;
**'''list=(playlist ID)''' If you will reproduce a playlist, you use this after the video ID.&lt;br /&gt;
***'''index=1''' Only aplicable if you will reproduce a playlist. This will start the playlist on the second video. If you want to start on the third video, use 2 instead of 1 and so on. You can use any integer number here.&lt;br /&gt;
**'''color=white''' this will make the video progress bar white instead of red. There are not other colors. Only aplicable if you don't use '''controls=0''' code.&lt;br /&gt;
There are many other codes but they are not recommended here or simply doesn't work on MTA's browser.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''duration:''' The number of milliseconds the browser will be visible before being auto disabled. If not set, the video will be on screen until the player close it using the next parameter.&lt;br /&gt;
*'''canClose:''' A bool representing whether the player can close the video during the reproduction. The player can click it to close the video. This button will not show if the next parameter is true.&lt;br /&gt;
*'''postGUI:''' A bool representing whether the video should be drawn on top of or behind any ingame GUI.&lt;br /&gt;
{{Tip|You can Use [[setPlayerHudComponentVisible]] to hide your HUD and radar while playing the video.}}&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playVideo (posX, posY, width, height, url, duration, canClose, postGUI)&lt;br /&gt;
	if not posX or not posY or not width or not height or not url then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	local webBrowser = false&lt;br /&gt;
	closeButton = guiCreateButton (0.97, 0, 0.03, 0.03, &amp;quot;X&amp;quot;, true)&lt;br /&gt;
	guiSetAlpha (closeButton, 0.5)&lt;br /&gt;
	guiSetVisible (closeButton, false)&lt;br /&gt;
	if not isElement (webBrowser) then&lt;br /&gt;
		webBrowser = createBrowser (width, height, false, false)&lt;br /&gt;
		function createVideoPlayer ()&lt;br /&gt;
			function webBrowserRender ()&lt;br /&gt;
				dxDrawImage (posX, posY, width, height, webBrowser, 0, 0, 0, tocolor(255,255,255,255), postGUI)&lt;br /&gt;
			end&lt;br /&gt;
			loadBrowserURL (webBrowser, url)&lt;br /&gt;
			&lt;br /&gt;
			setTimer (function()&lt;br /&gt;
				addEventHandler (&amp;quot;onClientRender&amp;quot;, getRootElement(), webBrowserRender)&lt;br /&gt;
				showChat (false)&lt;br /&gt;
				if canClose then&lt;br /&gt;
					guiSetVisible (closeButton, true)&lt;br /&gt;
					showCursor (true)&lt;br /&gt;
				end&lt;br /&gt;
			end, 500, 1)&lt;br /&gt;
			setElementFrozen (localPlayer, true)&lt;br /&gt;
			if duration then&lt;br /&gt;
				videoTimer = setTimer (function()&lt;br /&gt;
					removeEventHandler (&amp;quot;onClientRender&amp;quot;, getRootElement(), webBrowserRender)&lt;br /&gt;
					setElementFrozen (localPlayer, false)&lt;br /&gt;
					guiSetVisible (closeButton, false)&lt;br /&gt;
					showCursor (false)&lt;br /&gt;
					showChat (true)&lt;br /&gt;
					destroyElement (webBrowser)&lt;br /&gt;
				end, duration, 1)&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			addEventHandler (&amp;quot;onClientGUIClick&amp;quot;, closeButton, function (button, state)&lt;br /&gt;
				if button == &amp;quot;left&amp;quot; then&lt;br /&gt;
					if isTimer (videoTimer) then&lt;br /&gt;
						killTimer (videoTimer)&lt;br /&gt;
						videoTimer = nil&lt;br /&gt;
						removeEventHandler (&amp;quot;onClientRender&amp;quot;, getRootElement(), webBrowserRender)&lt;br /&gt;
						setElementFrozen (localPlayer, false)&lt;br /&gt;
						guiSetVisible (closeButton, false)&lt;br /&gt;
						showCursor (false)&lt;br /&gt;
						showChat (true)&lt;br /&gt;
						destroyElement (webBrowser)&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end, false)&lt;br /&gt;
		end&lt;br /&gt;
		setTimer (createVideoPlayer, 500, 1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&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;
This example plays a video in fullscreen when the player uses the '''/intro''' command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x, y = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
function defaultFunction ()&lt;br /&gt;
	playVideo (0, 0, x, y, &amp;quot;https://www.youtube.com/embed/rRjY8SOZ9Uo?autoplay=1&amp;amp;showinfo=0&amp;amp;rel=0&amp;amp;controls=0&amp;amp;disablekb=1&amp;quot;, 12500, true, false)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler (&amp;quot;intro&amp;quot;, defaultFunction)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
Author: LordHenry&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsValueInTable&amp;diff=62357</id>
		<title>IsValueInTable</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsValueInTable&amp;diff=62357"/>
		<updated>2019-03-18T02:19:49Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* Traduzindo palavras do inglês para o português*/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isValueInTable ( table theTable, value, int columnID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''theTable''': the [[table]] to check if value exist.&lt;br /&gt;
* '''value''': o valor a verificar.&lt;br /&gt;
* '''columnID''': O número da coluna dentro do [[table]].&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a boolean value, true if the value exists in the table, false if the value does not exist in the table and ID of row to value in table.&lt;br /&gt;
&lt;br /&gt;
==Código==&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 isValueInTable(theTable,value,columnID)&lt;br /&gt;
    assert(theTable, &amp;quot;Bad argument 1 @ isValueInTable (table expected, got &amp;quot; .. type(theTable) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    local checkIsTable = type(theTable)&lt;br /&gt;
    assert(checkIsTable == &amp;quot;table&amp;quot;, &amp;quot;Invalid value type @ isValueInTable (table expected, got &amp;quot; .. checkIsTable .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    assert(value, &amp;quot;Bad argument 2 @ isValueInTable (value expected, got &amp;quot; .. type(value) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    assert(columnID, &amp;quot;Bad argument 3 @ isValueInTable (number expected, got &amp;quot; .. type(columnID) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    local checkIsID = type(columnID)&lt;br /&gt;
    assert(checkIsID == &amp;quot;number&amp;quot;, &amp;quot;Invalid value type @ isValueInTable (number expected, got &amp;quot; ..checkIsID .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    for i,v in ipairs (theTable) do&lt;br /&gt;
        if v[columnID] == value then&lt;br /&gt;
            return true,i&lt;br /&gt;
        end&lt;br /&gt;
    end&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;
==Exemplo==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Este exemplo verifica se a palavra escrita não existe na tabela e a adiciona à tabela, caso contrário, um aviso será emitido.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local greetingTable = {&lt;br /&gt;
{&amp;quot;Hi&amp;quot;},&lt;br /&gt;
{&amp;quot;Aloha&amp;quot;},&lt;br /&gt;
{&amp;quot;Hello&amp;quot;},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function greetingCheck(CMD,value)&lt;br /&gt;
local value = value or nil&lt;br /&gt;
local checker,id = isValueInTable(greetingTable,value,1)&lt;br /&gt;
    if not checker then&lt;br /&gt;
        table.insert(greetingTable,{value})&lt;br /&gt;
        outputChatBox('('..value..')['..#greetingTable..'] added to table.')&lt;br /&gt;
    else&lt;br /&gt;
    outputChatBox('('..value..')['..id..'] already exist in the table.')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler('addgreeting',greetingCheck)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
'''Author: Motar2k~'''&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsValueInTable&amp;diff=62356</id>
		<title>IsValueInTable</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsValueInTable&amp;diff=62356"/>
		<updated>2019-03-18T02:15:02Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* Traduzindo palavras */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isValueInTable ( table theTable, value, int columnID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''theTable''': the [[table]] to check if value exist.&lt;br /&gt;
* '''value''': o valor a verificar.&lt;br /&gt;
* '''columnID''': O número da coluna dentro do [[table]].&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a boolean value, true if the value exists in the table, false if the value does not exist in the table and ID of row to value in table.&lt;br /&gt;
&lt;br /&gt;
==Code==&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 isValueInTable(theTable,value,columnID)&lt;br /&gt;
    assert(theTable, &amp;quot;Bad argument 1 @ isValueInTable (table expected, got &amp;quot; .. type(theTable) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    local checkIsTable = type(theTable)&lt;br /&gt;
    assert(checkIsTable == &amp;quot;table&amp;quot;, &amp;quot;Invalid value type @ isValueInTable (table expected, got &amp;quot; .. checkIsTable .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    assert(value, &amp;quot;Bad argument 2 @ isValueInTable (value expected, got &amp;quot; .. type(value) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    assert(columnID, &amp;quot;Bad argument 3 @ isValueInTable (number expected, got &amp;quot; .. type(columnID) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    local checkIsID = type(columnID)&lt;br /&gt;
    assert(checkIsID == &amp;quot;number&amp;quot;, &amp;quot;Invalid value type @ isValueInTable (number expected, got &amp;quot; ..checkIsID .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    for i,v in ipairs (theTable) do&lt;br /&gt;
        if v[columnID] == value then&lt;br /&gt;
            return true,i&lt;br /&gt;
        end&lt;br /&gt;
    end&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;
==Exemplo==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Este exemplo verifica se a palavra escrita não existe na tabela e a adiciona à tabela, caso contrário, um aviso será emitido.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local greetingTable = {&lt;br /&gt;
{&amp;quot;Hi&amp;quot;},&lt;br /&gt;
{&amp;quot;Aloha&amp;quot;},&lt;br /&gt;
{&amp;quot;Hello&amp;quot;},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function greetingCheck(CMD,value)&lt;br /&gt;
local value = value or nil&lt;br /&gt;
local checker,id = isValueInTable(greetingTable,value,1)&lt;br /&gt;
    if not checker then&lt;br /&gt;
        table.insert(greetingTable,{value})&lt;br /&gt;
        outputChatBox('('..value..')['..#greetingTable..'] added to table.')&lt;br /&gt;
    else&lt;br /&gt;
    outputChatBox('('..value..')['..id..'] already exist in the table.')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler('addgreeting',greetingCheck)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
'''Author: Motar2k~'''&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsValueInTable&amp;diff=62355</id>
		<title>IsValueInTable</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsValueInTable&amp;diff=62355"/>
		<updated>2019-03-18T02:13:59Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isValueInTable ( table theTable, value, int columnID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''theTable''': the [[table]] to check if value exist.&lt;br /&gt;
* '''value''': o valor a verificar.&lt;br /&gt;
* '''columnID''': O número da coluna dentro do [[table]].&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a boolean value, true if the value exists in the table, false if the value does not exist in the table and ID of row to value in table.&lt;br /&gt;
&lt;br /&gt;
==Code==&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 isValueInTable(theTable,value,columnID)&lt;br /&gt;
    assert(theTable, &amp;quot;Bad argument 1 @ isValueInTable (table expected, got &amp;quot; .. type(theTable) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    local checkIsTable = type(theTable)&lt;br /&gt;
    assert(checkIsTable == &amp;quot;table&amp;quot;, &amp;quot;Invalid value type @ isValueInTable (table expected, got &amp;quot; .. checkIsTable .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    assert(value, &amp;quot;Bad argument 2 @ isValueInTable (value expected, got &amp;quot; .. type(value) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    assert(columnID, &amp;quot;Bad argument 3 @ isValueInTable (number expected, got &amp;quot; .. type(columnID) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    local checkIsID = type(columnID)&lt;br /&gt;
    assert(checkIsID == &amp;quot;number&amp;quot;, &amp;quot;Invalid value type @ isValueInTable (number expected, got &amp;quot; ..checkIsID .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    for i,v in ipairs (theTable) do&lt;br /&gt;
        if v[columnID] == value then&lt;br /&gt;
            return true,i&lt;br /&gt;
        end&lt;br /&gt;
    end&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;
==Exemplo==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example verifies if the written word does not exist within the table and then adds it to the table, otherwise a warning will be issued.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local greetingTable = {&lt;br /&gt;
{&amp;quot;Hi&amp;quot;},&lt;br /&gt;
{&amp;quot;Aloha&amp;quot;},&lt;br /&gt;
{&amp;quot;Hello&amp;quot;},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function greetingCheck(CMD,value)&lt;br /&gt;
local value = value or nil&lt;br /&gt;
local checker,id = isValueInTable(greetingTable,value,1)&lt;br /&gt;
    if not checker then&lt;br /&gt;
        table.insert(greetingTable,{value})&lt;br /&gt;
        outputChatBox('('..value..')['..#greetingTable..'] added to table.')&lt;br /&gt;
    else&lt;br /&gt;
    outputChatBox('('..value..')['..id..'] already exist in the table.')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler('addgreeting',greetingCheck)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
'''Author: Motar2k~'''&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsValueInTable&amp;diff=62354</id>
		<title>IsValueInTable</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsValueInTable&amp;diff=62354"/>
		<updated>2019-03-18T02:13:13Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isValueInTable ( table theTable, value, int columnID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''theTable''': the [[table]] to check if value exist.&lt;br /&gt;
* '''value''': o valor a verificar.&lt;br /&gt;
* '''columnID''': O número da coluna dentro do [[table]].&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a boolean value, true if the value exists in the table, false if the value does not exist in the table and ID of row to value in table.&lt;br /&gt;
&lt;br /&gt;
==Code==&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 isValueInTable(theTable,value,columnID)&lt;br /&gt;
    assert(theTable, &amp;quot;Bad argument 1 @ isValueInTable (table expected, got &amp;quot; .. type(theTable) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    local checkIsTable = type(theTable)&lt;br /&gt;
    assert(checkIsTable == &amp;quot;table&amp;quot;, &amp;quot;Invalid value type @ isValueInTable (table expected, got &amp;quot; .. checkIsTable .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    assert(value, &amp;quot;Bad argument 2 @ isValueInTable (value expected, got &amp;quot; .. type(value) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    assert(columnID, &amp;quot;Bad argument 3 @ isValueInTable (number expected, got &amp;quot; .. type(columnID) .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    local checkIsID = type(columnID)&lt;br /&gt;
    assert(checkIsID == &amp;quot;number&amp;quot;, &amp;quot;Invalid value type @ isValueInTable (number expected, got &amp;quot; ..checkIsID .. &amp;quot;)&amp;quot;)&lt;br /&gt;
    for i,v in ipairs (theTable) do&lt;br /&gt;
        if v[columnID] == value then&lt;br /&gt;
            return true,i&lt;br /&gt;
        end&lt;br /&gt;
    end&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;Clientside example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example verifies if the written word does not exist within the table and then adds it to the table, otherwise a warning will be issued.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local greetingTable = {&lt;br /&gt;
{&amp;quot;Hi&amp;quot;},&lt;br /&gt;
{&amp;quot;Aloha&amp;quot;},&lt;br /&gt;
{&amp;quot;Hello&amp;quot;},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function greetingCheck(CMD,value)&lt;br /&gt;
local value = value or nil&lt;br /&gt;
local checker,id = isValueInTable(greetingTable,value,1)&lt;br /&gt;
    if not checker then&lt;br /&gt;
        table.insert(greetingTable,{value})&lt;br /&gt;
        outputChatBox('('..value..')['..#greetingTable..'] added to table.')&lt;br /&gt;
    else&lt;br /&gt;
    outputChatBox('('..value..')['..id..'] already exist in the table.')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler('addgreeting',greetingCheck)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
'''Author: Motar2k~'''&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=62353</id>
		<title>Template:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=62353"/>
		<updated>2019-03-18T02:11:34Z</updated>

		<summary type="html">&lt;p&gt;Jefte: /* Traduzindo para português Brasil */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=== Table functions ===&lt;br /&gt;
*[[isValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Esta função retorna true se o valor existir na tabela, false se o valor não existir na tabela.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableToSql]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to save the table in the database (sql).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTableFromSql]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This functionality is used to obtain saved tables using the function ([https://wiki.multitheftauto.com/wiki/SetTableToSql SetTableToSql ]).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[rangeToTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a string range to a table containing number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Sort_Functions]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» These functions are able to sort your tables by a key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether two given tables are equal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a table is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.merge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function merges two or more tables together.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.removeValue]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function removes a specified value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.getRandomRows]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns random rows from table.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ACL functions ===&lt;br /&gt;
*[[aclGroupClone]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function clone a group to another group with/without ACLs and/or objects.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerAcls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all ACL groups on a player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player element is in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is server admin or staff.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[renameAclGroup]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gives an existing ACL group a new name.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Account functions ===&lt;br /&gt;
*[[removeAccountData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to remove data from an account.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromAccountName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to obtain a player by the name of his account.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Camera functions ===&lt;br /&gt;
*[[smoothMoveCamera]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to create a cinematic camera flight.&lt;br /&gt;
&lt;br /&gt;
=== Cursor functions ===&lt;br /&gt;
*[[getCursorMovedOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Drawing functions ===&lt;br /&gt;
*[[dxDrawAnimWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws an animated 2D window on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawBorderedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a bordered rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawBorderedText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a bordered text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawDashedLine]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a line with dashes.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRing]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a ring with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Esta funcion crea un rectangle con un texto dentro.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites in 2D.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImageOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws an image on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawLinedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a rectangle outline with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawLoading]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a loading bar on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawOctagon3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function creates a 3D Octagon&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a custom polygon on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawProgressBar]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates a progress bar drawed using DirectDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a text on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTriangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a triangle with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the font size from given height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetRealFontHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wordWrap]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function breaks a long string into a table of separate lines limited to a specific length in pixels, for drawing separately.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Effects functions ===&lt;br /&gt;
*[[attachEffect]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you attach an effect to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Elements functions === &lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the specified element's speed in m/s, km/h or mph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are in the specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsWithinMarker]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are within a marker's collision shape.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is in the player's camera picture area.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check if an element's range to a main point is within the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementMoving]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is within a collision shape element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set the speed of an element in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicle's weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Input functions ===&lt;br /&gt;
*[[bindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to bind each key bound to a control individually. Doing this bypasses a little MTA restriction.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBoundControls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of control names that are bound to the specified key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[unbindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to unbind each key bound to a control individually. Use this function with [[bindControlKeys]].&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getClipboard]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This event returns the contents of the clipboard by pressing ctrl + v / ctrl + V. Event triggered ONLY if cursor is showing.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Data functions === &lt;br /&gt;
*[[byte2human]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts an integer (number of bytes) into a human-readable unit.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[capitalize]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function capitalizes a given string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts and formats large numbers.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertServerTickToTimeStamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts server ticks to a unix timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertTextToSpeech]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts the provided text to a speech in the provided language which players can hear.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes two points and returns the direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes two sets of XYZ coordinates. It returns the 3D direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[FormatDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function generates a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateRandomASCIIString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a random string which uses ASCII characters. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a given birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getEasterDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns easter date monthday and month for a given year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getKeyFromValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the key of the specified value in a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRealMonthH]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function convert english months to arabic months&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRealMonthM]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gives you the real months name&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRGColorFromPercentage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia', sans-serif; font-size:smaller;&amp;quot;&amp;gt;»This function returns two integers representing red and green colors according to the specified percentage.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenRotationFromWorldPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a screen relative rotation to a world position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the UNIX timestamp of a specified date and time.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a boolean representing if a given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isValidMail]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a provided e-mail string is valid.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[removeHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to remove hexadecimal numbers (colors, for example) from strings.&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[secondsToTimeDesc]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a plain seconds-integer into a user-friendly time description.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts the amount of occurences of a string in a string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows the value of a variable or expression to control the flow of program execution via a multiway branch.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used client-side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wavelengthToRGBA]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a physical wavelength of light to a RGBA color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Esta funcion sirve para obtener la distancia entre dos elementos.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLowerOrUpper]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;»This function checks whether the letter is large or small.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GUI functions === &lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function centers a CEGUI window element responsively in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiMoveElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function moves guiElement by/like using moveObject.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseOnGUICloseButton]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether the mouse cursor/pointer is within a gui-window's native close button.&amp;lt;/span&amp;gt;&lt;br /&gt;
=====Comboboxes=====&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function adjusts a CEGUI combobox element to have the correct height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiComboBoxAddPlayersName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is add players name in combobox .&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Gridlists=====&lt;br /&gt;
*[[guiGridListAddPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function add all online players to a grid list.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListGetColumnIDFromTitle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a gridlist's column ID from the column title.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListGetSelectedText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string containing the inner text of a selected gridlist item.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGridListRowIndexFromText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the GridList row index from the specified text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isTextInGridList]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if some text exist or not in the GridList.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertGridListToText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts grid list contents to text.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Labels=====&lt;br /&gt;
*[[guiLabelAddEffect]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function add a effects to the gui-label like (shadow, outline).&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Marker functions ===&lt;br /&gt;
*[[createMarkerAttachedTo]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function creates a marker that is attached to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Math functions ===&lt;br /&gt;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is a workaround for the client-side floating-point precision of 24-bits.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.hypot]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the Hypotenuse of the triangle given by sides x and y.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.percent]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a percentage from two number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[reMap]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Re-maps a number from one range to another.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.isPointInPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Check if point is inside polygon or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.polygonArea]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Compute area of any polygon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.randomDiff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Generates a pseudo-random integer that's always different from the last random number generated.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Map functions ===&lt;br /&gt;
*[[assignLod]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function lets you conveniently generate and apply a LOD model to a mapping object&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ped functions ===&lt;br /&gt;
*[[getAlivePlayers (Client)|getAlivePlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players client-side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInVehicles]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the players insides vehicles from a specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGuestPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a players not login or players Guest .&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all logged-in administrators.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedEyesPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get peds eyes position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxHealth]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a pedestrians's maximum health by converting it from their maximum health stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxOxygenLevel]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a ped's maximum oxygen level by converting it from their maximum underwater stamina stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from partial name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromSerial]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from their serial.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersByData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of players that have the specified data name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInGroup]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all Players In Group .&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all players in photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a pedestrian is aiming their weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAimingNearPed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is similar to isPedAiming but uses a colshape to be more precise.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedDrivingVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified pedestrian is driving a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is in a specified team.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Player functions ===&lt;br /&gt;
*[[countPlayersInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the number of players that are within a certain range of the specified coordinates.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource functions ===&lt;br /&gt;
*[[getResourceScripts]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource scripts.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[refreshResource]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function refreshes your resource if you changed any of the files&lt;br /&gt;
&lt;br /&gt;
=== Sound functions ===&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a sound element has finished.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[stopSoundSlowly]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function stop your sound element slowly.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser functions ===&lt;br /&gt;
*[[playVideo]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function plays a video on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Team functions ===&lt;br /&gt;
*[[getTeamFromColor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element by the specified color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTeamWithFewestPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element with least players of all the specified teams.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vehicle functions === &lt;br /&gt;
*[[getNearestVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets the nearest vehicle to the specified player in a specified distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRandomVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a random vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getValidVehicleModels]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all valid vehicle models.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehiclesCountByType]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the amount of vehicles by the given type as an integer value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a vehicle is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOccupied]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified vehicle is occupied.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleReversing]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified vehicle is moving backwards.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehicleTurnVelocityCenterOfMass]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a vehicle's turn velocity relative to the vehicle's center or mass.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleTurnVelocityCenterOfMass]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's turn velocity relative to the vehicle's center or mass.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Weapon functions === &lt;br /&gt;
*[[getJetpackWeaponsEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of enabled weapons usable on a jetpack.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPreviousAndNextWeapon]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the next weapon and previous.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XML functions ===&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all children of a XML node.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Utility ===&lt;br /&gt;
*[[animate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to use interpolateBetween without render event and easily used.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any client-side function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if its arguments are of the right type and calls the error-function if one is not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function applies a fix for hidden coroutine error messages.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanFromName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This functions returns the ban of the given playername.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCurrentFPS]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the frames per second at which GTA: SA is running.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isCursorOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether the cursor is in a particular area.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a cursor position is in circular area or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether the mouse cursor/pointer is within a rectangular position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns ''a time-saving'' iterator for your for-loops.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[thisCommandHandlersExist]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This method checks a string if this exist as command Handlers&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[vector3:compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This method checks whether two vectors match, with optional precision.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[preprocessor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allow you to use gcc macros.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Useful Functions]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jefte</name></author>
	</entry>
</feed>