A plea for aid.
#2

I guess you're using Y_INI.

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.");
Usage of sscanf, this basically means what level you can set them to. 0 - 1338

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.");
Check if the target id is online.

pawn Code:
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED,"That player is not online.");
This will set the Adminlevel to whatever you typed in.

pawn Code:
PlayerInfo[pID][pAdmin] = value;
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.

pawn Code:
enum pInfo
{
    pAdmin
}
Also you'll need this ontop of your command.

pawn Code:
new pID, value;
Reply


Messages In This Thread
A plea for aid. - by SilencedPistol - 21.03.2013, 22:01
Re: A plea for aid. - by Chrillzen - 21.03.2013, 22:26
Re: A plea for aid. - by sniperwars - 21.03.2013, 22:33
Re: A plea for aid. - by P3DRO - 22.03.2013, 01:07
Re: A plea for aid. - by Chrillzen - 22.03.2013, 02:09

Forum Jump:


Users browsing this thread: 1 Guest(s)