25.06.2012, 20:56
pawn Код:
COMMAND:announce(playerid, params[])
{
new string[256], text[256]; // Strings
if(sscanf(params, "s[256]", text)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /announce [Message]"); // If you type in /announce with a space it will send you this message <
else
{
if(PlayerInfo[playerid][pAdmin] >= 1) // If admin is level 1 or above.
{
format(string, sizeof(string), "[ANNOUNCEMENT] %s %s: "COL_WHITE"%s", GetAdminLvlName(playerid), GetName(playerid), text); // When using the command /announce [Message] it will come up as [Announcement] Admin Level X, The players name that used the command, and then the text will be white.
SendClientMessageToAll(COLOR_GREY, string); // Send the message to all the players.
}
else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command!"); // If you are not an admin it will send you the message above.
}
return 1;
}