anti-cheat
#1

Hi, i have this function for weapon checking. Well sometimes works good but, today i saw that it didn't save the IP from player. Actually 40 players banned and only 7 or 8 it shows the IP.
So do you know what is happening here.


PHP код:
//I have this at OnGameModeInit
SetTimer("WeaponCheck",2000,1);
public 
WeaponCheck()
{
    new 
IP[20], query[500];
    for ( new 
0MAX_PLAYERSi++) {
        if(!
IsPlayerConnected(i)) continue;
        if( 
PlayerInfo[i][pAdmin] > ) continue;
        if( 
WeaponGiven[i] == ) continue;
        if( 
Logged[i] == ) {
            
GetPlayerNameipnamesizeofpname ));
            
GetPlayerIpiIP20 );
            if(
GetPlayerWeapon(i) >= && GetPlayerWeapon(i) <= 45) {
                
format(querysizeof(query), "SELECT * FROM `Banned` WHERE `User` LIKE '%s' OR `IP` LIKE '%s' LIMIT 1"pnameIP);
                
mysql_query(query);
                
mysql_store_result();
                if(
mysql_num_rows() >= 1) {
                    
format(querysizeof(query), "UPDATE `Banned` SET IP='%s' WHERE `User` LIKE '%s'"IPpname);
                    
mysql_query(query);
                    
SendClientMessage(iCOLOR_SILVER"You are banned from this server");
                }
                else{
                       
formatmystringsizeof mystring"Admin-Log: %s has been banned for weapon hack(%s)."pnameIP);
                       
SendAdminMessageCOLOR_REDmystring );
                       
format(querysizeof(query), "INSERT INTO `Banned` (`User`, `Banned By` , `Reason`, `IP`) VALUES ('%s', 'Steve' ,'WEAPON HACK', '%s')"pnameIP);
                    
mysql_query(query);
                }
                
TogglePlayerControllable(i,0);
                   
Kick(i);
            }
        }
    }
    return 
1;

Reply
#2

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)