Home   Help Search Login Register  

Author Topic: Force Eject script help. [SOLVED]  (Read 2844 times)

0 Members and 1 Guest are viewing this topic.

Offline Grimfist

  • Members
  • *
    • Armaholic
Force Eject script help. [SOLVED]
« 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

Code: [Select]
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];
};



« Last Edit: 28 Sep 2009, 09:53:27 by Grimfist »

Offline ViccyQ

  • Members
  • *
Re: Force Eject script help. [SOLVED]
« Reply #1 on: 16 Aug 2010, 16:08:11 »
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

Code: [Select]
(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?

Offline doomanchu

  • Members
  • *
Re: Force Eject script help. [SOLVED]
« Reply #2 on: 24 Oct 2010, 01:52:11 »
SOLUTION

Code: [Select]
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?