Thanks Placid, I didn't realize that, and looking at it now I've facepalmed.
On page 5 NEO says limiting support is not possible with the current setup. one would need to play with the scripts a bit... maybe make a counter for player, and when their number of calls are up, remove the action and eventhandler?
Now I am in no way an 'arma scripter', I know enough to be dangerous and occasionally crash my game as soon as I hit 'preview'.... However, if I were going to attempt this, I would probably start with how to create a variable that can be accessed from the different scripts. I have no experience with variable scopes, or ones made specifically for multiplayer or anything... so I'm just going to go with vague programming pseudo code / project goal type layout here.
Use a variable to hold a counter for each player. I wouldn't be the person to ask what the best way to do this is.
Retrieve this variable when the player attempts to make a support call.
radio_action.sqf would be a good place to stop them, before the createDialog (Sorry, you cannot call support at this time) You would essentially wrap createDialog inside of an if conditional. if they can make the call, let em. if not, dont.
Another option would be to remove the eventhandler / removeaction from the player once the counter is up, and add it later if so desired.
Add 1 to the count after the player successfully gives an asset an instruction. functions\ui\cas\fn_casConfirmButton.sqf ? looks like this would be a good place to add a counter. It's executed when the unit calls support. One could theoretically do it ALL in here, and a conditional would exist close to the bottom to either A) have the player call for support as it is now, or B) inform the player they cannot request support at this time.
That's just a place to start, and probably how I would start working on that feature. I've only been playing Arma2 for about 2 months now, and with work and kids I haven't had time to do much anyways... so I can't say this is the best method, or if it would even work... but that's what programming / scripting is all about. It can be done. and it can probably be done fairly easily by someone more experienced with the workings of arma scripting... but if I were looking to implement this feature into this script package, that's where I would begin.
Edit : I'm going to give it a go. I dunno if it'll work, but its worth a shot...
Oh look at that. it worked.
I cannot guarantee it works on multiplayer, YMMV.
NEO_radio\init.sqf
player addAction (NEO_radioLogic getVariable "NEO_radioPlayerActionArray");
player addEventHandler ["Respawn", { (_this select 0) addAction (NEO_radioLogic getVariable "NEO_radioPlayerActionArray") }];
[color="#B22222"] player setVariable ["cascalls", 3];[/color]
player createDiarySubject ["About", "About"];
NEO_radio\functions\ui\cas\fn_casConfirmButton.sqf
_coord = _pos call BIS_fnc_posToGrid;
[color="#B22222"]
_casVariable = player getVariable "cascalls";
if (_casVariable > 0) then {[/color]
//New Task
[color="#B22222"]_casVariable = _casVariable - 1;
player setVariable ["cascalls", _casVariable];
[/color]
_veh setVariable ["NEO_radioCasNewTask", [_task, _pos, _radius, _flyInHeight], true];
[player, format ["%1, this is %2. We need imediate CAS at position. Over.", _callsign, _callSignPlayer, _coord select 0, _coord select 1], "side"] call NEO_fnc_messageBroadcast;
//Interface
[lbCurSel 655565] call NEO_fnc_radioRefreshUi;
[color="#B22222"]}
else
{
hint "Sorry. you're SOL";
}[/color]
Since the UI stays open after each call, I would recommend closing it after pressing confirm. This would allow you to block it from opening again in another script.
closeDialog 0; in the success block instead of the call to NEO_fnc_radioRefreshUI
then you can make your radio_action look like this:
NEO_radio\radio_action.sqf
//Action Variable
uinamespace setVariable ["NEO_radioCurrentAction", (_this select 3)];
[color="#B22222"]_casVariable = player getVariable "cascalls";
if (_casVariable > 0) then {[/color]
//Open Interface
createDialog "NEO_resourceRadio";
[color="#B22222"]}
else
{
_sidemsg = text format["%1, support is not available at this time", name player];
format["%1",_sidemsg] call XfHQChat;
}[/color]
as you can see from the XfHQChat call, I used Domination as a testing bed for this. Create your message as you see fit.
In regards to calling support when contact is made... hmm. for this, you may consider removing the addaction and addeventhandler from NEO_radio\init.sqf and instead creating a TRIGGER: detected by Opfor, on activation, add the action (and eventhandler if desired) That should do.