Jump to content
Purzel

customchat and this list

Recommended Posts

hello,
I´m not good at scripting.
I want to fire a trigger when BLUFOR is in range to send a customchat only to the players (alpha1, 2, etc.) which are inside the trigger area.

 

So I tried this:

mySuperCoolRadio = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Radio", "Reporter", [alpha1,alpha2]];   // to be continued
alpha1 customChat [mySuperCoolRadio, "I´m glad you´re here, they would have killed us!"];

so far so good, this will give me a customchat to all listed players (alpha1,2,3,up to 6 teams with each 10 players.).

So here´s the question:

Can I change the trigger and the customchat to be only seen by the players, which are inside the trigger area?
I thought about something with _x thislist... but I can´t get it working...
I want to use it as a "spoken word", because I dont´t want to get the mission too big with sounddata and say3d-stuff.

mySuperCoolRadio = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Radio", "Reporter", [something with thislist]]; 

If there are 60 players, only the nearest players (inside area-trigger) should be able to hear the message...

Any help is appreciated...

 

Greetz Purzel

Share this post


Link to post
Share on other sites

thisList is an array,

radioChannelCreate requires an array of units to be added upon creation of the channel.

so you could do : 

mySuperCoolRadio = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Radio", "Reporter",thisList]; 

in the activation. This would add the current players in the trigger area at the time of activation.

  • Thanks 1

Share this post


Link to post
Share on other sites

ok... THX!

 

But it does not work, when I put your code into a script (.sqf)
Your code goes into the script,

but do I have to put something more into the trigger fields?

 

 

just BLUFOR present

condition "this"

activation: Link to the script.sqf

 

Share this post


Link to post
Share on other sites
5 hours ago, purzel said:

ok... THX!

 

But it does not work, when I put your code into a script (.sqf)
Your code goes into the script,

but do I have to put something more into the trigger fields?

 

 

just BLUFOR present

condition "this"

activation: Link to the script.sqf

 

it needs to be passed into the script:

[thisList] call compile preProcessfile "MyCoolLister.sqf";

in the script you an utilize it like this:

params["_list"];
{
sytemChat format["%1",_x]; 
} forEach _list;

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×