Difference between revisions of "cmf common fnc setRole"
Jump to navigation
Jump to search
Line 23: | Line 23: | ||
|r1=None | |r1=None | ||
|x1= | |x1= {{code|lang=scilab|// Set myUnit's role to "SL" | ||
[myUnit, "SL"] call emf_gameplay_fnc_setRole; | [myUnit, "SL"] call emf_gameplay_fnc_setRole;}} | ||
|x2= | |x2= {{code|lang=scilab|// Set this object's role to "MED" and team to 1 | ||
[this, "MED", 1] call emf_gameplay_fnc_setRole; | [this, "MED", 1] call emf_gameplay_fnc_setRole;}} | ||
|notes= | |notes= |
Revision as of 17:20, 4 November 2022
Description
- Description:
- This function sets the team and squad role of a playerunit, due to how i use EMF in missions it is required for a lot of functions in EMF. it is recommended you run this function for each playable unit in your mission.
- Execution:
- Call
- Groups:
- CMF3: common
Syntax
- Syntax:
- [unit, role, team] call cmf_common_fnc_setRole
- Parameters:
- unit: Object - The unit to assign a role and team to
- role: String - (Optional, deafult "RFL") Role to assign unit
- team: Number - (Optional, default 0) Which team to assign unit, when 0 will use the first supplied loadoutfile
- Return Value:
- None
Examples
- Example 1:
// Set myUnit's role to "SL" [myUnit, "SL"] call emf_gameplay_fnc_setRole;
- Example 2:
// Set this object's role to "MED" and team to 1 [this, "MED", 1] call emf_gameplay_fnc_setRole;
Additional Information
- See also:
- See also needed
Internal Variables
- No internal variables
Events
- No events
Notes
- Variables:
- [common, setRole, unitNamespace, GLOBAL] cmf_common_role = a string variable containing the unit's role (SL, RFL, MED etc.)
- [common, setRole, unitNamespace, GLOBAL] cmf_common_team = a string variable containing the unit's team index (0, 1, 2 etc.)