SA-MP Forums Archive
/setlevel help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /setlevel help (/showthread.php?tid=461292)



/setlevel help - xPirate - 01.09.2013

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 ?


Re: /setlevel help - xPirate - 01.09.2013

Anyone ?


Re: /setlevel help - Areax - 01.09.2013

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;
}



Re: /setlevel help - xPirate - 01.09.2013

Thank you !


Re: /setlevel help - xPirate - 01.09.2013

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"
?


Re: /setlevel help - park4bmx - 01.09.2013

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;