12.06.2009, 13:52
Код:
{ AdministratorMessage(COLOR_YELLOW, string); }
{ AdministratorMessage(COLOR_YELLOW, string); }
if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0) { if(IsPlayerConnected(playerid)) { new sendername[MAX_PLAYER_NAME]; 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_GREY, "[USAGE] (/a)dmin [admin chat]"); return 1; } new arank[64]; if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Trial Admin"; } else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "RP Admin"; } else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Game Admin"; } else if(PlayerInfo[playerid][pAdmin] == 19) { arank = "Lead Admin"; } else if(PlayerInfo[playerid][pAdmin] == 20) { arank = "Community Owner"; } else if(PlayerInfo[playerid][pAdmin] == 1337) { arank = "Hidden Lead Admin"; } else if(PlayerInfo[playerid][pAdmin] == 1338) { arank = "Community Owner"; } else { arank = "Unknown Admin Rank"; } format(string, sizeof(string), "*%s %s: %s", arank, sendername, result); if (PlayerInfo[playerid][pAdmin] >= 1) { AdministratorMessage(COLOR_YELLOW, string); // Error line } printf("Admin %s: %s", sendername, result); } return 1; }