Jump to content
Sign in to follow this  
iceman77

Score or Kill limit for Coop..

Recommended Posts

I have made an massive Coop...I need to know how to detect when my team has reached a certain Score OR kill limit i.e. 1000 points or 500 kills....so I can end the mission via trigger..

I would prefer to use triggers but a sqs or sqf will do fine..I have searched these forums everywhere..and found some topics on scores..but not quite what iam looking for...

Regards,

Texas

Share this post


Link to post
Share on other sites

Hi there.

why dont you add up the score of all the players in your group..

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = _this select 0;

_gr = group _unit;

_unitsgr = units _gr;

_Totscore=0;

{_Totscore = _Totscore + (score _x ) } forEach _unitsgr;

if (_Totscore >= 500) then

{

//set a variable to end the mission here..

end = "true"

// which is read by another script..

// or execvcm it here..

};

Share this post


Link to post
Share on other sites

k...thanks for the help.Iam still confused with one part though..

Quote[/b] ]//set a variable to end the mission here..

end = "true"

// which is read by another script..

// or execvcm it here..

Forgive me..iam not a scripter..never done it b4..how do I set a variable to end mission??or how do I execvcm it here??

is this SQF or SQS?? ive made an SQS with this block of code...and tryed executing it via trigger but theres errors..guess I need to set a variable to end mission??lol...or??

execvcm it here??Iam confused

Share this post


Link to post
Share on other sites

Hmm..

ok do it something like this..

this is just a example. dont know if it will work for you!

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = _this select 0;

_gr = group _unit;

_unitsgr = units _gr;

SCORELIMIT="false";

while {true} do

{

_Totscore=0;

{_Totscore = _Totscore + (score _x ) } forEach _unitsgr;

if (_Totscore >= 500) then

{

SCORELIMIT="true";

};

sleep 1;

};

save the file into your mission dir and call it "name?.sqf"

open arma editor and put a new triger there..

on the Triggers Condition feald you put: (SCORELIMIT)

And set the Type of the Trigger to end #1 or so..

now on the players init feald you should put.

score=[this] execvm "path/to/script/name.sqf"

or in any other script you might have.

not sure if you need to put SCORELIMIT="false" in ini.sqf though.

you can just test that out.

hope this was helpfull.

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  

×