04.04.2014, 11:41
Here's the code
+rep if i help
pawn Код:
CMD:makeadmin(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 99999)
{
new
iAdminValue,
iTargetID;
if(sscanf(params, "ui", iTargetID, iAdminValue)) {
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
SendClientMessageEx(playerid, COLOR_GRAD1, "Server Moderator[1], Junior Admin[2], General Admin[3], Senior Admin[4], Head Admin[1337]");
SendClientMessageEx(playerid, COLOR_GRAD1, "Server Manager[1338], Server Co-Owner[99998], Server Owner[99999]");
}
else if(IsPlayerConnected(iTargetID))
{
new
szMessage[47 + (MAX_PLAYER_NAME * 2)];
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 a fucker! You can't do this !");
return 1;
}