Home   Help Search Login Register  

Author Topic: Radio commands only for the officer.  (Read 1310 times)

0 Members and 2 Guests are viewing this topic.

mcnils

  • Guest
Radio commands only for the officer.
« on: 19 Jun 2003, 03:28:42 »
Hey ppl, long time..
I have another (like it could be different) of my noob questions!

How do I limit the access of the radio just to the officer player?
I'm making a coop where roles matter very much
(medic revives, engineer repairs, officer has the radio commands etc)
so thats because I need to limit the radio menu access just to one "soldier class"
or player, any 1 knows how to doo this?

Did already search on the forums but nothing,
thx for your time and answer in advance  :)

PheliCan

  • Guest
Re:Radio commands only for the officer.
« Reply #1 on: 19 Jun 2003, 15:25:09 »
Check if the caller och the script initialized by the command, is the same as the owner and if not; exit the script.

Code: [Select]
_owner = _this select 0
_caller = _this select 1
? ( ((vehicle _caller) != _caller) AND (vehicle _caller != _owner) ) : hint "This action belongs to another player", exit
? ( ((vehicle _caller) == _caller) AND (_caller != _owner) ) : hint "This action belongs to another player", exit
« Last Edit: 19 Jun 2003, 15:26:02 by PheliCan »

mcnils

  • Guest
Re:Radio commands only for the officer.
« Reply #2 on: 23 Jun 2003, 23:43:37 »
Hey thanks I will try this!
:)

mcnils

  • Guest
Re:Radio commands only for the officer.
« Reply #3 on: 24 Jun 2003, 00:04:19 »

It says:

'_caller = _this select 1 |#|': Error zero divisor


 :'(

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Radio commands only for the officer.
« Reply #4 on: 24 Jun 2003, 01:01:11 »
errm - if you show the contents of passed parameters
to a script, when executing it by radio-call, you'll see that
there's only one object/owner available.

_owner = _this select 0

there is no: _this select 1

Anyway, i'd suggest you to use the usual way, like it's been
told to others aswell before.

hide the radio-call right from the start by using an init.sqs
file (this will be executed automatically between player selection
and briefing screen).

In that script use:

x setradiomsg "null"
;this will hide the radio-call to all
?(player == leader group player): x setradiomsg "your_text"
exit

:note - x represents the number of the radio-call starting
at 0 = radio-alpha, 1 = radio-brave, etc.

If you set the radiomsg to "null" the radio-call will be disabled.

Now the radio-call should only be available to leaders of
their groups.

~S~ CD
« Last Edit: 24 Jun 2003, 01:03:26 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted