Thread: Attacker
View Single Post
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 08-21-2015 , 03:11   Re: Attacker
Reply With Quote #3

Quote:
Originally Posted by WildCard65 View Post
try:
PHP Code:
#include <morecolors>
int killer[MAXPLAYERS+1];

public 
void OnPluginStart()
{
    
RegConsoleCommand("sm_test"Command_Test""0);
    
HookEvent("player_death"Event_PD);
}

public 
Action Command_Test(int clientint args)
{
    
int myKiller GetClientOfUserId(killer[client]);
    if (
IsClientInGame(myKiller))
        
CPrintToChat(client"You were killed by %N"myKiller);
    
killer[victim] = 0;
}

public 
void Event_PD(Event event, const char[] namebool dontBroadcast)
{
    
int victim GetClientOfUserId(event.GetInt("userid")), attacker event.GetInt("attacker");
    if (
IsClientInGame(victim))
        
killer[victim] = attacker;

not working :/
__________________
nhnkl159 is offline
Send a message via Skype™ to nhnkl159