Home   Help Search Login Register  

Author Topic: Vehicle locked to "wrong" units  (Read 1661 times)

0 Members and 1 Guest are viewing this topic.

Offline Speeder

  • Members
  • *
    • OFP.nu
Vehicle locked to "wrong" units
« on: 11 Apr 2005, 18:28:05 »
I was kinda hoping that someone would make a script for me.

It need to do the following:

Only pilots can enter as driver/gunner in chopper

only crew can enter as driver/gunner in amored vehicles.

If a nother unit than the one defined tries to enter as driver/gunner, they should be disembarked, but the message that they are not certified to oberate the kind of vehicle.


I think the units I'm using are the ones starting with SUCH-    that is SuchSoldier   Suchcrew - or something like that..

Thanks for the help

PS: script must be MP compatible
« Last Edit: 11 Apr 2005, 18:28:34 by Speeder »
There are 10 kinds of people in this world. Those who get it, and those who don't.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Vehicle locked to "wrong" units
« Reply #1 on: 11 Apr 2005, 22:22:00 »
add a getin eventhandler per vehicle, basically this runs a script, it questions either the unit variable name or class of unit and if it isnt a desired unit type, ejects them
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Speeder

  • Members
  • *
    • OFP.nu
Re:Vehicle locked to "wrong" units
« Reply #2 on: 12 Apr 2005, 15:27:29 »
Could you please write it a bit more like a walkthrough...tut or something like that - I never used an eventhandler before, I know nothing about them
There are 10 kinds of people in this world. Those who get it, and those who don't.

Offline Speeder

  • Members
  • *
    • OFP.nu
Re:Vehicle locked to "wrong" units
« Reply #3 on: 12 Apr 2005, 16:28:26 »
I can't get it to work.. Tried everything exept the right thing :)

I write this in the init of MyHeli1

MyHeli1 AddEventHandler ["getin", {[] exec "allowGetIn.sqs"}]


This is my allowGetIn.sqs

_vehicle = _this select 0
_pos = _this select 1
_who = _this select 2


#tjek0
? _pos != cargo : Goto "tjekname" ELSE exit


#tjekname
?(_who) != (name pilot1) OR (_who) != (name pilot2) : Goto "Ejectplayer" ELSE exit



#Ejectplayer

(_who) action ["EJECT",_vehicle]

exit



What am I doing wrong?
There are 10 kinds of people in this world. Those who get it, and those who don't.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Vehicle locked to "wrong" units
« Reply #4 on: 12 Apr 2005, 16:31:51 »
The syntax

? : else

is not correct.   You can use

if then else

but check the syntax.   Although if then does much the same thing as ? :, the two are not interchangeable.

I am not familiar with eventhandlers and scripting in MP so this may be a redundant comment, but make sure that your script will eject the loon on all computers, not just locally.
« Last Edit: 12 Apr 2005, 16:33:11 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Vehicle locked to "wrong" units
« Reply #5 on: 12 Apr 2005, 19:36:34 »
Try:

MyHeli1 AddEventHandler ["getin", {_this exec "allowGetIn.sqs"}


That might work better......maybe  ;D


Planck
I know a little about a lot, and a lot about a little.

Offline Speeder

  • Members
  • *
    • OFP.nu
Re:Vehicle locked to "wrong" units
« Reply #6 on: 20 Apr 2005, 09:17:22 »

If I want to add the eventhandler to all units on one side, could I then use this?


?side _x == east foreach Thislist : "_x addeventhandler [""killed"",{civdied = civdied + 1}]"

or what is the syntax?
There are 10 kinds of people in this world. Those who get it, and those who don't.