AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how add triple kill (https://forums.alliedmods.net/showthread.php?t=234064)

login_xcvop 01-24-2014 14:53

how add triple kill
 
how add triple kill in this code ?

PHP Code:

new g_hasKilledTimer[33]

ham_killed(...)
{
   if(
g_hasKilledTimer[attacker])
   {
      
g_hasKilledTimer[attacker] = false

      
// *********************
      // attacker did a double kill
      // add actions here
      // *********************
   
}
   else
   {
      
g_hasKilledTimer[attacker] = true
      set_task
(5.0"resetTimer"attacker)
   }
}

public 
resetTimer(id)
{
     
g_hasKilledTimer[id] = false



Blizzard_87 01-24-2014 16:09

Re: how add triple kill
 
Can you show your whole code.?

login_xcvop 01-25-2014 04:27

Re: how add triple kill
 
this is full code

Jhob94 01-25-2014 08:12

Re: how add triple kill
 
If you want to detect 3 kills, why you are using bool? And bool isnt even correctly registered :3
Register death event msg. after for check do:

PHP Code:

if(g_hasKilledTimer[attacker] > 2)
   {
      
g_hasKilledTimer[attacker] = 0

      
// *********************
      // attacker did a double kill
      // add actions here
      // *********************
   
}
   else
   {
      
g_hasKilledTimer[attacker]++
      
set_task(5.0"resetTimer"attacker)
   }
public 
resetTimer(id)
{
     
g_hasKilledTimer[id] = 0


Sorry for incomplete answer. I havent computer so its complicated :bee:


All times are GMT -4. The time now is 10:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.