02.08.2011, 17:02
Quote:
I am making an admin script but i don't know how to make admin lvls correcttly so please tell me.
|
The base of making the Admin Levels is actually in the command, /Setadmin,/Makeadmin, /Setlevel.
I don't have much information about your script yet so i will show you a Makeadmin command.
pawn Code:
CMD:setadmin(playerid, params[])
{
new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
if(IsPlayerAdmin(playerid))
{
if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setadmin [id] [adminlevel]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
if (admlvl > 10 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"System: Valid Admin Levels: 1-10!");
PlayerInfo[id][pAdminLevel] = admlvl;
GetPlayerName(id, victimname, sizeof(victimname));
GetPlayerName(playerid, adminname, sizeof(adminname));
new str[128];
format(str,128,"System: %s [ID %d] has set %s [ID %d] admin level to %i",adminname, playerid, victimname, id, admlvl);
SendClientMessage(playerid,COLOR_GREEN,str);
return 1;
}
else return SendClientMessage(playerid,COLOR_RED," You are not allowed to use this command!");
}
Then the base of your code would be
pawn Code:
if(PlayerInfo[playerid][pAdminLevel] >=1)
pawn Code:
CMD:jetpack(playerid,params[])
{
if(PlayerInfo[playerid][pAdminLevel] >=3)
{
SetPlayerSpecialAction(playerid, 2);
SendClientMessage(playerid,COLOR_GREEN, "|__Jetpack Spawned__|");
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, " You are not allowed to use this command");
}