27.03.2010, 09:40
This is my Admin chat command. I tried a lot, but never worked. I hope someone can help.
pawn Код:
dcmd_a(playerid, params[])
{
if(pInfo[playerid][pAdmin] < 1 || IsPlayerAdmin(playerid))
{
new msg[128], string[128];
if(sscanf(params, "s", msg)) return SendClientMessage(playerid, COLOR_LIGHTYELLOW, "USAGE: /a [text]");
if(strlen(msg) < 1) return SendClientMessage(playerid, COLOR_LIGHTYELLOW, "You are not an Adminstrator with the required level.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pInfo[i][pAdmin] < 1)
{
format(string, sizeof(string), "Admin %s: %s", pNick(playerid), msg);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
}
}
}
return 0;
}