28.07.2012, 09:07
Hello guys i have made this command but the problem is when i type /setadmin 1 3 in game it just sets the player with the lowest id 0 as an admin not only this but some other commands have same problem can someone explain why and how can i fix it
pawn Код:
CMD:setadmin(playerid, params[])
{
if(IsPlayerAdmin(playerid) | PlayerInfo[playerid][pAdmin] >= 3)
{
new pID;
new Level;
new string[128];
new pName[MAX_PLAYER_NAME];
new aName[MAX_PLAYER_NAME];
GetPlayerName(playerid, aName, sizeof(aName));
GetPlayerName(pID, pName, sizeof(pName));
if(sscanf(params, "ui", pID, Level)) return SendClientMessage(playerid, -1, "[USAGE] /setadmin [playerid] [level]");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, -1, "[ERROR] The Player You Want To Make Admin Is Not Connected");
format(string, sizeof(string), "Admin %s Has Made %s An Admin Level %d", aName, pName, Level);
SendClientMessageToAll(-1, string);
PlayerInfo[pID][pAdmin] = Level;
}
else return SendClientMessage(playerid, -1, "You Are Not Authorized To Use That Command");
return 1;
}