OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: tateyou on 12 Jun 2008, 18:58:46

Title: How can i force the player to stay in/get out the vechile
Post by: tateyou on 12 Jun 2008, 18:58:46
As topic, if i want to define an ambush, but before the ambush happened, i don't want the players to get out the car(AI driving) freely, and when the ambush take place, everyplayer should be forced to get out of the car immediately without orders.
How can i make that happpen? What scripts or syntax should i use?
THX a lot!
Title: Re: How can i force the player to stay in/get out the vechile
Post by: Mr.Peanut on 12 Jun 2008, 21:34:35
myVehicle Lock TRUE;

myVehicle Lock FALSE;
{unassignVehicle _x; _x action ["EJECT"];} forEach units myGroup;
Title: Re: How can i force the player to stay in/get out the vechile
Post by: tateyou on 13 Jun 2008, 02:22:40
Thank you!
There is a little more, {unassignVehicle _x; _x action ["EJECT"];} forEach units myGroup;
where should i use it? Can i type this syntax in the ON.ACT of a trigger or in scirpts?
What does myGroup indicate? The group name?
Here's the deal, i defined a trigger with certain area, Activation Blufor present, and 4 playable unit get in a car and drive torward the trigger area, what should i do to pop out all the playable units when entered the trigger area?
Title: Re: How can i force the player to stay in/get out the vechile
Post by: Carroll on 13 Jun 2008, 10:04:12
to get the group to get out once in the trig use Mr Peanuts suggestion in the triggers ON ACT;
Code: [Select]
{unassignVehicle _x; _x action ["EJECT"];} forEach units myGroup;
&& yes myGroup == the groups name
Title: Re: How can i force the player to stay in/get out the vechile
Post by: Mr.Peanut on 13 Jun 2008, 14:18:59
And put the myVehicle Lock TRUE; in your init.sqf if they are starting the mission in the vehicle. Do not bother with the myVehicle Lock False; if you do not want them to be able to get back in the vehicle.
Title: Re: How can i force the player to stay in/get out the vechile
Post by: Rommel92 on 19 Jun 2008, 05:36:20
I just feel sorry for the guy who was using this, probably thinking it was his fault. But I think you may have forgotten:
original:
Code: [Select]
{unassignVehicle _x; _x action ["EJECT"];}

fixed:
Code: [Select]
{unassignVehicle _x; _x action ["EJECT", vehicle _x];}

Got me confuzzled for a second there... last time using ur code peanut! Third time haha. (jkin gw mate).

EDIT:

In any case, I've used a GET IN NEAREST waypoint to move a group into a vehicle, after using this command they will simple re-enter the vehicle. Any idea?