Raised This Month: $ Target: $400
 0% 

Assisted Kills - not working correctly.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Y060N
BANNED
Join Date: Dec 2011
Location: www.equilibriumcs.com
Old 04-25-2012 , 16:24   Assisted Kills - not working correctly.
Reply With Quote #1

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{    
    .....
        
    if (
isZombie[victim])
    {
        
g_iDamage[attacker][victim] += floatround(damagefloatround_floor)
    }

    .....
}

public 
event_DeathMsg()
{
    static 
KillerVictim

    Killer 
read_data(1)
    
Victim read_data(2)
    
    new 
iKiller1 Killer
    
new iKiller2 0
    
new iKillerTemp 0
    
new iDamage2 0
    
    
if(Killer != Victim && isZombie[Victim])
    {
        
        for(new 
1<= g_iMaxPlayersp++)
        {
            if(
!= Killer && is_user_connected(p) && (g_iDamage[p][Victim] > iDamage2) && (g_iDamage[p][Victim] >= 700))
            {
                if ( 
g_iDamage[p][Victim] > g_iDamage[iKiller1][Victim])
                {
                    
iKillerTemp iKiller1
                    iKiller1 
p
                    iKiller2 
iKillerTemp
                    iDamage2 
g_iDamage[p][Victim]
                }
                else if ((
g_iDamage[p][Victim] > g_iDamage[iKiller2][Victim]) && (g_iDamage[p][Victim] >= 700))
                {
                    
iKiller2 p
                    iDamage2 
g_iDamage[p][Victim]
                }
            }
            
            
g_iDamage[p][Victim] = 0
        
}
    }

So I have this (there is code that I left out in the takedamage and deathmsg, but later in death msg it gives XP to the killer1 and if there is a killer2, then killer2). But when someone kills a zombie that is low HP - maybe someone else did 1800 damage and the zombie has 200hp left, the person that does 200 damage gets the kill and the person that did 1800 damage gets nothing.

I am not sure why this is happening. It should check against everyone that did damage to the zombie and see from there whether the person that did 200 damage is eligible - and he shouldn't be.

Last edited by Y060N; 04-25-2012 at 16:27.
Y060N is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:43.


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