Dr. Jeff 0 Posted June 20, 2017 Hello I am doing a mission and I want to lock 5 quad for the BLUFOR and let them open for the OPFOR, Is it possible and, If yes, How can I do that ? Sorry if my English is bad ans thx for your help ;) Share this post Link to post Share on other sites
Belbo 462 Posted June 20, 2017 A long time ago I made this, should still work and do the trick. { _target = _x; if (isNil "_target") exitWith {}; _target addEventHandler [ "GetIn", { params ["_veh","_pos","_unit"]; if !(side (group _unit) isEqualTo east) then { _unit action ["eject", _veh]; }; } ]; nil; } count [vehicle_1,vehicle_2,...,vehicle_n]; Share this post Link to post Share on other sites
pierremgi 4906 Posted June 20, 2017 this script can't work due to params, not complying with the EH "getin" parameters. Try params ["_veh","_pos", "_unit"]; instead. 2 Share this post Link to post Share on other sites
Belbo 462 Posted June 20, 2017 Ah, I knew there was something I missed when I converted it to params... Thank you! Fixed it in the post above. 1 Share this post Link to post Share on other sites
Dr. Jeff 0 Posted June 20, 2017 And I have to write that in the "init" of the vehicle ? I don't really understand how I have to use that script :/ Share this post Link to post Share on other sites
Belbo 462 Posted June 20, 2017 Just smack it in the init.sqf and place the names of the vehicles where [vehicle_1...vehicle_n] is. Share this post Link to post Share on other sites
pierremgi 4906 Posted June 20, 2017 For 5 quads, you can just add: this addEventHandler [ "GetIn", { params ["_veh","_pos","_unit"]; if (side _unit != EAST) then { _unit action ["eject", _veh]; }; } ]; on each init field of quad. Share this post Link to post Share on other sites
Dr. Jeff 0 Posted June 21, 2017 Ok thx for your help ;) Share this post Link to post Share on other sites
mzgr 8 Posted April 20, 2020 On 6/21/2017 at 12:35 AM, pierremgi said: For 5 quads, you can just add: this addEventHandler [ "GetIn", { params ["_veh","_pos","_unit"]; if (side _unit != EAST) then { _unit action ["eject", _veh]; }; } ]; on each init field of quad. this ejects everyone who is not east, is there a way to eject ONLY west? i know it might seem like a stupid question, but i need civilians to also be able to enter this vehicle and i cant have them switching sides from civilian to east with joinSilent becouse that will mess up triggers Share this post Link to post Share on other sites
Harzach 2518 Posted April 20, 2020 Sure. The current condition for ejection is side _unit != EAST which is to say, "if the unit's side is not 'EAST.'" You just need to change it to "if the unit's side is 'WEST.'" side _unit == WEST 2 Share this post Link to post Share on other sites
mzgr 8 Posted April 20, 2020 Thanks man, that was a lot simpler then what i imagined it would be. Share this post Link to post Share on other sites
mrakos2005 4 Posted September 24, 2020 Bump, sorry guys! Would anybody here have an idea on how to make a vehicle locked but only for a player who is currently carrying a flag (CTF mission)? Share this post Link to post Share on other sites
pierremgi 4906 Posted September 25, 2020 The simple way I guess (NOT TESTED), is for player carrying a flag by forced flag texture (should be the case). So, in init.sqf, and related to this post: { _x addEventHandler [ "GetIn", { params ["_veh","_pos","_unit"]; if (getForcedFlagTexture _unit != "") then { _unit action ["eject", _veh]; }; }]; } forEach (yourArrayOfVehiclesHere); // vehicles by default, for all edited vehicles Spoiler For just specific vehicle, from editor, say named car1, it's simple as car1 addEventHandler [....]; On the other hand, if you spawn some vehicles during the mission and you want to add this EH on them, you need to check a loop with new vehicles. 1 Share this post Link to post Share on other sites