Jump to content
Sign in to follow this  
psychownage

noob question with counting

Recommended Posts

Hi,

I have searched and read several examples, but none seem to work for me. I am desperately needing some help. Here goes

lawl = count rofl

hint format ["%1",lawl];

i have a trigger in middle of a town, set to activate opfor and called it rofl

I have a radio command to call the above script.

The script runs, but displays the word "any" instead of counting how many opfor soldiers are within in the trigger rofl.

The opfor are already there to begin with and I need it to display how many are left.

As I said i followed/copied various examples that people have already given. I am using OA but i cant see why that should make it any different!

thanks for your time

Share this post


Link to post
Share on other sites

Hi mate... this might be one way.

Put this in your triggers OnAct:-

nul = [thislist] execVM "yourscript.sqf";

and yourscript.sqf might be:-

_list  = _this select 0;
hint format ["%1",count _list];

The trigger passes an array... or list of objects in the trigger to your script with [thislist] execVM "yourscript.sqf".

In your script you are assigning that array to a variable called _list (it can be anything) with _list = _this select 0.

Since this list is an array we can count how many items are in it with count _list

.....and I pretty much think you've got the hint sussed!

EDIT: After reading your question again... I think I might have actually complicated that for you. LoL.... see how you get on.

Edited by twirly
Added stuff

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  

×