Home   Help Search Login Register  

Author Topic: execing thru trigger by anyone but only him  (Read 575 times)

0 Members and 2 Guests are viewing this topic.

Celeriac

  • Guest
execing thru trigger by anyone but only him
« on: 20 Aug 2004, 23:07:08 »
Ey people.  ;)

I guess the topic reveals the most of my problem, which is as follows:
I want a trigger to be activated by anyone in a game that comes into its radius, and then making the man exec a script, but only him, not anyone else at that time. But I donÂ't know a way how to write it in OFP language. player exec "script.sqs" makes all players in a map to exec the script.

Any guidance, please?

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:execing thru trigger by anyone but only him
« Reply #1 on: 20 Aug 2004, 23:16:48 »
Make sure the trigger activation is only once (not repeatedly), then in the on activation field put:

thislist exec "script.sqs"

Then in your script make the first lines this:

_unitarray = _this

_unit = _unitarray select 0


.....rest of script is done by _unit


The reason for the _unitarray is because thislist is always an array even if it is only one unit.  The _unit = _unitarray select 0 converts that array into a singe unit, or the first unit if somehow more than one unit enters the trigger at the exact same time.

Hope this helps you.


Celeriac

  • Guest
Re:execing thru trigger by anyone but only him
« Reply #2 on: 21 Aug 2004, 00:16:05 »
I will beta test asap.  :)

Celeriac

  • Guest
Re:execing thru trigger by anyone but only him
« Reply #3 on: 22 Aug 2004, 14:57:02 »
It works! Thank you mate!  ;D

Now I can finish my deathmatch.