Raised This Month: $ Target: $400
 0% 

DeathMsg is running more than once?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 05-12-2010 , 07:08   DeathMsg is running more than once?
Reply With Quote #1

Hi,

I would like to count specific death, but for some reason, the counter sometimes increased by more than one point. Any ideas?

Here is the code
PHP Code:
public plugin_init(){
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_event("DeathMsg""event_death_message""a")
    
register_event("TextMsg""event_round_restart""a""2=#Game_Commencing""2=#Game_will_restart_in")
    
register_logevent("event_round_start"2"0=World triggered""1=Round_Start")
}

public 
client_damage(iAttackeriVictimiDamageiWeaponiHitplaceTA){
    if (
iAttacker && iVictim){
        
g_iHits[iAttacker][iVictim]++
    }
}

public 
event_death_message(){
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    if (!
iKiller || !iVictim){
        return 
PLUGIN_CONTINUE
    
}

    new 
szWeapon[20], iHeadshot read_data(3)
    
read_data(4szWeapon19)

    if (
get_user_team(iKiller) != get_user_team(iVictim)){

        if (
equal(szWeapon"p228") || equal(szWeapon"usp") || equal(szWeapon"glock18") || equal(szWeapon"fiveseven") || equal(szWeapon"elites") || equal(szWeapon"deagle")){
            
g_iPistolKills[iKiller]++
        }

        if (
equal(szWeapon"knife")){
            
g_iKnifeKills[iKiller]++
        }
    }

    
g_iPistolKills[iVictim] = 0
    g_iKnifeKills
[iVictim] = 0

    
return PLUGIN_CONTINUE

Leon M. is offline
 



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 03:38.


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