Jump to content

Recommended Posts

I have this little script i found in a old TXT file i found, i wanted to use it in my game but i can't get it to work,

I Believe that it is counting the civilian that i kill in the game and when i get over 1 killed it will end the game, but i have to kill all the civilian in the game to make the game end.

if i put 8 in the game i have to kill all 8 before the game ends, i want the game to end if i only kill 1 civilian.

 

Does anyone have the solution for me to my problem.

The txt is in my INIT.SQF

 

[] spawn { 
  while {true} do { 
  sleep 3; 
  _cnt = { side _x == civilian } count allUnits; 
  if (_cnt < 1) exitWith {"Loser" call BIS_fnc_endMission};
  } 
}

Share this post


Link to post
Share on other sites
14 minutes ago, Play3r said:

I have this little script i found in a old TXT file i found, i wanted to use it in my game but i can't get it to work,

I Believe that it is counting the civilian that i kill in the game and when i get over 1 killed it will end the game, but i have to kill all the civilian in the game to make the game end.

if i put 8 in the game i have to kill all 8 before the game ends, i want the game to end if i only kill 1 civilian.

 

Does anyone have the solution for me to my problem.

The txt is in my INIT.SQF

 

[] spawn { 
  while {true} do { 
  sleep 3; 
  _cnt = { side _x == civilian } count allUnits; 
  if (_cnt < 1) exitWith {"Loser" call BIS_fnc_endMission};
  } 
}

hey,

i found this:

 

  • Thanks 1

Share this post


Link to post
Share on other sites
26 minutes ago, Alert23 said:

hey,

i found this:

 

THX that did it, funny i didn't find it when i did my search..

  • Like 1

Share this post


Link to post
Share on other sites

Just note that for any killed, as the corpse become civilian, you must use its group: (side group _killed, instead of side _killed). A dead will leave its group after some seconds but it's ok when you apply an event handler.

Share this post


Link to post
Share on other sites

I'd get its faction rather than its group or use bis_fnc_sideid

 

Share this post


Link to post
Share on other sites
On 5/11/2019 at 10:02 PM, Play3r said:

_cnt < 1

 

The reason why it ends when you killed all civilians is this, you check how many are alive and if the number drops below 1 then you end the mission.

  • Like 1

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

×