Jump to content
Sign in to follow this  
fhiser

Problems with the Channels Radio's

Recommended Posts

Hello everyone,

 

I've been trying to write a script to create a custom radio. Reading the Arma 3 documentation explains the following:

https://community.bistudio.com/wiki/radioChannelCreate

https://community.bistudio.com/wiki/radioChannelAdd

My problem is to add people to the radio, but according Arma 3 is done as follows:

_index radioChannelAdd [player];

When I put that in, nothing happens. But if I put the name of the character, if that works:

_index redioChannelAdd [civ_1];

I've been breaking my head with this for 3 weeks, to see if anyone can help me.

 

My script:

[player] remoteExec ['life_fnc_radio',RSERV];
private ["_unit","_radio"];

_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;

_radio = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "New Radio", "%UNIT_NAME", []];
_radio radioChannelAdd [_unit];

 

Share this post


Link to post
Share on other sites
1 hour ago, fhiser said:

Hello everyone,

 

I've been trying to write a script to create a custom radio. Reading the Arma 3 documentation explains the following:

https://community.bistudio.com/wiki/radioChannelCreate

https://community.bistudio.com/wiki/radioChannelAdd

My problem is to add people to the radio, but according Arma 3 is done as follows:

_index radioChannelAdd [player];

When I put that in, nothing happens. But if I put the name of the character, if that works:

_index redioChannelAdd [civ_1];

I've been breaking my head with this for 3 weeks, to see if anyone can help me.

 

My script:

[player] remoteExec ['life_fnc_radio',RSERV];
private ["_unit","_radio"];

_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;

_radio = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "New Radio", "%UNIT_NAME", []];
_radio radioChannelAdd [_unit];

 

It appears you are remote executing it to the server

Share this post


Link to post
Share on other sites

Yes saw that too. This is weird.

remember :

when a player remoteexec another player : target need to be the player.

when the server remoteexec a player target need to be the owner of the player.

But in your case why do you even remoteexec, just spawn your code.

[player] spawn life_fnc_radio;

 

Share this post


Link to post
Share on other sites
23 hours ago, Deadlesszombie said:

It appears you are remote executing it to the server

I realized after a while, that code already works for me, but I tried to improve it and it gives me a problem again, I try to put it in an If and it does not go.

26 minutes ago, KR3 said:

Yes saw that too. This is weird.

remember :

when a player remoteexec another player : target need to be the player.

when the server remoteexec a player target need to be the owner of the player.

But in your case why do you even remoteexec, just spawn your code.

[player] spawn life_fnc_radio;

 

I do it with remoteexec because I was posing the script as if it were a mobile, so when I expand it for two players I will have to use it. At the moment I was doing tests on a single player to see if I would be able to do what I want.

 

My  problem now is that if I put everything in an if, it does not work:

private ["_unit","_player","_radio"];

_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
_player = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;

if (call) then {
	_radio = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "New Radio", "%UNIT_NAME", []];
	_radio radioChannelAdd [_unit,_player];
} else {
	hint format ["%1 does not respond",_unit]
};

 

Thx and sorry for my english.

Share this post


Link to post
Share on other sites
7 hours ago, fhiser said:

My  problem now is that if I put everything in an if, it does not work:

private ["_unit","_player","_radio"];

_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
_player = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;

if (call) then {
	_radio = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "New Radio", "%UNIT_NAME", []];
	_radio radioChannelAdd [_unit,_player];
} else {
	hint format ["%1 does not respond",_unit]
};

 

Thx and sorry for my english.

Where is call defined?
And rpt logs?

Share this post


Link to post
Share on other sites

Just add it into life_server\Functions\Systems\fn_manageSc.sqf
That'll add the people using the default Altis Life system although you will have to assign your radio to a variable after you create it.

Example:
life_server\Functions\Systems\fn_manageSc.sqf
 

/*
    File: fn_manageSC.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    User management of whether or not they want to be on a sidechat for their side.
*/
private ["_unit","_bool","_side"];
_unit = [_this,0,objNull,[objNull]] call BIS_fnc_param;
_bool = [_this,1,false,[false]] call BIS_fnc_param;
_side = [_this,2,civilian,[west]] call BIS_fnc_param;

if (isNull _unit) exitWith {};

switch (_side) do {
    case west: {
        if (_bool) then {
            life_radio_west radioChannelAdd [_unit];
        } else {
            life_radio_west radioChannelRemove [_unit];
        };
    };

    case civilian: {
        if (_bool) then {
            life_radio_civ radioChannelAdd [_unit];
        } else {
            life_radio_civ radioChannelRemove [_unit];
        };
    };

    case independent: {
        if (_bool) then {
            life_radio_indep radioChannelAdd [_unit];
        } else {
            life_radio_indep radioChannelRemove [_unit];
        };
    };
};

life_radio_custom radioChannelRemove [_unit]; //Not sure if this is needed or not ¯\_(ツ)_/¯
life_radio_custom radioChannelAdd [_unit];

In life_server\init.sqf

After: 

/* Setup radio channels for west/independent/civilian */
life_radio_west = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
life_radio_civ = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
life_radio_indep = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];

Insert:

life_radio_custom = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "New Radio", "%UNIT_NAME", []];

Untested, don't know if it will work.

Edited by Burni Zarzof
  • Like 1

Share this post


Link to post
Share on other sites

If this issue has been resolved, please confirm and reply with the resolution. This topic will be closed if no reply is given in 72 hours.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×