Code:
#include<csgocolors>
public OnPluginStart()
{
HookEventEx("player_disconnect", player_disconnect);
}
public void player_disconnect(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if(!IsFakeClient(client))
{
int time = RoundFloat(GetClientTime(client));
char buffer[255];
if(time >= 3600) {
Format(buffer, sizeof(buffer), "%i:%i:%i", (time/3600)%24, (time/60)%60, time%60);
} else {
Format(buffer, sizeof(buffer), "%i:%i", (time/60)%60, time%60);
}
Format(buffer, sizeof(buffer), "[{RED}-{NORMAL}] Player %N has left the server after %s minutes of playtime.", client, buffer);
PrintToChatAll(buffer);
}
}
Why ain't this working? It's not showing colors but displays:
[{RED}-{NORMAL}] Player %N has left the server after %s minutes of playtime.
It also displays it twice instead of once.
__________________