Jump to content
Sign in to follow this  
Bnae

Kill count

Recommended Posts

Hi,

 

I need a counter for my CO-OP mission. When i kill enemy, just a simple hint that shows how many kills i have. Civilians as -1 and EAST as +1.

Going to use this to activate other script every 10 kills.

 

So you can think this as "leveling".

 

More simpel version could be:

 

10 kills: nul = [] execVM "levels/levelup.sqf"

20 kills: nul = [] execVM "levels/levelup1.sqf"

30 kills: nul = [] execVM "levels/levelup2.sqf"

And so on..

 

---------

UPDATE

 

Got it working by myself, thanks.

Share this post


Link to post
Share on other sites

Oh i am working on some thing like this. No luck for now. Cant get eventhandler to work.

Share this post


Link to post
Share on other sites

I would start with looking at the MPKilled event handler. You can use it to spawn code (or execute a counter function) when a unit is killed.

 

Bull

 

That will do it, thanks!

Share this post


Link to post
Share on other sites

UPDATED

Share this post


Link to post
Share on other sites
On 12/30/2015 at 7:45 PM, Bnae said:

Hi,

 

I need a counter for my CO-OP mission. When i kill enemy, just a simple hint that shows how many kills i have. Civilians as -1 and EAST as +1.

Going to use this to activate other script every 10 kills.

 

So you can think this as "leveling".

 

More simpel version could be:

 

10 kills: nul = [] execVM "levels/levelup.sqf"

20 kills: nul = [] execVM "levels/levelup1.sqf"

30 kills: nul = [] execVM "levels/levelup2.sqf"

And so on..

 

---------

UPDATE

 

Got it working by myself, thanks.

 

very sry that i digged up an old thread, but this is exactly what im looking for but Unfortunately you dident provide the solution i hope some1 else can point me in the right direction.

especially this part:

Quote

 

10 kills: nul = [] execVM "levels/levelup.sqf"

20 kills: nul = [] execVM "levels/levelup1.sqf"

30 kills: nul = [] execVM "levels/levelup2.sqf"

And so on..

 

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Alert23 said:

but Unfortunately you dident provide the solution

 

Yes , that's true !

check on @Larrow's dropbox :

https://www.dropbox.com/sh/s0mt4axhvuy9nje/AACF4YErWTAEL7CmfxDnmC6aa?dl=0&preview=playerExperience.VR.zip

-I don't know if this is a solution though for your needs.

  • Thanks 1

Share this post


Link to post
Share on other sites

here is my example :

 

addMissionEventHandler ["EntityKilled", {

    params ["_killed", "_killer", "_instigator"];

    if (!isPlayer _killer or _killed isEqualto _killer) exitWith {};
	
	_score = score _killer;
	
	_Rank = "";
	switch true do {

		case((_score >= 0) && (_score < 10)) : {_Rank = "PRIVATE";};
		case((_score >= 10) && (_score < 20)) : {_Rank = "CORPORAL";};
		case((_score >= 20) && (_score < 30)) : {_Rank = "SERGEANT";};
		case((_score >= 30) && (_score < 40)) : {_Rank = "LIEUTENANT";};
		case((_score >= 40) && (_score < 50)) : {_Rank = "CAPTAIN";};
		case((_score >= 50) && (_score < 60)) : {_Rank = "MAJOR";};
		case(_score > 70) : {_Rank = "COLONEL";};
	};	
	
	hintsilent format["%1",_Rank];
}];

 

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
32 minutes ago, GEORGE FLOROS GR said:

here is my example :

 


addMissionEventHandler ["EntityKilled", {

    params ["_killed", "_killer", "_instigator"];

    if (!isPlayer _killer or _killed isEqualto _killer) exitWith {};
	
	_score = score _killer;
	
	_Rank = "";
	switch true do {

		case((_score >= 0) && (_score < 10)) : {_Rank = "PRIVATE";};
		case((_score >= 10) && (_score < 20)) : {_Rank = "CORPORAL";};
		case((_score >= 20) && (_score < 30)) : {_Rank = "SERGEANT";};
		case((_score >= 30) && (_score < 40)) : {_Rank = "LIEUTENANT";};
		case((_score >= 40) && (_score < 50)) : {_Rank = "CAPTAIN";};
		case((_score >= 50) && (_score < 60)) : {_Rank = "MAJOR";};
		case(_score > 70) : {_Rank = "COLONEL";};
	};	
	
	hintsilent format["%1",_Rank];
}];

 

thank ou very much George for ur help!

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

I was writing as well a rank script with @Chuc

but i forgot to finish this by the way and i think it's time to do this as well!

 

  • Like 1

Share this post


Link to post
Share on other sites

what im trying to do is this

if you kill 10,20,30 and so on.. zombies u get a reward something like this

addMissionEventHandler ["EntityKilled",{

params ["_killed", "_killer", "_instigator"];

if (isPlayer _killer && side group _killed isEqualTo resistance) then {

	
switch true do {  
    	case "10": {player execVM "Rewardfor10.sqf"};  
    	case "20": {player execVM "Rewardfor20.sqf"}; 
    	case "30": {player execVM "Rewardfor30.sqf"};                         
	case "40": {player execVM "Rewardfor40.sqf"};
};

}];

 

  • Like 1

Share this post


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

player execVM "Rewardfor10.sqf"

 

just follow the code above and add _killer instead of player.

also in the exitwith add your code if it's not independent.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Alert23 said:

and so on.. zombies

 

you can also do  , ex :

Zombie_List = [
	
	//	Ravage zombies
	"zombie_bolter",
	"zombie_runner",
	"zombie_walker"
	]; 


if ((typeOf _killed) in Zombie_List)then{

but you might refer to RyanZombies , right?

  • Like 1

Share this post


Link to post
Share on other sites
9 minutes ago, GEORGE FLOROS GR said:

 

you can also do  , ex :


Zombie_List = [
	
	//	Ravage zombies
	"zombie_bolter",
	"zombie_runner",
	"zombie_walker"
	]; 


if ((typeOf _killed) in Zombie_List)then{

but you might refer to RyanZombies , right?

Yes exactly.

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  

×