Banning an offline player
#1

pawn Код:
CMD:banoff(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2 || IsPlayerAdmin(playerid))
    {
        new name[100];
        new file[128];
        new targetid;
         GetPlayerName(targetid, name, sizeof(name));
        new name2[12] = name;//must be a constant expression, assumed zero
        new name3 = strval(name2);
        new reason[128];
        if(sscanf(params,"s[100]s[128]", name,reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USAGE]: /banoff [name] [reason]");
        format(file, sizeof(file),"Admin/Accounts/%s.ini", name);
        if(!fexist(file)) return SendClientMessage(playerid, 0xFF0000AA, "Player is not on the database");
        BanPlayer(name3,playerid,reason);
    }
    return 1;
}
Being a noob 'and all, I came up with this code myself. But I crossed on one error, it's commented in the pawn code so you may want to look up top
Reply


Messages In This Thread
Banning an offline player - by Neil. - 23.01.2013, 14:03
Re: Banning an offline player - by MyNinja - 23.01.2013, 14:08
Re: Banning an offline player - by Neil. - 23.01.2013, 14:15
Re: Banning an offline player - by gtakillerIV - 23.01.2013, 14:52
AW: Banning an offline player - by Blackazur - 23.01.2013, 15:00
Re: Banning an offline player - by B-Matt - 23.01.2013, 15:14

Forum Jump:


Users browsing this thread: 3 Guest(s)