Bnae 1431 Posted December 30, 2015 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
bull_a 44 Posted December 30, 2015 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 Share this post Link to post Share on other sites
davidoss 552 Posted December 30, 2015 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
Bnae 1431 Posted December 30, 2015 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
Alert23 215 Posted May 7, 2019 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.. 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted May 7, 2019 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. 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted May 7, 2019 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]; }]; 1 2 Share this post Link to post Share on other sites
Alert23 215 Posted May 7, 2019 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! 2 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted May 7, 2019 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! 1 Share this post Link to post Share on other sites
Alert23 215 Posted May 7, 2019 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"}; }; }]; 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted May 7, 2019 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. 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted May 7, 2019 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? 1 Share this post Link to post Share on other sites
Alert23 215 Posted May 7, 2019 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