BIS fnc crewCount: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game version" to "|Game version=")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *T([a-z ])" to "$1 - t$2")
 
(40 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.08


| arma3 |= Game name
|gr1= Object Manipulation


|1.08|Game version=
|descr= Function that counts amount of seats, both for crew and cargo seats.
____________________________________________________________________________________________


| Function that counts amount of seats, both for crew and cargo seats. |DESCRIPTION=
|s1= param call [[BIS_fnc_crewCount]]
____________________________________________________________________________________________


| param call [[BIS_fnc_crewCount]]; |SYNTAX=
|p1= [[String]] - classname of vehicle.
|p2= [[Boolean]] - true if cargo seats should be included (see notes)


|p1= [[String]] - Classname of vehicle. |PARAMETER1=
|r1= [[Number]] - amount of seats in vehicle.
|p2= [[Boolean]] - True if cargo seats should be included (see notes) |=


| [[Number]] - Amount of seats in vehicle. |RETURNVALUE=
|x1= <sqf>crewCount = ["B_Heli_Light_01_F", false] call BIS_fnc_crewCount; // Counts all available seats excluding cargo slots. Returns 6 (see notes).</sqf>
____________________________________________________________________________________________
|x2= <sqf>crewCount = ["B_Heli_Transport_01_F", true] call BIS_fnc_crewCount; // Counts all available seats including cargo slots. Returns 12.</sqf>
 
|x1= <code>crewCount = ["B_Heli_Light_01_F",false] call BIS_fnc_crewCount; // Counts all available seats excluding cargo slots. Returns 6 (see notes).</code> |=
|x2 = <code>crewCount = ["B_Heli_Transport_01_F",true] call BIS_fnc_crewCount; // Counts all available seats including cargo slots. Returns 12.</code> |=
____________________________________________________________________________________________
 
| |SEEALSO=


|seealso= [[crew]]
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
<dt></dt>
[[Category:Function Group: Objects|{{uc:crewCount}}]]
<dd class="notedate">Posted on 2014-10-01 - 20:12 (UTC)</dd>
[[Category:Functions|{{uc:crewCount}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:crewCount}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on October 1, 2014 - 20:12 (UTC)</dd>
<dt class="note">[[User:Tryteyker-|Tryteyker-]]</dt>
<dt class="note">[[User:Tryteyker-|Tryteyker-]]</dt>
<dd class="note">
<dd class="note">
Line 49: Line 32:
Crew slots include gunners and in some instances some cargo slots. The above may not work for every vehicle.
Crew slots include gunners and in some instances some cargo slots. The above may not work for every vehicle.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 15:50, 8 November 2023

Hover & click on the images for description

Description

Description:
Function that counts amount of seats, both for crew and cargo seats.
Execution:
call
Groups:
Object Manipulation

Syntax

Syntax:
param call BIS_fnc_crewCount
Parameters:
String - classname of vehicle.
Boolean - true if cargo seats should be included (see notes)
Return Value:
Number - amount of seats in vehicle.

Examples

Example 1:
crewCount = ["B_Heli_Light_01_F", false] call BIS_fnc_crewCount; // Counts all available seats excluding cargo slots. Returns 6 (see notes).
Example 2:
crewCount = ["B_Heli_Transport_01_F", true] call BIS_fnc_crewCount; // Counts all available seats including cargo slots. Returns 12.

Additional Information

See also:
crew

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
Posted on 2014-10-01 - 20:12 (UTC)
Tryteyker-
This function goes through config values and as such is dependant on these. In some instances, this can lead to weird results; the user may, for example, expect the skids on the Littlebird to be cargo slots.
However, in reality, they are not and as such will be counted even if the boolean value is set to false.
If the bool value is set to true, it will return the total amount of seats available. To get the cargo seats only, running this function twice (once with false and once with true as bool values), and then subtracting the total with crew-only will yield the cargo (F^cargo = Ftotal - Fcrew) slots.
Crew slots include gunners and in some instances some cargo slots. The above may not work for every vehicle.