I tried with arthurdead's code with only admin flag change (from root to generic).
Plugin was compiled and loaded on server.
Admins didnt received annotations above head (or anywhere) at teamplay_round_win event.
Also I removed that 9th line and player_death things.
Heres my actual (not working) code:
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
public OnPluginStart()
{
HookEvent("round_start", Event_RoundStart);
HookEvent("teamplay_round_win", Event_RoundWin);
}
public Event_RoundWin(Handle:event, const String:name[], bool:dontBroadcast)
{
for (new iClient=1; iClient<=MaxClients; iClient++)
{
if(GetUserFlagBits(iClient) & ADMFLAG_GENERIC) continue;
ShowADMIN(iClient);
}
}
public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
for (new iClient=1; iClient<=MaxClients; iClient++)
{
if(GetUserFlagBits(iClient) & ADMFLAG_GENERIC) continue;
HideADMIN(iClient);
}
}
ShowADMIN(client)
{
if (!client && !IsClientInGame(client) && !IsPlayerAlive(client) && CheckCommandAccess(client, "generic_admin", ADMFLAG_GENERIC, true))
{
new Handle:event = CreateEvent("show_annotation");
if(event == INVALID_HANDLE) return;
SetEventInt(event, "follow_entindex", client);
SetEventInt(event, "id", client);
SetEventFloat(event, "lifetime", 86400.0);
SetEventString(event, "text", "ADMIN");
FireEvent(event);
}
}
HideADMIN(client)
{
new Handle:event = CreateEvent("hide_annotation");
if(event == INVALID_HANDLE) return;
SetEventInt(event, "id", client);
FireEvent(event);
}
__________________