Try this:
PHP Code:
#include <sourcemod>
static Handle HudText = null;
public void OnPluginStart() {
HudText = CreateHudSynchronizer();
HookEvent("player_death", OnPlayerDeath, EventHookMode_Pre);
}
public Action OnPlayerDeath(Handle hEvent, const char[] name, bool dontBroadcast) {
char text[64];
int attacker = GetClientOfUserId(GetEventInt(hEvent, "attacker"));
if (IsValidClient(attacker)) {
Format(text, sizeof(text), "You killed an ennemy!");
SetHudTextParams(1.0, 0.5, 9999.0, 100, 0, 255, 71);
ShowSyncHudText(attacker, HudText, text);
}
}
stock bool IsValidClient(int client) {
if (client <= 0 || client > MaxClients || !IsClientInGame(client)) {
return false;
}
return true;
}
(Not sure why you want to hold the text during 9999.0 seconds).
__________________