Jump to content
Sign in to follow this  

Recommended Posts

Hey guys ive been searching the forum for an hour by now but I cant seem to find any answer...

I need some kine of kill counter... when a player kills one from the other team he gets +1 ... when he then dies its reset... the reason I want this is becasue I want to add bonuses when a player have killed like 10 - 20 - 40 and so on.. but when he dies its reset.

Anyone who can help me with this? :rolleyes:

Ive tried with:

counter = counter+1; {_x addeventhandler ["killed", "hint format[""%1 have killed %2"",_this select 1,counter]"]} foreach thislist

But it dosent really work and im afraid when I fire up the server in multiplayer mode it wouldnt work either...

Share this post


Link to post
Share on other sites

Sure this is possible. There are a lot of ways to do what you want. Here is one of them. Have not tested in MP, but think it should work

Kill counter example

Share this post


Link to post
Share on other sites

Cant really seem to get it working... I dont have anything else than AI's to test up against... but even by enabling AI nothings pop's when killing og beeing killed...

---------- Post added at 10:08 PM ---------- Previous post was at 10:03 PM ----------

May have found some interesting thing here: http://armaholic.com/forums.php?m=posts&p=4772#4772

Might be able to rewrite the thing to count player kills insted of team kills...

Share this post


Link to post
Share on other sites

Just put the counter inside the handler. Then you'll need to call on it from there:

hint format ["%1 kill streak", counter];

if (killed == player) then {counter = 0;};

if (counter == 1252) then {giveNuke player;};

and so on;

If it's to be MP, each player will need their own variable.

Then you'll need to add a huge obnoxious graphic to plaster across the screen each kill to make it really cod-like.

Share this post


Link to post
Share on other sites
Cant really seem to get it working... I dont have anything else than AI's to test up against... but even by enabling AI nothings pop's when killing og beeing killed...

---------- Post added at 10:08 PM ---------- Previous post was at 10:03 PM ----------

May have found some interesting thing here: http://armaholic.com/forums.php?m=posts&p=4772#4772

Might be able to rewrite the thing to count player kills insted of team kills...

Certainly it doesn't work with AI! :) Why, do you think, AI is switched of?

To make it work with AI, you have to put the next string in editor in playable units initialization field:

this setVariable["KilledBy","",true];

this addEventhandler ["killed",{(_this select 0) setVariable ["KilledBy",name (_this select 1),true];}];

But this is ONLY for TESTS.. if You want to try it with real players, you should remove this lines and switch of AI.

Edited by WINSE

Share this post


Link to post
Share on other sites

WINSE> Works great... thx...

This line:

for [{_i=1},{_i<=5},{_i=_i+1}] do

am I right if I change the _i<=5 to the number of playable spots?

EDIT: Ye I had to :)

Edited by RonnieJ

Share this post


Link to post
Share on other sites
am I right if I change the _i<=5 to the number of playable spots?

Yep.. _i<=5 is number of players per side.. And if you wanna add some playable units, don't forget to name them es1,es2..es# for east, and ws1,ws2..ws# for west..

Share this post


Link to post
Share on other sites

Ye its all working like a charm atm. :) thx alot

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  

×