Untested. The RED, GREEN and BLUE are for the color of the HUD
PHP Code:
#include <sourcemod>
#define KILLS 10
#define RED 0
#define GREEN 255
#define BLUE 0
new g_Kills[MAXPLAYERS + 1]
public OnPluginStart()
{
HookEvent("round_start", Event_RoundStart)
HookEvent("player_death", Event_PlayerDeath)
CreateTimer(1.0, HUD_Status, _, TIMER_REPEAT)
}
public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
for(new i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i))
{
g_Kills[i] = 10
}
}
}
public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new victim = GetClientOfUserId(GetEventInt(event, "userid"))
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"))
if(attacker > 0 && IsClientInGame(attacker) && attacker != victim)
{
g_Kills[attacker]--
}
}
public Action:HUD_Status(Handle:timer)
{
SetHudTextParams(-1.0, 0.6, 1.0, RED, GREEN, BLUE, 255)
for(new i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && IsPlayerAlive(i))
{
ShowHudText(i, -1, "Kills: %d", g_Kills[i])
}
}
}