offline ban
#1

this is my oban code but i need is player admin other admin cant use oban on him.
PHP код:
CMD:oban(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] ==10 || IsPlayerAdmin(playerid))
    {
        new 
targetname[24], filestring[79], adminname[MAX_PLAYER_NAME];
        if(
sscanf(params"s[24]"targetname)) return SendClientMessage(playeridCOLOR_RED"USAGE: /oban [Player's Name]");
        
format(filestringsizeof(filestring), "/Asystem/Users/%s.ini"targetname);
        if(!
fexist(filestring)) return SendClientMessage(playeridCOLOR_RED"[Error]: The player name you have chosen was not found in our system.");
        else
        {
            
GetPlayerName(playeridadminnamesizeof(adminname));
            new 
INI:File INI_Open(filestring);
            
INI_SetTag(File"data");
            
INI_WriteInt(File"Ban"1);
            
INI_Close(File);
            new 
done[128];
            
format(donesizeof(done), "[BAN] Admin %s (id:%d) Offlinebanned %s from server."adminnameplayeridtargetname);
            
SendClientMessageToAll(COLOR_REDdone);
            return 
1;
        }
    }
    else return 
SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");

Reply
#2

This is gonna be helpful, thanks!

To your question: I think no, but I'm not so sure.
Reply
#3

copyright 2015 I am not satisfied
Reply
#4

Ok not sure if these is gonna work, mostly because im not using Y_INI but try these:

pawn Код:
CMD:oban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] ==10 || IsPlayerAdmin(playerid))
    {
        new targetname[24], filestring[79], adminname[MAX_PLAYER_NAME];
        if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /oban [Player's Name]");
        format(filestring, sizeof(filestring), "/Asystem/Users/%s.ini", targetname);
        if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_RED, "[Error]: The player name you have chosen was not found in our system.");
        else
        {
            GetPlayerName(playerid, adminname, sizeof(adminname));
            new INI:File = INI_Open(filestring);
            INI_SetTag(File, "data");
            INI_WriteInt(File, "Ban", 1);
            //-----------------------------
            remotePlayerAdmin = 0;
            INI_Int("Admin", remotePlayerAdmin );
            if(remotePlayerAdmin > 0)
            {
                INI_Close(File);
                SendClientMessage(playerid,COLOR_RED,"That player is admin!");
                return 1;
            }
            //-----------------------------
            INI_Close(File);
            new done[128];
            format(done, sizeof(done), "[BAN] Admin %s (id:%d) Offlinebanned %s from server.", adminname, playerid, targetname);
            SendClientMessageToAll(COLOR_RED, done);
            return 1;
        }
    }
    else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)