Jump to content
Sign in to follow this  
hogmason

hint based on array values

Recommended Posts

hi i have an array containing all my dynamically spawned POWS i have a script to show how many pows are still in captivity

i tried the below but i get returned

"scalar POWs still in captivity"


_trg = createTrigger ["EmptyDetector", position player]; 
_trg setTriggerText "POW's Left"; 
_trg setTriggerActivation ["ALPHA", "PRESENT", true]; 
_trg setTriggerStatements ["this", '
hint parseText format["%1 <t color=""#80FF00"">POWS''s</t> still in captive.", count POW_array]
', ""];

i should add that the above works in single player fine but not on a dedi thats when i get scalar returned instead of a number

Share this post


Link to post
Share on other sites

You need to make sure POW_array exists in all machines, example:

//Lets suppose we are running this piece of code in the server only

POW_array = [];
//POW_array exists only on the server...

publicVariable "POW_array";
//POW_array exists everywhere, including join in progress...

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  

×