Anti Armour Hack problem
#1

pawn Код:
forward ArmourTimer();
public ArmourTimer()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new Float:armour[MAX_PLAYERS];
            GetPlayerArmour(i, armour[i]);
            if( armour[i] > 99.1 )
            {
                BanEx( i, "Armour Hack" );
            }
        }
    }
}
It doesn't ban the player, i use a anti-cheat program for testing, and it doesn't ban me if i do 'Restore Armour', which sets the armour to 100%
Reply
#2

Just try it with "ban" first:

pawn Код:
Ban ( i );
Also, won't you ever kill the timer?
Reply
#3

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
Just try it with "ban" first:

pawn Код:
Ban ( i );
Also, won't you ever kill the timer?
Whats the difference? I also tried with kick, still not working, but it works if i put it under OnPlayerUpdate, but then it spamms the ban log
Reply
#4

I don't know if this is the problem, but your callback hasn't got "playerid" included, does it? All the others, such as "OnPlayerUpdate", do have...Maybe you should try it in this way.
Reply
#5

I don't think it's because of that, because i got the same timer with money, and it works
Reply
#6

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
What you are doing wrong here is declaring an array for all the players inside a loop for all the players.
You don't need to use an array because as soon as you loop passes one ID the armour variable can be re-used:

pawn Код:
forward ArmourTimer();
public ArmourTimer()
{
    new Float:fPlayerArmour;
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerArmour(i, fPlayerArmour);
            if( fPlayerArmour > 99.1 )
            {
                printf("Player:%d Armour Hack", i);
                // ban(...)
            }
        }
    }
}
Also for debugging you should print the 'fPlayerArmour' value just to see what it's doing.
If you don't want to spam the console make a quick textdraw and update it with the value using a format.
It still doesn't kick me, also doesn't show the print message in the console
Reply
#7

Show your timer declaration function.
Reply
#8

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Show your timer declaration function.
I only got this, and SetTimer under OnGamemodeInit

SetTimer("ArmourTimer", 1000, 0);
Reply
#9

Quote:
Originally Posted by Dripac
Посмотреть сообщение
I only got this, and SetTimer under OnGamemodeInit

SetTimer("ArmourTimer", 1000, 0);
pawn Код:
SetTimer("ArmourTimer", 1000, 1);
Try that.
Reply
#10

Well of course it won't work since the timer isn't repeating:
pawn Код:
SetTimer("ArmourTimer", 1000, true);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)