12.02.2009, 15:48
A little Help When i Make Myself 7level admin it Writes Con.But it should write S.Scripter
Код:
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_GRAD2, "USAGE: (/a)dmin [admin chat]"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 1) { format(string, sizeof(string), "* Adminas[Con.] %s: %s" , sendername, result); } else if (PlayerInfo[playerid][pAdmin] >= 2) { format(string, sizeof(string), "* Adminas[Mod.] %s: %s" , sendername, result); } else if (PlayerInfo[playerid][pAdmin] >= 3) { format(string, sizeof(string), "* Adminas[S.Mod.] %s: %s" , sendername, result); } else if (PlayerInfo[playerid][pAdmin] >= 4) { format(string, sizeof(string), "* Adminas[Admin.] %s: %s" , sendername, result); } else if (PlayerInfo[playerid][pAdmin] >= 5) { format(string, sizeof(string), "* Adminas[S.Admin] %s: %s" , sendername, result); } else if (PlayerInfo[playerid][pAdmin] >= 6) { format(string, sizeof(string), "* Adminas[Scripter] %s: %s" , sendername, result); } else if (PlayerInfo[playerid][pAdmin] >= 7) { format(string, sizeof(string), "* Adminas[S.Scripter] %s: %s" , sendername, result); } if (PlayerInfo[playerid][pAdmin] >= 1) { SendAdminMessage(COLOR_LIGHTGREEN, string); } printf("Admin %s: %s", sendername, result); } return 1; }