OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Alan34 on 23 Mar 2003, 16:05:04

Title: Limit Radio use
Post by: Alan34 on 23 Mar 2003, 16:05:04
What is the best way to limit radio use to the Group Leader?
Title: Re:Limit Radio use
Post by: macguba on 23 Mar 2003, 17:34:20
I have a hazy recollection that only the group leader can use it anyway ...... is this a multiplayer question?
Title: Re:Limit Radio use
Post by: Alan34 on 23 Mar 2003, 17:48:00
It is a MP mission and currently anyone can use the radio (others have to access it from Map/Radio) but still anyone can use it.  I need to restrict it to Group Leader.
Title: Re:Limit Radio use
Post by: Ranger on 24 Mar 2003, 20:12:30
What happens when the radio call is activated?  If you execute a script, then the script can check if the radio caller is the group's leader.

In your script, you can add the following code at the beginning:

? (leader player != player) : exit

This checks if the player (the unit causing the script to be executed) is the leader of his respective group.  If not, then the script will exit.