Ban Problem
#8

You're kicking the player at the end of the function, not banning him however.
Quote:
Originally Posted by Drago987
Посмотреть сообщение
i only found this
pawn Код:
stock BanPlayer(playerid, giveplayerid, time, reason[])
{
    new name[24], namegive[24];
    if(playerid == 501) format(name, sizeof(name), "Squidward (Anti-Cheat)");
    else GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(giveplayerid, namegive, sizeof(namegive));
    new curtime = gettime();
    new expire;
    if(!time)
    {
        expire = 1577836800;
    }
    else
    {
        new Float:banminutes = time * 24 * 60 * 60;
        new bantime = floatround(banminutes);
        expire = curtime + bantime;
    }
    new q[400];
    new ip[16];
    GetPlayerIp(giveplayerid, ip, sizeof(ip));
    //AddBan(ip);
    format(q, sizeof(q), "INSERT INTO bans (name, reason, ban_time, issue_time, expiry_time, admin, ip) VALUES ('%s', '%s', %d, %d, %d, '%s', '%s')", namegive, reason, time, curtime, expire, name, ip);


    new string[128];
    if(time)
    format(STRING, "AdmCmd: %s was banned for %d days by %s: %s", GetPlayerNameEx(giveplayerid), time, GetPlayerNameEx(playerid), reason);
    else
    format(STRING, "AdmCmd: %s was banned permanently by %s: %s", GetPlayerNameEx(giveplayerid), name, reason);
    SendClientMessageToAllEx(COLOR_LIGHTRED, string);
    if(time)
    format(STRING, "You were banned by Admin %s for %d days: %s", GetPlayerNameEx(playerid), time, reason);
    else
    format(STRING, "You were banned permanently by Admin %s: %s", name, reason);
    SendClientMessage(giveplayerid, 0x00FF00FF, string);
    new dialogstring[512];
   
    ShowPlayerDialog(giveplayerid, 4564, DIALOG_STYLE_MSGBOX, "Banned!", dialogstring, "Close", "");
    Kick(giveplayerid); // <- should be Ban(giveplayerid);
    return 1;
}
Reply


Messages In This Thread
Ban Problem - by Drago987 - 28.11.2013, 19:19
Re: Ban Problem - by fiki574 - 28.11.2013, 19:26
Re: Ban Problem - by Loot - 28.11.2013, 19:28
Re: Ban Problem - by Drago987 - 28.11.2013, 19:28
Re: Ban Problem - by Drago987 - 28.11.2013, 19:32
Re: Ban Problem - by Areax - 28.11.2013, 19:33
Re: Ban Problem - by Areax - 28.11.2013, 19:37
Re: Ban Problem - by Loot - 28.11.2013, 19:43

Forum Jump:


Users browsing this thread: 3 Guest(s)