21.03.2013, 22:26
I guess you're using Y_INI.
First off..
This checks if you're an admin or RCON admin.
Usage of sscanf, this basically means what level you can set them to. 0 - 1338
Check if the target id is online.
This will set the Adminlevel to whatever you typed in.
You'll need this aswell to store the data. Also you'll need to save the data whenever a player logs out and logs in.
Also you'll need this ontop of your command.
First off..
This checks if you're an admin or RCON admin.
pawn Code:
if(PlayerInfo[playerid][pAdmin] < 1338 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not a admin level 1338 or logged in as a rcon adminstrator.");
pawn Code:
if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COLOR_GREY, "Anvдndning: /makeadmin [playerid/partofname] [level 1-1338].");
else if (value < 0 || value > 1338) return SendClientMessage(playerid, COLOR_RED, "Invalid admin level.");
pawn Code:
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED,"That player is not online.");
pawn Code:
PlayerInfo[pID][pAdmin] = value;
pawn Code:
enum pInfo
{
pAdmin
}
pawn Code:
new pID, value;