Jump to content
Sign in to follow this  
MaldorLevr

Ejecting a player from a back seat in a car

Recommended Posts

Hi, I'd like to make a script where the driver can kick people out of his vehicle(ground vehicle). I'm having problems getting the driver to kick out passengers.

When I do:

driver vehicle player Action ["eject", vehicle player];

it kicks the driver out as expected but when I try:

crew vehicle player Action ["eject", vehicle player];

nobody gets kicked out of the vehicle.

Share this post


Link to post
Share on other sites

Crew is an array, so its understandable that its not working :)

{
   _x action ["eject", vehicle player];
} forEach (crew (vehicle player));

Share this post


Link to post
Share on other sites

Thank you again, I guess I should've read the wiki a bit more.

So to eject a passenger/person in back would I do

{

_x action ["eject", vehicle player];

} forEach (crew (vehicle player) select 4);

OR

crew (vehicle player) select 4 action ["eject", vehicle player];

Edited by MaldorLevr

Share this post


Link to post
Share on other sites

the latter one, select gets you one element of the array, whereas foreach would return an error because you didn't supply an array :D

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  

×