Anti Armour Hack problem -
Dripac - 20.03.2012
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%
Re: Anti Armour Hack problem -
Twisted_Insane - 20.03.2012
Just try it with "ban" first:
Also, won't you ever kill the timer?
Re: Anti Armour Hack problem -
Dripac - 20.03.2012
Quote:
Originally Posted by Twisted_Insane
Just try it with "ban" first:
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
Re: Anti Armour Hack problem -
Twisted_Insane - 20.03.2012
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.
Re: Anti Armour Hack problem -
Dripac - 20.03.2012
I don't think it's because of that, because i got the same timer with money, and it works
Re: Anti Armour Hack problem -
Dripac - 20.03.2012
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
Re: Anti Armour Hack problem - T0pAz - 20.03.2012
Show your timer declaration function.
Re: Anti Armour Hack problem -
Dripac - 20.03.2012
Quote:
Originally Posted by T0pAz
Show your timer declaration function.
|
I only got this, and SetTimer under OnGamemodeInit
SetTimer("ArmourTimer", 1000, 0);
Re: Anti Armour Hack problem - T0pAz - 20.03.2012
Quote:
Originally Posted by Dripac
I only got this, and SetTimer under OnGamemodeInit
SetTimer("ArmourTimer", 1000, 0);
|
pawn Код:
SetTimer("ArmourTimer", 1000, 1);
Try that.
Re: Anti Armour Hack problem -
antonio112 - 20.03.2012
Well of course it won't work since the timer isn't repeating:
pawn Код:
SetTimer("ArmourTimer", 1000, true);