assignedVehicleRole: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 58: Line 58:
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on November 15, 2014 - 23:31 (UTC)</dd>
<dt class="note">[[User:Tajin|Tajin]]</dt>
<dd class="note">
In multiplayer (tested in v1.34), this only works reliably on the server.<br>
<br>
'''Behaviour is as follows:'''<br>
On a client, the command will return empty arrays for every unit that is not local.<br>
On the server, the command correctly returns the position, regardless of the units locality.<br>
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 00:31, 16 November 2014

-wrong parameter ("Arma") defined!-1.05
Hover & click on the images for description

Description

Description:
Return the role a unit is assigned to within its assigned vehicle. The array which is returned contains:
  • [] - Not assigned to any vehicle
  • ["Driver"] - Assigned as driver
  • ["Cargo"] (or ["Cargo", [turret path]] since Arma 3 1.31.127272) - Assigned as cargo
  • ["Turret", [turret path]] - Assigned to a turret
If no vehicle role is assigned, an empty array is returned.
Groups:
Uncategorised

Syntax

Syntax:
Array = assignedVehicleRole unitName
Parameters:
unitName: Object
Return Value:
Array

Examples

Example 1:
_RoleArray = assignedVehicleRole player;
Example 2:
Get weapons available to player at player occupied turret:_weaponsTurret = vehicle player weaponsTurret (assignedVehicleRole player select 1);

Additional Information

See also:
addVehicleassignedVehicleunassignVehicleweaponsTurretassignAsCargoassignAsCommanderassignAsDriverassignAsGunnerassignAsTurret

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Posted on August 31, 2013
Killzone_Kid
When unit with unassigned vehicle role enters a vehicle, it gets assigned vehicle role automatically. The unit then will hold on to its assigned role after exiting the vehicle.

Bottom Section

Posted on November 15, 2014 - 23:31 (UTC)
Tajin
In multiplayer (tested in v1.34), this only works reliably on the server.

Behaviour is as follows:
On a client, the command will return empty arrays for every unit that is not local.
On the server, the command correctly returns the position, regardless of the units locality.