18.08.2016, 11:15
Hey guys, I'm trying to make it so that if a player is admin they see the global chat as
Name [Player's ID]: Text
If the player is not admin it's displayed as
Name: Text
Here is my code.
Do I need to make a stock that doesn't display the message to admins?
Name [Player's ID]: Text
If the player is not admin it's displayed as
Name: Text
Here is my code.
PHP код:
public OnPlayerText(playerid, text[])
{
new string[200];
if(PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "%s {FFFFFF}[%d]: %s", GetName(playerid), playerid, text);
ABroadCast(GetPlayerColor(playerid), string, 1);
}
else if(PlayerInfo[playerid][pAdmin] == 0)
{
format(string,sizeof(string), "%s: %s", GetName(playerid), text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 1;
}