OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The-Architect on 10 Mar 2005, 23:06:19

Title: Got radio?
Post by: The-Architect on 10 Mar 2005, 23:06:19
I'm using an addon which has a radio as one of the usable weapons. How do I check if a player has the radio and if so/not make using the 0-0-x possible or not possible?

My radio messages are hidden until triggers are hit if that helps.

Cheers.
Title: Re:Got radio?
Post by: macguba on 11 Mar 2005, 00:21:10
Use a hasWeapon command to check if he has the radio.

Then setRadioMsg either null or text as appropriate.
Title: Re:Got radio?
Post by: The-Architect on 11 Mar 2005, 02:43:06
Cheers Macguba.
Title: Re:Got radio?
Post by: The-Architect on 11 Mar 2005, 09:09:40
Another question.

How do I check to see if anyone from my group has the radio. I don't want to have to lug it around all the time.
Title: Re:Got radio?
Post by: Blip on 11 Mar 2005, 09:14:53
I found this in the SEB NAM pack Readme.  It should detect if one of the units in your group is carrying the radio.

Quote
;start radio check--------------------------
;check for radio
_unitarray= units group player
?("_x hasweapon {sebprc25}" count _unitarray)>0:goto "hasradio"
hint "No Radio present"
exit
#hasradio
Hint "Radio Active"

you will have to change the radio though.

Blip :joystick: