13.04.2011, 10:38
This also works really great
pawn Код:
if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/a)dmin [admin chat]");
return 1;
}
new atext[60];
if(PlayerInfo[playerid][pAdmin] == 1){ atext = "SAdmin(1)"; }
if(PlayerInfo[playerid][pAdmin] == 2){ atext = "Junior Admin(2)"; }
if(PlayerInfo[playerid][pAdmin] == 3){ atext = "General Admin(3)"; }
if(PlayerInfo[playerid][pAdmin] == 4){ atext = "Senior Admin(4)"; }
if(PlayerInfo[playerid][pAdmin] == 1337){ atext = "Elite Admin(1337)"; }
if(PlayerInfo[playerid][pAdmin] == 99998) { atext = "Head Scripter(99998)"; }
if(PlayerInfo[playerid][pAdmin] == 99999) { atext = "Server Owner(99999)"; }
format(string, sizeof(string), "*%d %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
if(PlayerInfo[playerid][pAdmin] >= 1)
{
SendAdminMessage(COLOR_YELLOW, string);
}
}
return 1;