OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ace Productions on 04 May 2004, 07:41:29

Title: Who's who
Post by: Ace Productions on 04 May 2004, 07:41:29
Hi again,

When using the "getin" EH it returns the unit that entered the vehicle. I've tried in my script to put the condition if this unit is the player then to do something:

?(_unitname==player)

OR

_myunit=player
?(_unitname==_myunit)

but nothing!

Can someone please help me?
 

Title: Re:Who's who
Post by: h- on 04 May 2004, 08:31:09
How do you 'launch' the EH and the sript?

...["getin",{_this exec "srcipt.sqs"}]

then

_unitname = _this select 0

?_unitname == player: sumtin happens...

 ???
Title: Re:Who's who
Post by: Ace Productions on 04 May 2004, 08:35:11
Thanks HateR_Kint but as I wrote in my post I've tried that already without any luck.
Title: Re:Who's who
Post by: h- on 04 May 2004, 08:48:28
It was more of a question...

But, if you substitute the _this select 0 with _this select 2 it should work...

0 is the vehicle on which the getin EH is 'attached' and 1 is the position (gunner/driver/commander/cargo...)...
Just checked the EH tute at Ed Depot...  ;)
Title: Re:Who's who
Post by: Ace Productions on 04 May 2004, 09:04:06
My friend HateR_Kint I've already done all that but it seems it doesn't like the ?(_unitname==player) line.
Title: Re:Who's who
Post by: h- on 04 May 2004, 10:07:01
Well, it worked for me just fine...
I had an jeep with the getin EH and it ran this code:

Code: [Select]
_unitname = _this select 2

hint format ["%1",_unitname]
~1

?_unitname == player: hint "wupdiduu"

And it worked fine...
No error msgs or anything...

There's bound to be some errors in your syntaxes...  ???
Title: Re:Who's who
Post by: Ace Productions on 04 May 2004, 14:33:11
I'll try it again tonight and let you know tommorow. Thanks a lot anyway for your many replies today.
Title: Re:Who's who
Post by: Ace Productions on 08 May 2004, 18:16:09
HateR_Kint u were perfectly right.

Thanks again.