14.08.2013, 05:30
Код:
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 = "Trial Admin"; } if(PlayerInfo[playerid][pAdmin] == 2){ atext = "Administrator"; } if(PlayerInfo[playerid][pAdmin] == 3){ atext = "Senior Admin"; } if(PlayerInfo[playerid][pAdmin] == 1337){ atext = "Head Admin"; } if(PlayerInfo[playerid][pAdmin] == 1338){ atext = "Server Owner"; } format(string, sizeof(string), "%s %s:"COL_WHITE "%s", atext, RemoveUnderScore(playerid), playerid, result); if(PlayerInfo[playerid][pAdmin] >= 1) { SendAdminMessage(COLOR_ORANGE, string); } } return 1; }