Anti cheat 1.0
#6

Quote:
Originally Posted by XandyMello
View Post
Vocк poderia fazer esse anti xiter com settimer(contagens) e loops.

Exemplo:

PHP Code:
public OnGameModeInit()
{
    
SetTimer("AntiXiter"2000true);
    return 
1;
}
PlayerName(playerid//usar para obter nomes
{
     static 
Name[MAX_PLAYER_NAME];
     
GetPlayerName(playeridNameMAX_PLAYER_NAME);
     return 
Name;
}
forward AntiXiter();
public 
AntiXiter()
{
    static
        
string[100],
        
Float:x,
        
Float:y,
        
Float:z
    
;
    foreach(
Playerplayerid//for(new playerid = 0; i < MAX_PLAYERS; ++i)
    
{
        if(
GetPlayerWeapon(playerid) != WEAPON_PARACHUTE)
        {
            if(
GetPlayerAnimationIndex(playerid) != 974) continue;
            if(
GetPlayerAnimationIndex(playerid) != 968) continue;
            if(
GetPlayerAnimationIndex(playerid) != 974) continue;
            if(
kickado[playerid] == 0)
            {
                
kickado[playerid]++;
                
format(stringsizeof(string), "[ANTI-CHEAT]: %s foi kickado [Motivo: Skin Bug]"PlayerName(playerid));
                
SendClientMessageToAll(-1string);
                
SetTimerEx("rkick"500false"i"playerid);
                print(string);
            }
        }
        else if(
GetPlayerWeapon(playerid) != WEAPON_PARACHUTE && !IsPlayerInWater(playerid))
        {
            if(
GetPlayerAnimationIndex(playerid) != 959) continue;
            if(
GetPlayerAnimationIndex(playerid) != 1539) continue;
            
GetPlayerPos(playeridxyz);
            if(
14)
            {
                if(
kickado[playerid] == 0)
                {
                    
kickado[playerid]++;
                    
format(stringsizeof(string), "[ANTI-CHEAT]: %s foi kickado [Motivo: Fly]"PlayerName(playerid));
                    
SendClientMessageToAll(-1string);
                    
SetTimerEx("rkick"500false"i"playerid);
                    print(string);
                }
            }
        }
    }

foreach й uma include que vocк usa para loops, ela faz as voltas de acordo com a quantidade de players que estгo online no servidor. Ou seja, bem mais rбpida, diferentemente do loops normal(for) que faz as voltas em todas as slot(valor do MAX_PLAYERS).

ps: Eu fiz algumas auteraзхes em seu cуdigo, pois estava muito mal otimizado!

ps2: Parabйns pelo anti xiter.
Ele nгo usa foreach e vocк compilou isso?
Reply


Messages In This Thread
[FilterScript] Anti cheat 1.0 - by RedMF - 14.09.2016, 19:32
Re: Anti cheat 1.0 - by Bruno13 - 14.09.2016, 19:53
Re: Anti cheat 1.0 - by Carlos001 - 14.09.2016, 21:14
Re: Anti cheat 1.0 - by ViDaLoKa1 - 14.09.2016, 21:42
Re: Anti cheat 1.0 - by XandyMello - 15.09.2016, 03:24
Re: Anti cheat 1.0 - by RiqueP - 15.09.2016, 04:19
Re: Anti cheat 1.0 - by RiqueP - 15.09.2016, 13:07
Re: Anti cheat 1.0 - by RedMF - 15.09.2016, 13:30
Re: Anti cheat 1.0 - by Carlos001 - 15.09.2016, 20:54
Re: Anti cheat 1.0 - by Bruno13 - 15.09.2016, 21:52

Forum Jump:


Users browsing this thread: 2 Guest(s)