23.03.2015, 04:57
Example:
pawn Код:
new bool:pUndercover[MAX_PLAYERS] = false;
public OnPlayerText(playerid, text[])
{
new string[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(PlayerInfo[playerid][pAdmin] == 1)
{
if(pUndercover[playerid] == true)
{
format(string, sizeof(string), "[Admin] %s: %s", name, text);
SendClientMessageToAll(COLOR_WHITE, string);
}
else
{
format(string, sizeof(string), "%s: %s", name, text);
SendClientMessageToAll(COLOR_WHITE, string);
}
}
else
{
format(string, sizeof(string), "%s: %s", name, text);
SendClientMessageToAll(COLOR_WHITE, string);
}
return 1;
}
CMD:hide(playerid, params[])
{
if(pUndercover[playerid] == true) return SendClientMessage(playerid, -1, "You are already hidden!");
pUndercover[playerid] = true;
}
CMD:unhide(playerid, params[])
{
if(pUndercover[playerid] == false) return SendClientMessage(playerid, -1, "You aren't hidden!");
pUndercover[playerid] = false;
}