Jump to content
Sign in to follow this  
Valfunction

Make unit enter vehicle of any type

Recommended Posts

At present I have a script for loading prisoners into vehicles. Problem is I can only make them load into Land OR Air OR Ship but not all of them. The script is as follows:

This is for loading them onto planes and helicopters:

_thisunit = _this select 0;
_veh = nearestObject [_thisunit, "Air"];

if ((_thisunit distance _veh) < 10) then {

	detach _thisunit;

	["Getin", [_thisunit, _veh]] call CBA_fnc_globalEvent;

};

I can use either "LandVehicle", "Air" or "Ship" with nearestObject, but I need a way to use all three (so the prisoner gets into the nearest vehicle of ANY type). I tried "AllVehicles" but since people are technically vehicles _veh becomes the unit being manipulated. Anyone know how?

Share this post


Link to post
Share on other sites

Cheers man. Haven't had the chance to try it out yet but it seems to be on the money. I take it you simply use "select #" to work through the array?

Share this post


Link to post
Share on other sites

_array select 0, but make sure you check it is not []

if (count _array > 0)

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  

×