SA-MP Forums Archive
Hi, Help with the anti-cheat. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Hi, Help with the anti-cheat. (/showthread.php?tid=606259)



Hi, Help with the anti-cheat. - ZToPMaN - 01.05.2016

I'm trying to make one, but i couldn't, so i'm watching out the filterscripts i've searched alot for one. But, all of them when i try to givemoney(anti-money hack) with my admin duty, or setarmour (anti-armour)
It kicks/ resets my hp/army/money. Because, when i try to use my commands it detect it as a cheat, any ideas for stuff like this? Which i can add?


Re: Hi, Help with the anti-cheat. - MarikAshtar - 01.05.2016

Post your givemoney command, and the detection code

EDIT: My guess is you don't use the same "give money function"


Re: Hi, Help with the anti-cheat. - colonel-top - 02.05.2016

You need to Mix Your Filterscripts With You administrator filterscripts because its different section
So when you mixed it Just add condition Like :
PHP код:
new givenbyadmin[MAX_PLAYERS]; 
PHP код:
OnPlayerUpdate 
pawn Код:
if(Detect Money anti cheat blah blah && givenbyadmin == false)
{
   Do Condition
}
pawn Код:
CMD:givemoney
{
  Your Condition Blah Blah
  givenbyadmin [target] = true;
}
and
PHP код:
OnPlayerDisconnect
{
  
Blahblah
 givenbyadmin
[playerid] = false;

Just Example for your idea


Re: Hi, Help with the anti-cheat. - introzen - 02.05.2016

Quote:
Originally Posted by colonel-top
Посмотреть сообщение
You need to Mix Your Filterscripts With You administrator filterscripts because its different section
So when you mixed it Just add condition Like :
PHP код:
new givenbyadmin[MAX_PLAYERS]; 
PHP код:
OnPlayerUpdate 
pawn Код:
if(Detect Money anti cheat blah blah && givenbyadmin == false)
{
   Do Condition
}
pawn Код:
CMD:givemoney
{
  Your Condition Blah Blah
  givenbyadmin [target] = true;
}
and
PHP код:
OnPlayerDisconnect
{
  
Blahblah
 givenbyadmin
[playerid] = false;

Just Example for your idea
There's rarely any need for using OnPlayerUpdate now that there's OnPlayerTakeDamage. Money AC kan be checked on timer with several seconds interval.


Re: Hi, Help with the anti-cheat. - ZToPMaN - 02.05.2016

I've tried to do like you said, but I've a little problem..
pawn Код:
forward CheckMoney();
public CheckMoney()
{
      for(new i = 0; i < MAX_PLAYERS; i++)
      {
            if(GetPlayerMoney(i) > NewMoney[i] && givenbyadmin[i] == false)
            {
                ResetPlayerMoney(NewMoney[i]);
            }
      }
      return 1;
}
warring: tag mis-match.


Re: Hi, Help with the anti-cheat. - Micko123 - 02.05.2016

Код:
ResetPlayerMoney(playerid);
Reset player money goes like this


Re: Hi, Help with the anti-cheat. - oMa37 - 02.05.2016

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Код:
ResetPlayerMoney(playerid);
Reset player money goes like this
This will reset all the player money, But with that one it will only reset the new money means the hacked money


Re: Hi, Help with the anti-cheat. - ZToPMaN - 02.05.2016

The error near &&


Re: Hi, Help with the anti-cheat. - Dayrion - 02.05.2016

Try (maybe i'm wrong)
PHP код:
forward CheckMoney();
public 
CheckMoney()
{
      for(new 
0MAX_PLAYERSi++)
      {
            new 
oldMoney GetPlayerMoney(i)
              if(
oldMoney NewMoney[i] && !givenbyadmin[i])
              {
                  
ResetPlayerMoney(i);
                  
GivePlayerMoney(ioldMoney);
            }
      }
      return 
1;




Re: Hi, Help with the anti-cheat. - ZToPMaN - 02.05.2016

Thanks, It's working now. I added more stuffs for this ;-;.
+REP for all of you.