24.08.2011, 21:10
@G4M3Ov3r - told from beggining,
Or any another command that uses
does not work, getting Invalid Player ID/ Player Not Connected
@PrawkC I'm using the plugin
pawn Code:
CMD:makeadmin(playerid, params[])
{
new pID, value;
if(!(PlayerInfo[playerid][pAdmin] >= 1338)) return SendClientMessage(playerid, 0xFF0000AA, " you are not authorized to use this command!");
else if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /makeadmin [playerid/partofname] [level 1-1338]");
else if (value < 1 || value > 1338) return SendClientMessage(playerid, 0xFF0000AA, "Unknown level! Only 1 to 1338");
else if(pID == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY,"Invalid player id");
else
{
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), "You have promoted %s to Admin level %i", tName, value);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have been promoted to Admin level %i by %s", value, pName);
SCM(pID, COLOR_LIGHTBLUE, string);
PlayerInfo[pID][pAdmin] = value;
}
return 1;
}
PHP Code:
sscanf(params,"ui", example1, example2)
@PrawkC I'm using the plugin