|
Senior Member
Join Date: Aug 2017
Location: Indonesia
|
07-21-2019
, 19:11
Re: [L4D2] [Req/Pay] I Need Plugin Like This
|
#5
|
Quote:
Originally Posted by dustinandband
hmm that's weird
For the kill announce this should work i think
Spoiler
PHP Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
#define TEAM_SURVIVORS 2
#define TEAM_INFECTED 3
public Plugin myinfo = {
name = "Print Player Deaths",
author = "dustin",
description = "",
version = "0.0.0",
url = ""
};
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre);
}
public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
int victim = GetClientOfUserId(event.GetInt("userid"));
int attacker = GetClientOfUserId(event.GetInt("attacker"));
if (attacker && victim && IsClientInGame(attacker) && IsClientInGame(victim))
{
if (GetClientTeam(attacker) == TEAM_INFECTED && GetClientTeam(victim) == TEAM_SURVIVORS)
{
char sAttackerName[32], sVictimName[32];
GetClientName(victim, sVictimName, sizeof(sVictimName));
GetClientName(attacker, sAttackerName, sizeof(sAttackerName));
PrintToChatAll("\x01[\x04%s\x01] just killed [\x04%s\x01]", sAttackerName, sVictimName);
}
}
return Plugin_Continue;
}
|
PERFECT
Thanks you a lot bro...
|
|
|
|