OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: Grimfist on 26 Sep 2009, 21:38:59
-
Yo, i am making a mission, and i have come to two barriers that i cant pass, so id thought id post them here. i want a script that checks if the unit is one of the units in an array when boarding a vehicle into the DRIVER, COMMANDER OR GUNNER seats (if there in passenger script is not to run), if they are then nothing happens, if they arnt then they are thrown out of the vehicle. this is what i have:
when any unit boards a vehicle script starts and checks if _unit is not one of the dudes in aray of 'EL, EN1, EN2'
then _soldier action ["eject", vehicle soldier];
display hint 'yo mofo, you cant drive that.'
http://community.bistudio.com/wiki/action
http://community.bistudio.com/wiki/isKindOf
http://community.bistudio.com/wiki/typeOf
http://community.bistudio.com/wiki/driver
http://community.bistudio.com/wiki/lockDriver
http://community.bistudio.com/wiki/assignedDriver
I need some help compiling this, TIA,
grim.
plz can sum1 help, or direct me to some recorces?
SOLUTION
array = _this;
_vehicle = _this select 0;
_position = _this select 1;
_man = _this select 2;
if (!(_man in [p1,p2,p3]) && _position != "cargo") then
{
hint format ["Hey %1, you asshat, only engineers can drive vehicles.",name _man];
_man action ["eject",_vehicle];
};
-
Hey. I am having the same problem sorta.
I will be hosting a server soon and I don't want players who connect to be able to DRIVE a two specific buses I have running throughout the map but they can only be passangers...Is this even possible at all?
I have tried for example in the vehicle's Init line
(Chernarus1 lockDriver true
This command seems not to work not matter I do or how I configure it
Also is it possible to take away the "Get in as Driver" from the action menu?
-
SOLUTION
array = _this;
_vehicle = _this select 0;
_position = _this select 1;
_man = _this select 2;
if (!(_man in [p1,p2,p3]) && _position != "cargo") then
{
hint format ["Hey %1, you asshat, only engineers can drive vehicles.",name _man];
_man action ["eject",_vehicle];
};
Can you give more details on how you are running your solution? Where and how is the script executed?