Search the Community
Showing results for tags 'radiochannelcreate'.
Found 1 result
-
help Script error when adding Radio Channels for Zeus to Squad
Sweetwater.I posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, I'm trying to make heads or tails of getting around an error that I'm getting when attempting to make Radio Channels to specific units to private communication between Zeus to Squad Leaders. The error is that the variables are undefined for the radioChannelCreate when the unit with the variable does not exist. I'm thinking I will need a !isnull check to an array but I'm unsure how to implement this as I am still very new to Arma scripting. Here is the code I am using, Most of this is from a script I found on another post: if(isServer) then { west_channel = radioChannelCreate [[0, 0.2, 1, 1], "GM-Bluefor", "Game Master", [bz1,bz2,mz1,mz2]]; east_channel = radioChannelCreate [[1, 0, 0.2, 1], "GM-Redfor", "Game Master", [rz1,mz1,mz2]]; independent_channel = radioChannelCreate [[0, 1, 0.2, 1], "GM-Independent", "Game Master", [iz1,mz1,mz2]]; RADIO_fnc_manage = { private["_unit","_channel","_bool"]; _unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param; _bool = [_this,1,false,[false]] call BIS_fnc_param; _channel = [_this,2,0,[0]] call BIS_fnc_param; //Series of checks? if(isNull _unit) exitWith {}; //Null unit if(_channel < 1) exitWith {}; //No channels below 1 should be passed. switch (_channel) do { case 1: { if(_bool) then {west_channel radioChannelAdd [_unit];} else {west_channel radioChannelRemove [_unit];};}; case 2: { if(_bool) then {east_channel radioChannelAdd [_unit];} else {east_channel radioChannelRemove [_unit];};}; case 3: { if(_bool) then {independent_channel radioChannelAdd [_unit];} else {independent_channel radioChannelRemove [_unit];};}; }; }; }; Variables "bz1, bz2, mz1, mz2, iz1, rz1" is referencing unit's I've placed within Eden Editor with those variables tagged to them. E.g, "bz1" = Blufor Zeus or "mz1" = Master Zeus The intention of this script is to allow private communication from Squad leaders. (In this case bz1,bz2,iz1,rz1) to have separate channels to the two Master Zeus's which will be acting as "game masters" That is not seen by anyone outside of the units aforementioned. > I am using RHS, ACE, CBA Pack, ARES:Achilles and TFAR mod's as well.- 11 replies
-
- radiochannelcreate
- scripting
-
(and 2 more)
Tagged with: