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[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_YELLOW, " Подсказка: (/a)dmin [текст]");
return 1;
}
new arank[64];
if(PlayerInfo[playerid][pAdmin] >= 10) { arank = "Главный Администратор Проекта"; }
else if(PlayerInfo[playerid][pAdmin] == 9) { arank = "Зам.Гл.Админа"; }
else if(PlayerInfo[playerid][pAdmin] == 8) { arank = "Админ"; }
else if(PlayerInfo[playerid][pAdmin] == 7) { arank = "Младший админ"; }
else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Старший модэратор"; }
else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Зам старшего модэратора"; }
else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Модэратор"; }
else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Младший модэратор"; }
else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Помошник модэратора"; }
else if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Хелпер"; }
else { arank = "Хэлпер"; }
format(string, sizeof(string), "*** %s %s[%d]: %s. ***", arank, sendername, playerid, result);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendAdminMessage(COLOR_GREEN, string);
}
printf("%s %s[%d]: %s", arank, sendername,playerid, result);
}
return 1;
}