Raised This Month: $ Target: $400
 0% 

How to check if player has killed somebody


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-10-2011 , 04:12   Re: How to check if player has killed somebody
Reply With Quote #3

Quote:
Originally Posted by Desikac View Post
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!")

Check if attacker is connected.
__________________
- tired and retired -

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


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