Jump to content
Sign in to follow this  
lucilk

remove units form vehicle

Recommended Posts

how can i remove all units form a vehicle trough a script command, not just a specific units, i want at the begining of a script the first thing to to is to eject any units inside a vehicle (players and AI)

Edited by lucilk
eject not delete

Share this post


Link to post
Share on other sites

(1) why when empty vehicles are available ?

(2) Anyway, type this in the init line of the vehicle :

{deletevehicle _x} foreach crew this

Share this post


Link to post
Share on other sites

:D no...

you see its a vehicle that has an action, ok and i want the units inside the vehicle to be ejected when they activate that action beacuse there will bea a base deployed and there are some objects attachet to the vehicle so if he deploys those buildings he can run away with the vehicle and buildings and all.

so i just tought maibe i could do something to eject everybody from the vehicle when that action is activated.

Share this post


Link to post
Share on other sites

hi lucilk,

in case u still need help with it, did you try

{_x leaveVehicle <vehicle>} foreach crew <vehicle>;

yet?

Share this post


Link to post
Share on other sites

I've been wondering this as well. I've run into times when this would come in handy while making missions.

Share this post


Link to post
Share on other sites

player action ["eject",pbhmv];

{_x action ["eject",pbhmv]} forEach units pbhmv;

this was the answer, i found out my self, thx anyway , hope it works well

Share this post


Link to post
Share on other sites

Then it should be

{_x action ["eject",pbhmv]; unassignVehicle _x;} forEach units pbhmv;

to remove the units from the internal vehicle list. Otherwise the units will try to reenter the vehicle after they eject.

Share this post


Link to post
Share on other sites

yes you are right but... the vehicle pbhmv is not assigned to anyone that is a spawned empty, so he will eject anyone, player or AI. so yes both examples are good, depends... situation you know... thx man.

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  

×