Home   Help Search Login Register  

Author Topic: Question about radio commands  (Read 1064 times)

0 Members and 1 Guest are viewing this topic.

FancyPants

  • Guest
Question about radio commands
« on: 22 Jan 2004, 03:33:18 »
Hello,

I am working on a MP-friendly script that will allow a chopper to come flying to somebody, refuel and repair them, then go back home. The movement, landing, refueling and repairing works perfect. What I can't figure out is how to detect which player activated the trigger that called the script. The trigger's activation is on radio alpha, so I can't just get the nearest player to the trigger... I tried the units command but to no availe. Maybe I was doing it wrong? Anywho, any help would be apreciated!

Thanx,
Me.

slowworm

  • Guest
Re:Question about radio commands
« Reply #1 on: 22 Jan 2004, 20:34:59 »
I didn't try it: Maybe thislist select 0 (at the trigger) works?

to call a script:
[thislist select 0] exec "scriptname.sqs"

It is possible that you have to give thislist to an array first (don't know if). That would be:
arrayname = thislist; [arrayname select 0] exec "scriptname.sqs"

(arrayname select 0 gives the first item of an given array "arrayname")


In your script, you would get the unit with
_anyname = _this select 0

(The "_" before the name means this variable is local to the script.
_this is an array of the given parameters when calling the script.)
 

I didn't work with "thislist" and arrays myself by now, so I don't know if it will work this way.
Anyway, hope it helps a bit.

cu slowworm

« Last Edit: 22 Jan 2004, 20:57:03 by slowworm »