26.10.2013, 17:53
pawn Код:
CMD:makeadmin(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 99999) {
new
iAdminValue,
iTargetID;
if(sscanf(params, "ui", iTargetID, iAdminValue)) {
SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /makeadmin [player] [level]");
}
else if(IsPlayerConnected(iTargetID)) {
if(PlayerInfo[iTargetID][pHelper] >= 1) {
SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot make community helpers admins!");
}
else {
new
szMessage[47 + (MAX_PLAYER_NAME * 2)];
PriorityReport[iTargetID] = TextDrawCreate(261.000000, 373.000000, "New Report");
TextDrawBackgroundColor(PriorityReport[iTargetID], 255);
TextDrawFont(PriorityReport[iTargetID], 2);
TextDrawLetterSize(PriorityReport[iTargetID], 0.460000, 1.800000);
TextDrawColor(PriorityReport[iTargetID], -65281);
TextDrawSetOutline(PriorityReport[iTargetID], 0);
TextDrawSetProportional(PriorityReport[iTargetID], 1);
TextDrawSetShadow(PriorityReport[iTargetID], 1);
PlayerInfo[iTargetID][pAdmin] = iAdminValue;
format(szMessage, sizeof(szMessage), "AdmCmd: %s has promoted %s to a level %d admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
ABroadCast(COLOR_LIGHTRED,szMessage, 2);
format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
}
}
else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
return 1;
}

