01.01.2012, 11:49
pawn Код:
CMD:setadmin(playerid, params[])
{
new pID, value;
if(PlayerInfo[playerid][pAdmin] < 1338 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, NOTADMIN);
else if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, 0xFF0000AA, "Kasutus: /setadmin [playerid/partofname] [level 1-1338]"); //how to use it.
else if (value < 0 || value > 1338) return SendClientMessage(playerid, 0xFF0000AA, "Vale level! Levelid: 0-1338"); //wrong level
else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY,"Vale ID."); //wrong id
new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(pID, tName, MAX_PLAYER_NAME);
format(string, sizeof(string), "Sa muutsid %s'i admini leveli %i peale.", tName, value); //you changed %s's alevel to %i.
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "Su adminlevel on nььd %i.", value); //your adminlevel is...
SendClientMessage(pID, COLOR_WHITE, string);
PlayerInfo[pID][pAdmin] = value;
return 1;
}