![]() |
sayMessageTo script help
Trying to send radio voice (saygroup) messages to each person in a given army. Code has no compile errors but doesn't voice to players? Any help appreciated.
Code:
private void sayMessageTo(int army, string msg) |
Your error:
if (SaidToGroup == true) return; you leaving the method, but i think you will only leave the foreach, so you must use: if (SaidToGroup == true) break; and g.candidates() returns AiAirGroup[] so you should use GetItems() to get the Actors. Corrected code: Code:
private void sayMessageTo(int army, string msg) |
Thanks Kodiak. I altered the script (below x 2) to eliminate if/break issues. Still doesn't work though :( It's as though the GamePlay.gpAirGroups(army) call is not returning any valid aircraft?
Code:
private void sayMessageTo(int army, string msg) Code:
private void sayMessageTo(int army, string msg) |
try my correction above, it should work.
GamePlay.gpAirGroups(army) returns AiAirGroup[] AiAirGroup.Candidates returns AiAirGroup[] You need an Actor (AiAircraft) for saytogroup so you should use AiAirGroup.GetItems() returns AiActor[] you get no error because AiAirGroup is also an Actor, but in these case the wrong one. |
Yes, above example works. Thankyou again Kodiak :)
|
All times are GMT. The time now is 02:35 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.