Template:LuaCallin: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
m fix example
Flozi (talk | contribs)
tweak to new API named params
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{API|{{{addon}}}&#58;|{{{name}}}|{{{params}}}|return: {{{return}}}|{{{description}}}}}</includeonly><noinclude>'''Lua Callin usage example:''' <pre>{{LuaCallin|addon|name|params|return|description}}</pre>
<includeonly>{{API
|prefix = addon.
|name = {{{name}}}
|args = {{{args|}}}
|return = {{{return|}}}
|info = {{{info}}}}}</includeonly><noinclude>==Lua Callin usage example==


<pre>
{{LuaCallin
{{LuaCallin
|addon = gadget
|name = AllowUnitTransfer
|name = AllowUnitCreation
|args = unitID, unitDefID, oldTeam, newTeam, capture
|params = number unitDefID, number builderID, number builderTeam, <br/>number x, number y, number z, <br/>number facing
|return = {{type|bool}} allow
|return = bool allow
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
|description = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.}}
}}</pre>
</noinclude>
 
{{LuaCallin
|name = AllowUnitTransfer
|args = unitID, unitDefID, oldTeam, newTeam, capture
|return = {{type|bool}} allow  
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
}}</noinclude>

Latest revision as of 14:42, 18 June 2016

Lua Callin usage example

{{LuaCallin
|name = AllowUnitTransfer
|args = unitID, unitDefID, oldTeam, newTeam, capture
|return = {{type|bool}} allow 
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
}}

addon.AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture)
return: bool allow

Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.