Jump to content
Sign in to follow this  
jandrews

script to start/stop based on server population

Recommended Posts

_someObject addAction [
   "<t color='#0099FF'>HALO</t>", 
   { call some_halo_fnc; },
   [],
   6,
   true,
   true,
   "",
   "({isPlayer _x} count playableUnits) > 8"
]; 

This should actually work as long as "some_halo_fnc" is an actual function either defined in your functions.hpp or by defining some_halo_fnc = {...} somewhere. Don't know what it is in your case.

this addAction ["Halo", "halo.sqf", [], 6, true, true, "", "((count playableUnits) + (count switchableUnits) < 8)"];

This will not work as you can't call an SQF file just right away. You either need to load and compile it first using compile preprocessFileLineNumbers "someFile.sqf" or you alter the script part of your addAction command like this:

this addAction ["Halo", {[] execVM "halo.sqf";}, [], 6, true, true, "", "((count playableUnits) + (count switchableUnits) < 8)"];

Regarding the condition, "({isPlayer _x} count playableUnits) > 8" should actually work. Don't know what's wrong there. Did you actually test it with 8 other players on a server? You actually need to be 9 players total as it says >8!

Edited by waltenberg

Share this post


Link to post
Share on other sites
This will not work as you can't call an SQF file just right away. You either need to load and compile it first using compile preprocessFileLineNumbers "someFile.sqf" or you alter the script part of your addAction command like this:

I was under the impression that this is exactly how that works...

Share this post


Link to post
Share on other sites
I was under the impression that this is exactly how that works...

And you're right by that.

Either path to the script file, relative to the mission folder or string with code or (since Take On Helicopters) the actual script code.

Share this post


Link to post
Share on other sites

this addAction["<t color='#ff9900'>HALO jump</t>", {"ATM_airdrop\atm_airdrop.sqf"},[],6,true,true,"","({isPlayer _x} count playableUnits) > 8"];

This is how I have it set up. I do not get the option to halo with 1 or 8 players, thanks for the responses everyone.

Share this post


Link to post
Share on other sites

That action will only be enabled if there are more than 8 players. You need to use <

Share this post


Link to post
Share on other sites
That action will only be enabled if there are more than 8 players. You need to use <

forgive me for my error, I guess that would make sense. I find the longer I stare at a monitor the more I miss. I need a vacation. lol

Share this post


Link to post
Share on other sites

this addAction["<t color='#ff9900'>HALO jump</t>", {"ATM_airdrop\atm_airdrop.sqf"},[],6,true,true,"","({isPlayer _x} count playableUnits) < 8"];

This is how I have it set up. It gives me the addaction but does not call halo. Ideas?

Share this post


Link to post
Share on other sites

This should be like this right?:

{null = [] execVM "ATM_airdrop\atm_airdrop.sqf";}
//////////////////

this addAction["<t color='#ff9900'>HALO jump</t>", {null = [] execVM "ATM_airdrop\atm_airdrop.sqf";},[],6,true,true,"","({isPlayer _x} count playableUnits) < 8"];

Share this post


Link to post
Share on other sites
This should be like this right?:

{null = [] execVM "ATM_airdrop\atm_airdrop.sqf";}
//////////////////

this addAction["<t color='#ff9900'>HALO jump</t>", {null = [] execVM "ATM_airdrop\atm_airdrop.sqf";},[],6,true,true,"","({isPlayer _x} count playableUnits) < 8"];

this works, am getting "bad vehicle type" error. not sure what thats about.

Share this post


Link to post
Share on other sites
this works, am getting "bad vehicle type" error. not sure what thats about.

Actually sorry, that line was a combo off all the other stuff in the thread, my bad for copying and pasting :p, below should be more correct:

this addAction["<t color='#ff9900'>HALO jump</t>", "ATM_airdrop\atm_airdrop.sqf",[],6,true,true,"","({isPlayer _x} count playableUnits) < 8"];

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
Sign in to follow this  

×