Help With Admin System
#2

Sure,

/ban using dcmd and sscanff

pawn Код:
dcmd_ban(playerid,params[])
{
        new Reason[256], pID;
        if(PlayerInfo[playerid][pAdminLevel] < 3)
        {
            return SendClientMessage(playerid,COLOR_RED,"You need to be at least over Admin level 3 to use this command.");
        }
        if(sscanf(params,"us",pID,Reason))
        {
            return SendClientMessage(playerid,COLOR_RED,"USAGE: /ban [playerid] [reason]");
        }
        if(!IsPlayerConnected(pID))
        {
            return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
        }
        if(PlayerInfo[playerid][pAdminLevel] < PlayerInfo[pID][pAdminLevel])
        {
            return SendClientMessage(playerid,COLOR_RED,"You can't use this command on a high ranked admin");
        }
        if(pID == playerid)
        {
            SendClientMessage(playerid,COLOR_RED,"You cannot ban yourself.");
            return 1;
        }
        new name[MAX_PLAYER_NAME], string[256];
        GetPlayerName(pID,name,sizeof(name));
        new Aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,Aname,sizeof(Aname));
        format(string,sizeof(string)," %s has banned %s with the reason: %s",Aname,name,Reason[0] ? Reason : "<No Reason>");
        SendClientMessageToAll(COLOR_GREEN,string);
        Ban(pID);
        return 1;
}
just made it my self :/
Reply


Messages In This Thread
Help With Admin System - by Guest3598475934857938411 - 11.07.2010, 02:10
Re: Help With Admin System - by Lorenc_ - 11.07.2010, 02:46
Re: Help With Admin System - by Guest3598475934857938411 - 11.07.2010, 11:42
Re: Help With Admin System - by Cameltoe - 11.07.2010, 11:46
Re: Help With Admin System - by DeathOnaStick - 11.07.2010, 11:46
Re: Help With Admin System - by RatHack - 11.07.2010, 11:48
Re: Help With Admin System - by DeathOnaStick - 11.07.2010, 11:50
Re: Help With Admin System - by Cameltoe - 11.07.2010, 11:55
Re: Help With Admin System - by oliverrud - 11.07.2010, 11:59
Re: Help With Admin System - by Guest3598475934857938411 - 11.07.2010, 15:55

Forum Jump:


Users browsing this thread: 1 Guest(s)