System ban, urgent help.
#1

PHP код:
public OnPlayerUpdate(playerid)
{
        static 
Keys,ud,lr;
        
GetPlayerKeys(playerid,Keys,ud,lr);
        new 
animname[32], animlib[32];
        
GetAnimationName(GetPlayerAnimationIndex(playerid), animlibsizeof(animlib), animnamesizeof(animname));
        if(
GetPlayerAnimationIndex(playerid))
        {
            
GetAnimationName(GetPlayerAnimationIndex(playerid), animlibsizeof(animlib), animnamesizeof(animname));
            if(!
strcmp(animname"FALL_SKYDIVE"true))
            {
                
pInfo[playerid][IsPlayerCleoFly]++;
                
pInfo[playerid][pCleoFlyWarning]++;
                if(
pInfo[playerid][IsPlayerCleoFly] >= 2)
                {
                    if(
pInfo[playerid][pCleoFlyWarning] >= 1)
                    {
                        if(
GetPlayerWeapon(playerid) != 46)
                        {
                            
jBan(playerid, -1"Fly Hack4"0);
                            
Kick(playerid);
                        }
                    }
                }
            }
        } 
My question is.

Why he's banning the player in the MYSQL, but he's not kicking him?
Reply
#2

Bump, fly hack is flooding my MYSQL database, but player does not get kicked.
Reply
#3

Код:
return 1;
you could also try setting a 100ms timer of sorts before kicking the player.
Reply
#4

Quote:
Originally Posted by Infin1ty
Посмотреть сообщение
Код:
return 1;
you could also try setting a 100ms timer of sorts before kicking the player.
I just copied a small part of the onplayerupdate, just the anticheat part, return 1; exists below at the final of the onplayerupdate

I tried the timer too, tried without timer, still does not kick, just MySQL updates with the ban but not kick.
Reply
#5

PHP код:
jBan(playerid, -1"Fly Hack4"0); 
Please post this
Reply
#6

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
PHP код:
jBan(playerid, -1"Fly Hack4"0); 
Please post this
PHP код:
tock jBan(player_bannedplayer_bannerreason[], time 0system 0)
{
    if(
system == 0)
    {
        if(
strlen(reason) > MAX_REASON_LENGTH) return SendClientMessage(player_banner0xFFFFFF""chat" Sorry, the maximum reason length is "#MAX_REASON_LENGTH" characters!");
        
if(gotBanned[player_banned] == 0)
        {
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#samp_ban"` (user_banned, user_banned_ip, user_banner, ban_reason, ban_timestamp, ban_time) VALUES ('%s', '%s', 'System', '%s', CURRENT_TIMESTAMP, %d)", jNames[player_banned], jIP[player_banned], reason, time);
            
mysql_tquery(handlejQuery"""");
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Data) VALUES ('%s', '%s', 'BAN', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], ban_reason);
            
mysql_tquery(handlejQuery"""");
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Data) VALUES ('%s', '%s', 'TBAN', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], ban_reason);
            
mysql_tquery(handlejQuery"""");
            
gotBanned[player_banned] = 1;
            new 
strkick[180];
            
format(strkicksizeof(strkick), ""chat" Antichat %s (%i) for: %s"PlayerName(player_banned), player_bannedreason);
            
SendClientMessage(player_banned, -1""chat""COL_WHITE" If you feel like this is a mistake please, visit website (Ban Appeals)");
            
SendClientMessageToAll(-1strkick);
            
SetTimerEx("DelayedBan"1000false"i"player_banned);
            
printf(jQuery);
        }
    }
    else
.......................... 
Reply
#7

I cannot imagine what is written after those ..............
Please post the function entirely
Reply
#8

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
I cannot imagine what is written after those ..............
Please post the function entirely
PHP код:
stock jBan(player_bannedplayer_bannerreason[], time 0system 0)
{
    if(
system == 0)
    {
        if(
strlen(reason) > MAX_REASON_LENGTH) return SendClientMessage(player_banner0xFFFFFF""chat" Sorry, the maximum reason length is "#MAX_REASON_LENGTH" characters!");
        
if(gotBanned[player_banned] == 0)
        {
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#samp_ban"` (user_banned, user_banned_ip, user_banner, ban_reason, ban_timestamp, ban_time) VALUES ('%s', '%s', 'System', '%s', CURRENT_TIMESTAMP, %d)", jNames[player_banned], jIP[player_banned], reason, time);
            
mysql_tquery(handlejQuery"""");
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Data) VALUES ('%s', '%s', 'BAN', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], ban_reason);
            
mysql_tquery(handlejQuery"""");
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Data) VALUES ('%s', '%s', 'TBAN', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], ban_reason);
            
mysql_tquery(handlejQuery"""");
            
gotBanned[player_banned] = 1;
            new 
strkick[180];
            
format(strkicksizeof(strkick), ""chat" Antichat %s (%i) for: %s"PlayerName(player_banned), player_bannedreason);
            
SendClientMessage(player_banned, -1""chat""COL_WHITE" If you feel like this is a mistake please, visit website (Ban Appeals)");
            
SendClientMessageToAll(-1strkick);
            
SetTimerEx("DelayedBan"1000false"i"player_banned);
            
printf(jQuery);
        }
    }
    else
    {
        if(
strlen(reason) > MAX_REASON_LENGTH) return SendClientMessage(player_banner0xFFFFFF""chat" Sorry, the maximum reason length is "#MAX_REASON_LENGTH" characters!");
        
if(gotBanned[player_banned] == 0)
        {
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Data) VALUES ('%s', '%s', 'BAN', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], ban_reason);
            
mysql_tquery(handlejQuery"""");
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Durata, Data) VALUES ('%s', '%s', 'TBAN', '%s', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], time, ban_reason);
            
mysql_tquery(handlejQuery"""");
            
gotBanned[player_banned] = 1;
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `samp_ban` (user_banned, user_banned_ip, user_banner, ban_reason, ban_timestamp, ban_time) VALUES ('%s', '%s', '%s', '%s', CURRENT_TIMESTAMP, %d)"jNames[player_banned], jIP[player_banned], jNames[player_banner], reasontime);
            
mysql_tquery(handlejQuery"""");
            
printf(jQuery);
            
pInfo[player_banned][Mesaj4] = 1;
            
SaveStats(ban_target);
            
SetTimerEx("DelayedBan"1000false"i"player_banned);
        }
    }
    return 
1;

Reply
#9

Do you kick or ban the player under DelayedBan?
Reply
#10

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Do you kick or ban the player under DelayedBan?
yes.

PHP код:
forward DelayedBan(player_banned);
public 
DelayedBan(player_banned)
{
    
Kick(player_banned);
    return 
1;

the /ban command works, but if player get's banned by system, his ban saves inside mysql but he doesn't get kicked.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)