|
Senior Member
Join Date: Jul 2012
Location: Israel 3>
|
08-21-2015
, 03:11
Re: Attacker
|
#3
|
Quote:
Originally Posted by WildCard65
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 client, int 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[] name, bool dontBroadcast)
{
int victim = GetClientOfUserId(event.GetInt("userid")), attacker = event.GetInt("attacker");
if (IsClientInGame(victim))
killer[victim] = attacker;
}
|
not working :/
__________________
|
|
|
|