<?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=Lcaseidefensis</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=Lcaseidefensis"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Lcaseidefensis"/>
	<updated>2026-04-24T10:45:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HeroInventory&amp;diff=35308</id>
		<title>HeroInventory</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HeroInventory&amp;diff=35308"/>
		<updated>2013-04-07T21:33:46Z</updated>

		<summary type="html">&lt;p&gt;Lcaseidefensis: added reference to HeroBook&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Description==&lt;br /&gt;
HeroInventory is a new way to expand a roleplay server's features. This resource allows a server to not only archive items; but organize them appropriately! Adding items, and groups are very simple.&lt;br /&gt;
&lt;br /&gt;
community page link[http://community.mtasa.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=6310]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
You're able to add items by editing g_items.lua.&lt;br /&gt;
An example use of the resource:HeroBook[https://wiki.multitheftauto.com/wiki/HeroBook#Integrate_Into_HeroInventory](from Malicious Hero)&lt;br /&gt;
&lt;br /&gt;
==Callbacks==&lt;br /&gt;
===onPlayerUseItem===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool onPlayerUseItem( int itemID, int itemAmount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* source = player using the item&lt;br /&gt;
&lt;br /&gt;
The callback is found in e_item_use.lua in the folder &amp;quot;events&amp;quot;. Examples are shown.&lt;br /&gt;
&lt;br /&gt;
===onPlayerPickupItem===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool onPlayerPickupItem( element playerElement, int itemID, string itemDroppedBy )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The callback is found in e_item_pickup.lua in the folder &amp;quot;events&amp;quot;. Examples are shown.&lt;br /&gt;
==Player Functions==&lt;br /&gt;
===addPlayerItem===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addPlayerItem ( element playerElement, int itemID, int amount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
        addPlayerItem&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The element you wish to add an item to.&lt;br /&gt;
	itemID - The item ID; This can be found in g_items.lua.&lt;br /&gt;
	amount - The amount of the item you want.&lt;br /&gt;
@description&lt;br /&gt;
	This will add an item to a client.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===refreshClientGroups===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool refreshClientGroups( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	refreshClientGroups&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
		&lt;br /&gt;
@description&lt;br /&gt;
	This is not really a function used when exporting; but it's important this command remains&lt;br /&gt;
	in this resource because without this, groups would not be sync properly.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===removeItemFromPlayer===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool removeItemFromPlayer( element playerElement, int itemID, [ int amount ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	removeItemFromPlayer&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The player.&lt;br /&gt;
	itemID - The item ID&lt;br /&gt;
	amount - The amount you wish to remove. You can leave this blank to remove everything.&lt;br /&gt;
@description&lt;br /&gt;
	Use this function to remove an item from a player.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===transferPlayerItem===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool transferPlayerItem( element playerElement, element targetElement, int itemID, int amount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	transferPlayerItem&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The player.&lt;br /&gt;
	targetElement - The target.&lt;br /&gt;
	itemID - The item ID&lt;br /&gt;
	amount - The amount you wish to remove. You can leave this blank to remove everything.&lt;br /&gt;
@description&lt;br /&gt;
	Use this function to move one item to another player.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===doesPlayerHaveItem===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool doesPlayerHaveItem( element playerElement, int itemID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	doesPlayerHaveItem&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The player.&lt;br /&gt;
	itemID - The item ID&lt;br /&gt;
@description&lt;br /&gt;
	Use this function to move one item to another player.&lt;br /&gt;
@returns&lt;br /&gt;
	if returning true, it will return the amount as well.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===getPlayerItemAmount===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getPlayerItemAmount( element playerElement, int itemID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	getPlayerItemAmount&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The player.&lt;br /&gt;
	itemID - The item ID&lt;br /&gt;
@description&lt;br /&gt;
	Use this function to get a player's item amount&lt;br /&gt;
@returns&lt;br /&gt;
	The amount item. If false, they don't have the item&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Group Functions==&lt;br /&gt;
===addInventoryGroup===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addInventoryGroup( string group_name, path imagesrc )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	addInventoryGroup&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	group_name - Indicates the group name that you wish to add.&lt;br /&gt;
	imagesrc - The picture you want to associate with the group.&lt;br /&gt;
@description&lt;br /&gt;
	This will add a inventory group, which will allow the server to create new items.&lt;br /&gt;
	Please keep in mind that in s_inventory_config.lua, you are able to set the maximum amount&lt;br /&gt;
	of groups you allow.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===removeInventoryGroup===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool removeInventoryGroup( string group_name )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	removeInventoryGroup&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	group_name - Indicates the group name that you wish to add.&lt;br /&gt;
@description&lt;br /&gt;
	This will remove an inventory group.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lcaseidefensis</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BindKey&amp;diff=35193</id>
		<title>BindKey</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BindKey&amp;diff=35193"/>
		<updated>2013-03-23T14:13:41Z</updated>

		<summary type="html">&lt;p&gt;Lcaseidefensis: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Binds a player's key to a handler function or command, which will be called when the key is pressed. &lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server - Syntax 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bindKey ( player thePlayer, string key, string keyState, function handlerFunction,  [ var arguments, ... ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' The player you wish to bind the key of.&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys and [[control names]] for a list of possible controls.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
*'''handlerFunction:''' The function that will be triggered when the player's key is pressed. This function should have the form:&lt;br /&gt;
:&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function functionName ( player keyPresser, string key, string keyState, [ var arguments, ... ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
:The values passed to this function are:&lt;br /&gt;
:*'''keyPresser:''' The player who pressed the key&lt;br /&gt;
:*'''key:''' The key that was pressed&lt;br /&gt;
:*'''keyState:''' The state of the key that was pressed, ''down'' if it was pressed, ''up'' if it was released.&lt;br /&gt;
:*'''arguments''' The optional arguments you specified when calling [[bindKey]] (see below).&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server - Syntax 2&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This alternative syntax allows you to bind a key with a command.  This will also allow users to customize the control in their Settings menu.  Use in conjunction with [[addCommandHandler]] to add handler functions to the keybind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bindKey ( player thePlayer, string key, string keyState, string commandName, [ string arguments ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' The player you wish to bind the key of.&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
*'''commandName:''' The name of the command that the key should be binded to.  &lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''arguments''' Space delimited arguments that are entered as if one was typing the command.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client - Syntax 1&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bindKey ( string key, string keyState, function handlerFunction,  [ var arguments, ... ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys and [[control names]] for a list of possible controls.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
&amp;lt;!--*'''bindName:''' The name for this key bind when it appears in the client's settings dialog.--&amp;gt;&lt;br /&gt;
*'''handlerFunction:''' The function that will be triggered when the player's key is pressed. This function should have the form:&lt;br /&gt;
:&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function functionName ( string key, string keyState, [ var arguments, ... ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
:The values passed to this function are:&lt;br /&gt;
:*'''key:''' The key that was pressed&lt;br /&gt;
:*'''keyState:''' The state of the key that was pressed, ''down'' if it was pressed, ''up'' if it was released.&lt;br /&gt;
:*'''arguments''' The optional arguments you specified when calling [[bindKey]] (see below).&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client - Syntax 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This alternative syntax allows you to bind a key with a command.  This will also allow users to customize the control in their Settings menu.  Use in conjunction with [[addCommandHandler]] to add handler functions to the keybind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bindKey ( string key, string keyState, string commandName, [ string arguments ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
*'''commandName:''' The name of the command that the key should be binded to.  &lt;br /&gt;
*'''arguments''' Space delimited arguments that are entered as if one was typing the command.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the function when the key is pressed by the user. Any number of arguments of  can be specified, each being passed to the designated function. You may not pass functions.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Example 1&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will bind a player's 'F1' key and 'fire' control to 1 input function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function funcInput ( player, key, keyState )&lt;br /&gt;
  local state = &amp;quot;let go of&amp;quot;&lt;br /&gt;
  if ( keyState == &amp;quot;down&amp;quot; ) then&lt;br /&gt;
    state = &amp;quot;pressed&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
  outputChatBox ( getPlayerName ( player) .. &amp;quot; &amp;quot; .. state .. &amp;quot; the &amp;quot; .. key .. &amp;quot; key!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bindTheKeys ( player, commandName )&lt;br /&gt;
  bindKey ( player, &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, funcInput )   -- bind the player's F1 down key&lt;br /&gt;
  bindKey ( player, &amp;quot;F1&amp;quot;, &amp;quot;up&amp;quot;, funcInput )     -- bind the player's F1 up key&lt;br /&gt;
  bindKey ( player, &amp;quot;fire&amp;quot;, &amp;quot;both&amp;quot;, funcInput ) -- bind the player's fire down and up control&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;bindme&amp;quot;, bindTheKeys )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example 2&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 will bind a player's 'F1' key and 'fire' control to 1 input function, clientside.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function funcInput ( key, keyState )&lt;br /&gt;
  local state = &amp;quot;let go of&amp;quot;&lt;br /&gt;
  if ( keyState == &amp;quot;down&amp;quot; ) then&lt;br /&gt;
    state = &amp;quot;pressed&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
  outputChatBox ( &amp;quot;You &amp;quot; .. state .. &amp;quot; the &amp;quot; .. key .. &amp;quot; key!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bindTheKeys ()&lt;br /&gt;
  bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, funcInput )   -- bind the player's F1 down key&lt;br /&gt;
  bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;up&amp;quot;, funcInput )     -- bind the player's F1 up key&lt;br /&gt;
  bindKey ( &amp;quot;fire&amp;quot;, &amp;quot;both&amp;quot;, funcInput ) -- bind the player's fire down and up control&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;bindme&amp;quot;, bindTheKeys )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example says how cool &amp;lt;s&amp;gt;Robpol86&amp;lt;/s&amp;gt; Ransom is if players wants to move.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function fanFunction()&lt;br /&gt;
  bindKey (source,&amp;quot;forwards&amp;quot;,&amp;quot;down&amp;quot;,&lt;br /&gt;
    function(player,key,state)&lt;br /&gt;
      outputChatBox (getPlayerName (player) .. &amp;quot;#FFFF00 thinks Ransom is cool.&amp;quot;,getRootElement(),255,255,0,true)&lt;br /&gt;
    end&lt;br /&gt;
  )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler (&amp;quot;onPlayerLogin&amp;quot;,getRootElement(),fanFunction)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Input functions}}&lt;/div&gt;</summary>
		<author><name>Lcaseidefensis</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:OnElementClicked&amp;diff=35012</id>
		<title>Talk:OnElementClicked</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:OnElementClicked&amp;diff=35012"/>
		<updated>2013-02-24T22:52:45Z</updated>

		<summary type="html">&lt;p&gt;Lcaseidefensis: Created page with &amp;quot;I suggest returning element part for vehicles and peds.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I suggest returning element part for vehicles and peds.&lt;/div&gt;</summary>
		<author><name>Lcaseidefensis</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HeroInventory&amp;diff=34615</id>
		<title>HeroInventory</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HeroInventory&amp;diff=34615"/>
		<updated>2013-01-23T23:04:25Z</updated>

		<summary type="html">&lt;p&gt;Lcaseidefensis: link to the resource's community page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Description==&lt;br /&gt;
HeroInventory is a new way to expand a roleplay server's features. This resource allows a server to not only archive items; but organize them appropriately! Adding items, and groups are very simple.&lt;br /&gt;
&lt;br /&gt;
community page link[http://community.mtasa.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=6310]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
You're able to add items by editing g_items.lua.&lt;br /&gt;
&lt;br /&gt;
==Callbacks==&lt;br /&gt;
===onPlayerUseItem===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool onPlayerUseItem( int itemID, int itemAmount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* source = player using the item&lt;br /&gt;
&lt;br /&gt;
The callback is found in s_item_use.lua in the folder &amp;quot;server&amp;quot;. Examples are shown.&lt;br /&gt;
==Player Functions==&lt;br /&gt;
===addPlayerItem===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addPlayerItem ( element playerElement, int itemID, int amount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
        addPlayerItem&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The element you wish to add an item to.&lt;br /&gt;
	itemID - The item ID; This can be found in g_items.lua.&lt;br /&gt;
	amount - The amount of the item you want.&lt;br /&gt;
@description&lt;br /&gt;
	This will add an item to a client.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===refreshClientGroups===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool refreshClientGroups( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	refreshClientGroups&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
		&lt;br /&gt;
@description&lt;br /&gt;
	This is not really a function used when exporting; but it's important this command remains&lt;br /&gt;
	in this resource because without this, groups would not be sync properly.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===removeItemFromPlayer===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool removeItemFromPlayer( element playerElement, int itemID, [ int amount ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	removeItemFromPlayer&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The player.&lt;br /&gt;
	itemID - The item ID&lt;br /&gt;
	amount - The amount you wish to remove. You can leave this blank to remove everything.&lt;br /&gt;
@description&lt;br /&gt;
	Use this function to remove an item from a player.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===transferPlayerItem===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool transferPlayerItem( element playerElement, element targetElement, int itemID, int amount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	transferPlayerItem&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The player.&lt;br /&gt;
	targetElement - The target.&lt;br /&gt;
	itemID - The item ID&lt;br /&gt;
	amount - The amount you wish to remove. You can leave this blank to remove everything.&lt;br /&gt;
@description&lt;br /&gt;
	Use this function to move one item to another player.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===doesPlayerHaveItem===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool doesPlayerHaveItem( element playerElement, int itemID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	doesPlayerHaveItem&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The player.&lt;br /&gt;
	itemID - The item ID&lt;br /&gt;
@description&lt;br /&gt;
	Use this function to move one item to another player.&lt;br /&gt;
@returns&lt;br /&gt;
	if returning true, it will return the amount as well.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===getPlayerItemAmount===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getPlayerItemAmount( element playerElement, int itemID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	getPlayerItemAmount&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	playerElement - The player.&lt;br /&gt;
	itemID - The item ID&lt;br /&gt;
@description&lt;br /&gt;
	Use this function to get a player's item amount&lt;br /&gt;
@returns&lt;br /&gt;
	The amount item. If false, they don't have the item&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Group Functions==&lt;br /&gt;
===addInventoryGroup===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addInventoryGroup( string group_name, path imagesrc )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	addInventoryGroup&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	group_name - Indicates the group name that you wish to add.&lt;br /&gt;
	imagesrc - The picture you want to associate with the group.&lt;br /&gt;
@description&lt;br /&gt;
	This will add a inventory group, which will allow the server to create new items.&lt;br /&gt;
	Please keep in mind that in s_inventory_config.lua, you are able to set the maximum amount&lt;br /&gt;
	of groups you allow.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===removeInventoryGroup===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool removeInventoryGroup( string group_name )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
@title&lt;br /&gt;
	removeInventoryGroup&lt;br /&gt;
@author&lt;br /&gt;
	Malicious Hero.&lt;br /&gt;
@parameters&lt;br /&gt;
	group_name - Indicates the group name that you wish to add.&lt;br /&gt;
@description&lt;br /&gt;
	This will remove an inventory group.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lcaseidefensis</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Requested_Functions_and_Events&amp;diff=31062</id>
		<title>Requested Functions and Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Requested_Functions_and_Events&amp;diff=31062"/>
		<updated>2012-05-21T16:48:42Z</updated>

		<summary type="html">&lt;p&gt;Lcaseidefensis: /* Client-Side */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Server-side==&lt;br /&gt;
&lt;br /&gt;
Element type: GUI, for getElemensByType(&amp;quot;GUI&amp;quot;)&lt;br /&gt;
----------&lt;br /&gt;
Event like onServerTick wich is run very often. Like the clientside onClientRender. This could be useful for constat checking wich must be done under 50ms (lower than timers can handle).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
onVehicleCreated or an equivalent... shouldn't be too hard? -Robhol (14:15 Jul 6, 08)&lt;br /&gt;
:If we did it, it'd be onElementCreated - what do you want this for? [[User:EAi|eAi]] 08:58, 7 July 2008 (CDT)&lt;br /&gt;
::onElementCreated is a good idea - it could be used for lots of things. Also, how about onVehicleDrown or whatever? that is, when a vehicle hits deep water. Checking for collisions and stuff is very awkward, and client-side only, and has to be checked constantly.. -Robhol (17:31 Jul 9 08)&lt;br /&gt;
:::I second that. It would be useful if you use like me element data like the fuel amount or other stuff. And an event like this would help me to setup those element data, when a car spawns. Otherwise I would either have to edit every car spawn script I use or do a post-setup when someone is entering the car.. [[User:MaddDogg14]] (04:34 Apr 4, 10 (CEST))&lt;br /&gt;
::::i definetly agree, onElementCreated would be VERY useful for utility/librares scripts, but i think this should be limited by ACL, because &amp;quot;evil&amp;quot; scripts could abuse this othervise -Karlis (9:10 Apr 5, 10)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I ask for a function that detects if a ped is on floor, eg. '''isPedOnFloor(ped thePed)''', thanks. --&amp;lt;span style=&amp;quot;font-family:Courier New, Courier, monospace&amp;quot;&amp;gt;[[User:Shadd|Shadd]]&amp;lt;/span&amp;gt;&amp;lt;sub&amp;gt;([[User_talk:Shadd|In caso di emergenza rompere le scatole]])&amp;lt;/sub&amp;gt; 11:29, 15 June 2008 (CDT)&lt;br /&gt;
: [[isPedOnGround]]? [[User:Awwu|Awwu]] 12:58, 15 June 2008 (CDT)&lt;br /&gt;
::I need to know if the player has its back touching the ground, not if it's simply &amp;quot;on ground&amp;quot;. --&amp;lt;span style=&amp;quot;font-family:Courier New, Courier, monospace&amp;quot;&amp;gt;[[User:Shadd|Shadd]]&amp;lt;/span&amp;gt;&amp;lt;sub&amp;gt;([[User_talk:Shadd|In caso di emergenza rompere le scatole]])&amp;lt;/sub&amp;gt; 14:16, 16 June 2008 (CDT)&lt;br /&gt;
:::Check what task the player has, they should have TASK_COMPLEX_FALL_AND_GET_UP or TASK_COMPLEX_FALL_AND_STAY_DOWN... [[User:EAi|eAi]] 19:12, 16 June 2008 (CDT)&lt;br /&gt;
::::Thanks. What task does player have after being hitten by a melee attack that cause it to fall down? Would &amp;quot;TASK_SIMPLE_BE_KICKED_ON_GROUND&amp;quot; and &amp;quot;TASK_SIMPLE_GET_UP&amp;quot; work? --&amp;lt;span style=&amp;quot;font-family:Courier New, Courier, monospace&amp;quot;&amp;gt;[[User:Shadd|Shadd]]&amp;lt;/span&amp;gt;&amp;lt;sub&amp;gt;([[User_talk:Shadd|In caso di emergenza rompere le scatole]])&amp;lt;/sub&amp;gt; 09:35, 17 June 2008 (CDT)&lt;br /&gt;
:::::Try it, I'm not entirely sure. You should be able to produce some code to show the player's current tasks very easily... [[User:EAi|eAi]] 19:20, 17 June 2008 (CDT)&lt;br /&gt;
::::::My goal is to edit the standard damage of the attacks, in this case i have to know when player is on ground to cause higher damage. However it doesn't seem to work, when i hit the player it simply gets up without animation with no damage. --&amp;lt;span style=&amp;quot;font-family:Courier New, Courier, monospace&amp;quot;&amp;gt;[[User:Shadd|Shadd]]&amp;lt;/span&amp;gt;&amp;lt;sub&amp;gt;([[User_talk:Shadd|In caso di emergenza rompere le scatole]])&amp;lt;/sub&amp;gt; 19:10, 19 June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
It may looks strange and useless (waste of time?) but I think that it could be a awesome feature. Having a web browser.&lt;br /&gt;
Like: http://www.youtube.com/watch?v=wT1UR6qEgdg&lt;br /&gt;
http://princeofcode.com/awesomium.php&lt;br /&gt;
:definetly useles and waste of time, suporting xfire enought. -karlis&lt;br /&gt;
::Really Karlis, who asked you bro. It could be very useful, actually. For example, creating dynamic billboards. Instead of changing the TXD, they could set up a browser object over the billboard. That way they can also set up a timer to change the image, etc. [[User:JacobS|JacobS]] 20:08, 1 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There could be something like createBrowser( float x, float y, float z, [float rx, float ry, float rz, float width, float high, string url, bool locked] ) &lt;br /&gt;
locked parameter: false = navigation bar present, true = no navigation bar&lt;br /&gt;
toggleBrowserFullsceenMode(browser theBrowser, bool tog, [bool smooth])&lt;br /&gt;
smooth parameter: If set to true the browser will smoothly move from his ingame position to the fullscreen position&lt;br /&gt;
toggleBrowserBackground(browser theBrowser, bool tog)&lt;br /&gt;
Set the browser background transparent.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Security: Disable file downloads, disable popups (disable flash, javascript and any other protocols than http and https [no mailto and stuff...]?)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Should be a Client and server function. --[[User:Masterofquebec|Masterofquebec]] 00:10, 15 October 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Support of tooltips from CEGUI would be cool. I saw a property for that, but it didn't work for me. [[User:MaddDogg14]] (04:36 Apr 4, 10 (CEST))&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I request a function that gets all clothes from a ped, just like getPedClothes but for all bodyparts. With this function it would be more ease to save clothes to database.&lt;br /&gt;
:That's so easy to do yourself that it's barely worth adding. Just loop all the indexes 0-17 and save them to a table. [[User:Awwu|Awwu]] 19:26, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[setProjectileTarget]] for setting a projectile to target a specific entity. I am trying to create a Battlefield Bad Company type of gamemode and in that game, you can plant a 'tracer'. Any rocket fired (if the tracer is on screen) will seek the tracer. [[User:LeetWoovie|LeetWoovie]] 05:01, 19 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
(marcol07, June the 25th, 2010) I would like to have some function to create light source as element or sth like createFire, for example createLight(x,y,z,xrot,yrot,zrot,f,r,g,b) where &amp;quot;f&amp;quot; is an angle of lightning. or it is possible with some model or function? It would be good to create for example fog lamps or classic street lamps&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
moveElement available for markers, objects, pedestrians and players or maybe more if you can do. [[User:Socialz|Socialz]] 13:10, 1 January 2012 (CET)&lt;br /&gt;
&lt;br /&gt;
==Client-Side==&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Adding possibility to toggle radio hud label by '''showHudComponent''' -karlis  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Pickup events clientside please, onClientPickupHit onClientPickupUse.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Would it be possible to add a color arg to guiGridListSetItemText()? Im trying to get each item colored differently in one list. Thanks, ABEL&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I need a function which could get current target of hydra or a HS rocket launcher, like when someone press space and targets a element, to get what element is it for calculating distance from it. '''getPlayerOccupiedVehicleTarget''' or '''getPlayerHSTarget'''. &lt;br /&gt;
Thanks in advance -Nidza a.k.a. CodeMaster 2:26 PM 19th June 2008.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
It'd be useful to have something to disable elements of the default hud (weapon display, health display, armor, radar, etcetera) so that you can create your own HUDs. Something like '''setHudElement(element name, toggle)'''.&lt;br /&gt;
&lt;br /&gt;
[[User:Lord Xalphox|Lord Xalphox]] 19:32, 22 March 2009 (CET)&lt;br /&gt;
:[[showPlayerHudComponent]]? [[User:Awwu|Awwu]] 19:43, 22 March 2009 (CET)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I'd like to have a function that sets the chatbox input line text. Then I could script my own chat history function (that inserts the last sent text into the input line again by pressing arrow up) (which samp has since 0.2 btw) since nobody builds it into the client. [[User:NeonBlack|NeonBlack]] 12:03, 4 July 2009 (CEST) PS.: samp also supports cut, copy and paste :P&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
A function setElementMatrix, doing the exact opposite of getElementMatrix would be much appreciated. --[[User:Kayl|Kayl]] 15:21, 13 November 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Functions like setTrainPosition(train,track,pos) and track,pos getTrainPosition(train) would be great in order to allow more script side control of trains.&lt;br /&gt;
The track argument would be an index of the track number (currently there are around 4 tracks handled, including 1 incompletely defined).&lt;br /&gt;
The position would be a float between 0 and 1 (or however you guys handle it) telling where on the track the train currently is.&lt;br /&gt;
It would be great if those functions could be available client and server side. --[[User:Kayl|Kayl]] 12:58, 23 November 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
need this function client and server side '''movePlayerHudComponent(string component, float x, float y)''' --[[User:SuatEyrice|SuatEyrice]] 00:18, 26 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''(marcol07, June the 27th, 2010)''' I would be so happy to have fuction to set Analog control of player sth like '''getAnalogControlState(string controlName)''' but inverted to '''setAnalogControlState(string controlName, float state)'''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
OnPedDamage (serverside) event. There is OnClientPedDamage, but it's clientside. [[User:damage22|damage22]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
'''setRadioVolume(element thePlayer, int volume)''', to create GUI volume control, turn off the radio without changing the station, etc. [[User:JacobS|JacobS]] 14:47, 29 July 2010 (UTC)&lt;br /&gt;
----&lt;br /&gt;
'''setVehicleHydraulics(element theVehicle, bool state)''', to force hydraulics to be up (true) or down (false)&lt;br /&gt;
----&lt;br /&gt;
'''createFire(x, y, z, theSize, dimension)''', just like [[createFire]], only with the option to enter a dimension for the fire to appear in&lt;br /&gt;
----&lt;br /&gt;
'''setGunshotsEnabled(bool enabled)''', '''getGunshotsEnabled()''' and '''createGunshot(x,y,z,radius)''' - to enable/disable the game's gunshot ambience, and to create gunshots at specific locations with radii that it is audible in [[User:JacobS.|JacobS.]] 19:28, 11 September 2010 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
onClick  should pass the name of the clicked SUBobject too (eg: vehicle parts, bone names etc.)--[[User:Lcaseidefensis|Lcaseidefensis]] 16:48, 21 May 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
something to open/close doors like in singleplayer (teleports are a bit unrealistic)&lt;/div&gt;</summary>
		<author><name>Lcaseidefensis</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Requested_Functions_and_Events&amp;diff=30588</id>
		<title>Requested Functions and Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Requested_Functions_and_Events&amp;diff=30588"/>
		<updated>2012-05-11T21:45:10Z</updated>

		<summary type="html">&lt;p&gt;Lcaseidefensis: /* Client-Side */ requesting sa data file replacer functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Server-side==&lt;br /&gt;
&lt;br /&gt;
Element type: GUI, for getElemensByType(&amp;quot;GUI&amp;quot;)&lt;br /&gt;
----------&lt;br /&gt;
Event like onServerTick wich is run very often. Like the clientside onClientRender. This could be useful for constat checking wich must be done under 50ms (lower than timers can handle).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
onVehicleCreated or an equivalent... shouldn't be too hard? -Robhol (14:15 Jul 6, 08)&lt;br /&gt;
:If we did it, it'd be onElementCreated - what do you want this for? [[User:EAi|eAi]] 08:58, 7 July 2008 (CDT)&lt;br /&gt;
::onElementCreated is a good idea - it could be used for lots of things. Also, how about onVehicleDrown or whatever? that is, when a vehicle hits deep water. Checking for collisions and stuff is very awkward, and client-side only, and has to be checked constantly.. -Robhol (17:31 Jul 9 08)&lt;br /&gt;
:::I second that. It would be useful if you use like me element data like the fuel amount or other stuff. And an event like this would help me to setup those element data, when a car spawns. Otherwise I would either have to edit every car spawn script I use or do a post-setup when someone is entering the car.. [[User:MaddDogg14]] (04:34 Apr 4, 10 (CEST))&lt;br /&gt;
::::i definetly agree, onElementCreated would be VERY useful for utility/librares scripts, but i think this should be limited by ACL, because &amp;quot;evil&amp;quot; scripts could abuse this othervise -Karlis (9:10 Apr 5, 10)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I ask for a function that detects if a ped is on floor, eg. '''isPedOnFloor(ped thePed)''', thanks. --&amp;lt;span style=&amp;quot;font-family:Courier New, Courier, monospace&amp;quot;&amp;gt;[[User:Shadd|Shadd]]&amp;lt;/span&amp;gt;&amp;lt;sub&amp;gt;([[User_talk:Shadd|In caso di emergenza rompere le scatole]])&amp;lt;/sub&amp;gt; 11:29, 15 June 2008 (CDT)&lt;br /&gt;
: [[isPedOnGround]]? [[User:Awwu|Awwu]] 12:58, 15 June 2008 (CDT)&lt;br /&gt;
::I need to know if the player has its back touching the ground, not if it's simply &amp;quot;on ground&amp;quot;. --&amp;lt;span style=&amp;quot;font-family:Courier New, Courier, monospace&amp;quot;&amp;gt;[[User:Shadd|Shadd]]&amp;lt;/span&amp;gt;&amp;lt;sub&amp;gt;([[User_talk:Shadd|In caso di emergenza rompere le scatole]])&amp;lt;/sub&amp;gt; 14:16, 16 June 2008 (CDT)&lt;br /&gt;
:::Check what task the player has, they should have TASK_COMPLEX_FALL_AND_GET_UP or TASK_COMPLEX_FALL_AND_STAY_DOWN... [[User:EAi|eAi]] 19:12, 16 June 2008 (CDT)&lt;br /&gt;
::::Thanks. What task does player have after being hitten by a melee attack that cause it to fall down? Would &amp;quot;TASK_SIMPLE_BE_KICKED_ON_GROUND&amp;quot; and &amp;quot;TASK_SIMPLE_GET_UP&amp;quot; work? --&amp;lt;span style=&amp;quot;font-family:Courier New, Courier, monospace&amp;quot;&amp;gt;[[User:Shadd|Shadd]]&amp;lt;/span&amp;gt;&amp;lt;sub&amp;gt;([[User_talk:Shadd|In caso di emergenza rompere le scatole]])&amp;lt;/sub&amp;gt; 09:35, 17 June 2008 (CDT)&lt;br /&gt;
:::::Try it, I'm not entirely sure. You should be able to produce some code to show the player's current tasks very easily... [[User:EAi|eAi]] 19:20, 17 June 2008 (CDT)&lt;br /&gt;
::::::My goal is to edit the standard damage of the attacks, in this case i have to know when player is on ground to cause higher damage. However it doesn't seem to work, when i hit the player it simply gets up without animation with no damage. --&amp;lt;span style=&amp;quot;font-family:Courier New, Courier, monospace&amp;quot;&amp;gt;[[User:Shadd|Shadd]]&amp;lt;/span&amp;gt;&amp;lt;sub&amp;gt;([[User_talk:Shadd|In caso di emergenza rompere le scatole]])&amp;lt;/sub&amp;gt; 19:10, 19 June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
It may looks strange and useless (waste of time?) but I think that it could be a awesome feature. Having a web browser.&lt;br /&gt;
Like: http://www.youtube.com/watch?v=wT1UR6qEgdg&lt;br /&gt;
http://princeofcode.com/awesomium.php&lt;br /&gt;
:definetly useles and waste of time, suporting xfire enought. -karlis&lt;br /&gt;
::Really Karlis, who asked you bro. It could be very useful, actually. For example, creating dynamic billboards. Instead of changing the TXD, they could set up a browser object over the billboard. That way they can also set up a timer to change the image, etc. [[User:JacobS|JacobS]] 20:08, 1 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There could be something like createBrowser( float x, float y, float z, [float rx, float ry, float rz, float width, float high, string url, bool locked] ) &lt;br /&gt;
locked parameter: false = navigation bar present, true = no navigation bar&lt;br /&gt;
toggleBrowserFullsceenMode(browser theBrowser, bool tog, [bool smooth])&lt;br /&gt;
smooth parameter: If set to true the browser will smoothly move from his ingame position to the fullscreen position&lt;br /&gt;
toggleBrowserBackground(browser theBrowser, bool tog)&lt;br /&gt;
Set the browser background transparent.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Security: Disable file downloads, disable popups (disable flash, javascript and any other protocols than http and https [no mailto and stuff...]?)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Should be a Client and server function. --[[User:Masterofquebec|Masterofquebec]] 00:10, 15 October 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Support of tooltips from CEGUI would be cool. I saw a property for that, but it didn't work for me. [[User:MaddDogg14]] (04:36 Apr 4, 10 (CEST))&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I request a function that gets all clothes from a ped, just like getPedClothes but for all bodyparts. With this function it would be more ease to save clothes to database.&lt;br /&gt;
:That's so easy to do yourself that it's barely worth adding. Just loop all the indexes 0-17 and save them to a table. [[User:Awwu|Awwu]] 19:26, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[setProjectileTarget]] for setting a projectile to target a specific entity. I am trying to create a Battlefield Bad Company type of gamemode and in that game, you can plant a 'tracer'. Any rocket fired (if the tracer is on screen) will seek the tracer. [[User:LeetWoovie|LeetWoovie]] 05:01, 19 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
(marcol07, June the 25th, 2010) I would like to have some function to create light source as element or sth like createFire, for example createLight(x,y,z,xrot,yrot,zrot,f,r,g,b) where &amp;quot;f&amp;quot; is an angle of lightning. or it is possible with some model or function? It would be good to create for example fog lamps or classic street lamps&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
moveElement available for markers, objects, pedestrians and players or maybe more if you can do. [[User:Socialz|Socialz]] 13:10, 1 January 2012 (CET)&lt;br /&gt;
&lt;br /&gt;
==Client-Side==&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Adding possibility to toggle radio hud label by '''showHudComponent''' -karlis  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Pickup events clientside please, onClientPickupHit onClientPickupUse.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Would it be possible to add a color arg to guiGridListSetItemText()? Im trying to get each item colored differently in one list. Thanks, ABEL&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I need a function which could get current target of hydra or a HS rocket launcher, like when someone press space and targets a element, to get what element is it for calculating distance from it. '''getPlayerOccupiedVehicleTarget''' or '''getPlayerHSTarget'''. &lt;br /&gt;
Thanks in advance -Nidza a.k.a. CodeMaster 2:26 PM 19th June 2008.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
It'd be useful to have something to disable elements of the default hud (weapon display, health display, armor, radar, etcetera) so that you can create your own HUDs. Something like '''setHudElement(element name, toggle)'''.&lt;br /&gt;
&lt;br /&gt;
[[User:Lord Xalphox|Lord Xalphox]] 19:32, 22 March 2009 (CET)&lt;br /&gt;
:[[showPlayerHudComponent]]? [[User:Awwu|Awwu]] 19:43, 22 March 2009 (CET)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I'd like to have a function that sets the chatbox input line text. Then I could script my own chat history function (that inserts the last sent text into the input line again by pressing arrow up) (which samp has since 0.2 btw) since nobody builds it into the client. [[User:NeonBlack|NeonBlack]] 12:03, 4 July 2009 (CEST) PS.: samp also supports cut, copy and paste :P&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
A function setElementMatrix, doing the exact opposite of getElementMatrix would be much appreciated. --[[User:Kayl|Kayl]] 15:21, 13 November 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Functions like setTrainPosition(train,track,pos) and track,pos getTrainPosition(train) would be great in order to allow more script side control of trains.&lt;br /&gt;
The track argument would be an index of the track number (currently there are around 4 tracks handled, including 1 incompletely defined).&lt;br /&gt;
The position would be a float between 0 and 1 (or however you guys handle it) telling where on the track the train currently is.&lt;br /&gt;
It would be great if those functions could be available client and server side. --[[User:Kayl|Kayl]] 12:58, 23 November 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
need this function client and server side '''movePlayerHudComponent(string component, float x, float y)''' --[[User:SuatEyrice|SuatEyrice]] 00:18, 26 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''(marcol07, June the 27th, 2010)''' I would be so happy to have fuction to set Analog control of player sth like '''getAnalogControlState(string controlName)''' but inverted to '''setAnalogControlState(string controlName, float state)'''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
OnPedDamage (serverside) event. There is OnClientPedDamage, but it's clientside. [[User:damage22|damage22]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
'''setRadioVolume(element thePlayer, int volume)''', to create GUI volume control, turn off the radio without changing the station, etc. [[User:JacobS|JacobS]] 14:47, 29 July 2010 (UTC)&lt;br /&gt;
----&lt;br /&gt;
'''setVehicleHydraulics(element theVehicle, bool state)''', to force hydraulics to be up (true) or down (false)&lt;br /&gt;
----&lt;br /&gt;
'''createFire(x, y, z, theSize, dimension)''', just like [[createFire]], only with the option to enter a dimension for the fire to appear in&lt;br /&gt;
----&lt;br /&gt;
'''setGunshotsEnabled(bool enabled)''', '''getGunshotsEnabled()''' and '''createGunshot(x,y,z,radius)''' - to enable/disable the game's gunshot ambience, and to create gunshots at specific locations with radii that it is audible in [[User:JacobS.|JacobS.]] 19:28, 11 September 2010 (MDT)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
it would be great to replace not just the handling and model files but col data files also (not the  collision models), or should I just make new .col files? :S--[[User:Lcaseidefensis|Lcaseidefensis]] 21:45, 11 May 2012 (UTC)&lt;/div&gt;</summary>
		<author><name>Lcaseidefensis</name></author>
	</entry>
</feed>