Resource:Battlefield/createSquad: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with 'This function creates a squad element. ==Syntax== <syntaxhighlight lang="lua"> squad createSquad ( team theTeam ) </syntaxhighlight>')
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
This function creates a [[Resource:battlefield/squad|squad]] [[element]].
__NOTOC__
==Purpose==
Creates a squad element. [[Resource:battlefield/squad|Click here to read more about squads.]]


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
squad createSquad ( team theTeam )
squad createSquad ( team squadTeam, string shortName )
</syntaxhighlight>
</syntaxhighlight>
===Required Arguments===
*'''squadTeam:''' The [[team]] element the squad will be attached to.
*'''shortName:''' The [[Resource:battlefield/shortname|shortname]] for the squad.
===Returns===
Returns the ''squad element'' if it was created, otherwise ''false''.
==Function Source==
<syntaxhighlight lang="lua">
function createSquad ( team, shortn )
squad = createElement ( "squad", team, shortn )
if squad then
return squad
else
return false
end
end
</syntaxhighlight>
{| width="100%" style="text-align:left; background-color:#F9F9F9; border:1px solid #AAAAAA;"
| [[Resource:Battlefield|Return to Battlefield Resource]]
|}

Latest revision as of 14:33, 22 April 2010

Purpose

Creates a squad element. Click here to read more about squads.

Syntax

squad createSquad ( team squadTeam, string shortName )

Required Arguments

  • squadTeam: The team element the squad will be attached to.
  • shortName: The shortname for the squad.

Returns

Returns the squad element if it was created, otherwise false.

Function Source

function createSquad ( team, shortn )
	squad = createElement ( "squad", team, shortn )
	if squad then
		return squad
	else
		return false
	end
end


Return to Battlefield Resource