OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: mcnils 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 :)
-
Check if the caller och the script initialized by the command, is the same as the owner and if not; exit the script.
_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
-
Hey thanks I will try this!
:)
-
It says:
'_caller = _this select 1 |#|': Error zero divisor
:'(
-
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