[HELP]Killstreak Timer
#1

Hi all, I am trying to make a double-kill/triple-kill/etc. system. I am wondering how to make it so that if a player kills another player it would start a timer and if a player gets a kill within the time (5 seconds) the timer will reset and it will add to the players 'killstreak'. If the killstreak is 2 it will say double-kill and if the streak is 3 it will say triple-kill and anything after that it will say rampage. Once the timer ends the killstreak is set back to '0'.
Reply
#2

You'd be better off with using ticks than a timer. Just create two variables or use PVar's. One to keep up with their killstreak, and one to keep up with the ticks.
Reply
#3

I'm not very familiar with how to use ticks. Could you give me an example?
Reply
#4

Try this out.

http://pastebin.com/Ug7YMcSy

It uses no timers but the player's killstreak only gets updated when he kills someone. So, if he's on a killstreak of 3, for example, it won't get set to 0 until he kills someone. It's useful for displaying their current killstreak but not like constantly displaying it.
Reply
#5

I'm wondering how I would make it so that if a player gets 2 kills for example it would send a message saying double kill and if 3 triple kill and anything above 3 it would say rampage.
Reply
#6

In this block, just add in whatever killstreaks you want to send messages.

pawn Код:
if((tick - pTicks[killerid]) < 5000)//Gotta play with that number
{
    pKillStreak[killerid]++;
    pTicks[killerid] = tick;
        if(pKillStreak[killerid] == 2)
        {
             //Send message
        }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)