Jump to content
Sign in to follow this  
barbolani

Know cargo seats of a vehicle

Recommended Posts

Hi!

All the references I find to this lead to this snippet:

cargo = getNumber (configFile >> "CfgVehicles" >> (typeOf vehicle) >> "transportSoldier");

This + allTurrets + 1 for the driver should give me how many seats has a vehicle.

Well, actually cargo returns 0 or 1 in any vehicle I'm trying.

It seems "transportSoldier" returns only the forward seats of any car, but not sure...

Any workaround there?

Thanks in advance!

EDIT: OH forget about it:

_maxCargo = (_veh emptyPositions "Cargo") + (_veh emptyPositions "Commander") + (_veh emptyPositions "Gunner") + (_veh emptyPositions "Driver");

Edited by barbolani

Share this post


Link to post
Share on other sites

Sorry for the double post, but, the solution I wrote is not correct as dead units inside the vehicle will give less seats. If anyone can help...

Share this post


Link to post
Share on other sites

Thanks Mikey, but that command does not serve for that purpose.

My findings is the config thing excludes all the cargo seats from which you can fire, so a combination of this + allturrets true gave the solution:

_maxCargo = (getNumber (configFile >> "CfgVehicles" >> (typeOf _veh) >> "transportSoldier")) + (count allTurrets [_veh, true]) + 1;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×