Template:LuaCallin: Difference between revisions

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


<pre>
{{LuaCallin
{{LuaCallin
|name = AllowUnitCreation
|name = AllowUnitTransfer
|params = number unitDefID, number builderID, number builderTeam, <br/>number x, number y, number z, <br/>number facing
|args = unitID, unitDefID, oldTeam, newTeam, capture
|return = bool allow
|return = {{type|bool}} allow
|description = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.}}
|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>
}}</pre>
 
{{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.