Hmm, I had a go, but I can't get it to work.
The thing is, I'm also trying to use geoip to set their country flag as well. So, it's a bit more complicated.
Currently, the country flag part works, but I cannot get it to display an [Admin] tag for admins for the life of me.
Here's my current code.
PHP Code:
new string:name[MAX_NAME_LENGTH];
public OnClientPutInServer(client)
{
if(GetConVarInt(Nick_Updater) == 1)
{
if(!IsFakeClient(client) && client != 0)
{
decl String:ip[16];
decl String:flag[5];
decl String:GeoIP[3];
GetClientIP(client, ip, 16);
if(GeoipCode2(ip, GeoIP))
Format(flag, sizeof(flag), "[%2s]", GeoIP);
else
Format(flag, sizeof(flag), "[--]");
Format(name, sizeof(name), "%s%N", flag, client);
SetClientInfo(client, "name", name);
}
}
}
public OnClientPostAdminCheck(client)
{
if(GetConVarInt(Nick_Updater) == 1)
{
if(IsClientInGame(client) && GetUserAdmin(client) != INVALID_ADMIN_ID)
Format(name, sizeof(name), "[Admin]%N", name);
SetClientInfo(client, "name", name);
}
}
I'll understand if you can't be bothered...I've kind of given up hope on this :p
Thanks anyway,
Jack.