[Help]Request
#7

First, use this y_ini register system;
https://sampforum.blast.hk/showthread.php?tid=273088

Then for /setrank

pawn Код:
CMD:setrank(playerid, params[])
{
    new lvl, player, string[128]; // Local variable
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 5) // Checks if the player is a RCON admin or level 5 admin or more
    {
        if(sscanf(params,"ui", player, lvl)) return SendClientMessage(playerid, GREY, "Usage: /setadmin [id] [level]");
       
        if(lvl > 6) return SendClientMessage(playerid, RED, "MAX. Admin level is 6!");// Checks if you put a level above 6 (You can change it to your own)

        if(!IsPlayerConnected(player)) return SendClientMessage(playerid, RED, "Invalid player id!");
        else
        {
            format(string,sizeof(string),"You have set "COL_LIGHTGREEN"%s (%d)"COL_WHITE" admin level to "COL_LIGHTGREEN"%d", GetName(player), player, lvl); // Sends message to player
            SendClientMessage(playerid, WHITE, string);
            format(string,sizeof(string),"Admin "COL_LIGHTGREEN"%s (%d)"COL_WHITE" has set your admin level to "COL_LIGHTGREEN"%d", GetName(playerid), playerid, lvl);
            SendClientMessage(player, WHITE, string);
            PlayerInfo[player][pAdmin] = lvl; // Adds the level to player status
         }
    }
    else // If the player is neither a RCON admin or level 4, then he will get this message
    {
        SendClientMessage(playerid, RED, "You're not a level 4 admin");
    }
    return 1;
}
Taken from my own gamemode, tested and works.
Reply


Messages In This Thread
[Help]Request - by astanalol - 11.12.2014, 22:39
Re: [Help]Request - by astanalol - 12.12.2014, 12:41
Re: [Help]Request - by MasonSFW - 12.12.2014, 12:48
Re: [Help]Request - by astanalol - 12.12.2014, 13:23
Re: [Help]Request - by astanalol - 12.12.2014, 14:05
Re: [Help]Request - by astanalol - 12.12.2014, 14:25
Re: [Help]Request - by MythicalMarauder - 12.12.2014, 15:32
Re: [Help]Request - by astanalol - 12.12.2014, 18:21
Re: [Help]Request - by astanalol - 12.12.2014, 18:31
Re: [Help]Request - by astanalol - 12.12.2014, 20:29

Forum Jump:


Users browsing this thread: 3 Guest(s)