29.12.2010, 20:34
Okay, this should do what you need for an admin chat...
pawn Код:
dcmd_admin(playerid, params[])
{
if(level[playerid] < 1) // Checking to see if they're admin level is less than one.
return false; // If so, we stop the command.
if(strlen(params) > 95) // We should check to see if they have a message to large for the SA-MP chat
return SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: Your message is too long!"); // It is, lets send them an error message.
new name[MAX_PLAYER_NAME], string[128]; // Define some new variables
GetPlayerName(playerid, name, sizeof(name)); // Get their name
format(string, sizeof(string), "Admin Lvl %s: %s", name, params); // format the message
MessageToAdmins(AdminColor, string); // send to the admins
return 1;
}