User Tools

Site Tools


addons:functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

addons:functions [2017/04/21 20:34]
atom0s
addons:functions [2017/04/22 00:11]
Line 1: Line 1:
-===== Functions ===== 
  
-Addons have various global functions and '​namespaces'​ exposed to them that are built into the Addons plugin. These can be used to interact back with the Addons plugin as well as the Ashita core. Some of these functions are made to allow addons more access to the game client, the system the client is running on, and more.  
- 
-Below are the various functions and namespaces you can make use of while coding your addon(s). 
- 
----- 
-==== AddIncomingPacket ==== 
- 
-Sends a packet to the client as if the server had sent it. 
-<code cpp>void AddIncomingPacket(id,​ packet);</​code>​ 
-  * **Parameters** 
-    * id - (number) The id of the packet being sent. 
-    * packet - (table) The packet data. 
-  * **Returns** 
-    * //Function does not return a value.// 
- 
----- 
-==== AddOutgoingPacket ==== 
- 
-Sends a packet to the server as if the client had sent it. 
-<code cpp>void AddOutgoingPacket(id,​ packet);</​code>​ 
-  * **Parameters** 
-    * id - (number) The id of the packet being sent. 
-    * packet - (table) The packet data. 
-  * **Returns** 
-    * //Function does not return a value.// 
- 
----- 
-==== ParseAutoTranslate ==== 
- 
-Parses a string for auto-translate tags and converts them. 
-<code cpp>​string ParseAutoTranslate(msg,​ useBrackets);</​code>​ 
-  * **Parameters** 
-    * msg - (string) The chat message to parse the auto-translate tags within. 
-    * useBrackets - (bool) True if the resulting string should include the brackets, false otherwise. 
-  * **Returns** 
-    * string - The parsed string. 
- 
----- 
-==== GetEntity ==== 
- 
-Obtains an entity object from the given index. 
-<code cpp>​object GetEntity(index);</​code>​ 
-  * **Parameters** 
-    * index - (number) The index of the entity to obtain. 
-  * **Returns** 
-    * object - The entity object if valid, nil otherwise. 
- 
----- 
-==== GetPlayerEntity ==== 
- 
-Obtains the player entity object. 
-<code cpp>​object GetPlayerEntity();</​code>​ 
-  * **Parameters** 
-    * //Function has no parameters.//​ 
-  * **Returns** 
-    * object - The entity object if valid, nil otherwise. 
addons/functions.txt · Last modified: 2017/04/22 00:11 (external edit)