Raised This Month: $ Target: $400
 0% 

How to check if player has killed somebody


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Desikac
Senior Member
Join Date: Apr 2010
Location: Serbia
Old 09-09-2011 , 17:07   Re: How to check if player has killed somebody
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>

new KillCount[33]

public 
plugin_init() {
    
register_messageget_user_msgid"DeathMsg" ) , "death" )
    
register_logevent("ResetKills",2,"1=Round_Start")
}

public 
client_disconnect(id)
    
KillCount[id] = 0

    
public ResetKills(){
    new 
players[32] , inum
    get_players
(playersinum)
    for(new 
0inum; ++a)
        
KillCount[a] = 0
}
public 
death() {
    new 
attacker read_data(1);
    new 
victim read_data(2);
       
    if(
attacker == victim)
        return 
PLUGIN_CONTINUE
    
    
if(cs_get_user_team(attacker) == cs_get_user_team(victim))
        return 
PLUGIN_CONTINUE
    
    KillCount
[attacker]++
    
    if(
KillCount[attacker] == 3) {
        
//if he has killed 3 this round execute a function
        
SomeFunction(attacker)
    }
    
    return 
PLUGIN_CONTINUE
    
}

public 
SomeFunction(id) {
    
//your code here
    
client_print(idprint_chat"This is your third kill this round!")

Desikac is offline
Send a message via MSN to Desikac Send a message via Skype™ to Desikac
 



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 09:12.


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