MySQL creates 13 rows in the database?
#1

Hey, I added this to my OnPlayerUpdate for JetPack hacks, but when I get banned for it, it creates 13 rows in the table when its only supposed to be 1! Please help

pawn Код:
new
            query[315], IP[16], Name[MAX_PLAYER_NAME];
        GetPlayerIp(playerid, IP, sizeof(IP));

        GetPlayerName(playerid, Name, sizeof(Name));

        format(Dialog, sizeof(Dialog), "{FF0000}You are banned from this server! Ban details:\n\n{FF0000}Name:{FFFFFF} %s \n{FF0000}IP:{FFFFFF} %s\n{FF0000}Reason:{FFFFFF} Jetpack Hacks \n{FF0000}Banned By:{FFFFFF} Anti - Cheat\n\n{FF0000}You will never unbanned!\n\n{FF0000}If you think this ban is unfair, you can apply for an unban appeal at our forums\n{FF0000}Note - We do not unban hackers, or people who lie in their appeal", Name, IP);
        ShowPlayerDialog(playerid, DIALOG_BAN, DIALOG_STYLE_MSGBOX, "{FF0000}Banned!", Dialog, "Close", "");

        format(query,sizeof(query), "INSERT INTO bans (Name, IP, Reason, BannedBy, Date, Status) VALUES('%s', '%s', 'Jetpack Hacks', 'Anti - Cheat', NOW(), '1')", GetName(playerid), IP, gettime());
        mysql_query(query);
Reply
#2

OnPlayerUpdate is called a few times after they are banned.
Reply
#3

So what do I change it to to stop it from creating 13 rows
Reply
#4

pawn Код:
public OnPlayerUpdate(playerid)
{
    //don't need to keep checking if they are banned
    //they may send some more updates while they are being kicked
    if(GetPVarInt(playerid,"banned")) return 1;
    //...
}
(taken from anti cheat tips)
Reply
#5

Don't use OnPlayerUpdate if you don't know what it's used for. Certainly don't do I/O in OPU.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)