/setlevel help
#1

Hello im newbie to admin systems so i made register / login system based on this tutorial:

https://sampforum.blast.hk/showthread.php?tid=352703

Now i need help with /setlevel command ! I searched around and none work.
Can someone help me ?
Reply
#2

Anyone ?
Reply
#3

pawn Код:
CMD:setlevel(playerid, params[])
{
    new targetid;
    new level;
    if(sscanf(params, "ui", targetid, level))return SendClientMessage(playerid, -1, "[USAGE]: /setlevel {FF0000}[PlayerID] [Level]");
    if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, -1, "[ERROR]: {FFFFFF}This player is {FF0000}NOT {FFFFFF}connected!");
    if(level < 0 || level > 10)return SendClientMessage(playerid, -1, "[ERROR]: Invalid Admin Level (0-10)!"); //Change "10" to your MAX. admin level.
    pInfo[targetid][Adminlevel] = level;
    new INI:file = INI_Open(Path(playerid));
    INI_SetTag(file, "Player's Data");
    INI_WriteInt(file, "AdminLevel", pInfo[targetid][Adminlevel]);
    return 1;
}
Reply
#4

Thank you !
Reply
#5

Also where can i add now when i promote / demote someone:
"you have been promoted by Administrator xPirate"
and
"You promoted lol123 to Admin level 5"
?
Reply
#6

pawn Код:
new Str[80],aName[MAX_PLAYER_NAME];GetPlayerName(playerid,aName, sizeof aName);
    format(Str,sizeof Str,"Admin %s has set your level to %d",aName,level);
    SendClientMessage(targetid,-1,Str);
//other
    GetPlayerName(targetid,aName, sizeof aName);
    format(Str,sizeof Str,"You have promoted %s to %d",aName,level);
    SendClientMessage(playerid,-1,Str);
    return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)