How can i make anticheat? I know something tought.
#1

Hello..

How can i change that like if it is GivePlayerMoney then it will ban player, but other functions would say like GivePlayerRealMoney?

And GivePlayerWeapon to GivePlayerRealWeapon?

I would appreciate help, and give 2 rep for help. I really need to know that .
Reply
#2

With variable.
Check some anti-cheat FS/include.
Reply
#3

Yes, that's what you do, you make internal function and internal saving of money/weapons

Also prepare for shitstorm of false-positive bans unless you decide not to ban people for it
Reply
#4

You need to create variables for each thing you want to create a anticheat for.

pawn Код:
new AC_pCash[ MAX_PLAYERS ];

#define GetPlayerCash(%1) AC_Cash[(%1)]

if( GetPlayerMoney( playerid ) != GetPlayerCash( playerid ) ) ResetPlayerMoney( playerid ), GivePlayerCash( GetPlayerCash( playerid );
^ Example
Reply
#5

pawn Код:
new RealMoney[500]; //at the top of the script

forward GivePlayerRealMoney(playerid, ammount);// somewhere in the script
public GivePlayerRealMoney(playerid, ammount)
{
   RealMoney[playerid] += ammount;
   GivePlayerMoney(playerid, ammount);
   return 1;
}


if(GetPlayerMoney(playerid) > RealMoney[playerid] ) { SendClientMessage(playerid, color, " Hacks Detected " ); } // Under OnPlayerUpdate
Replace every GivePlayerMoney with GivePlayerRealMoney in your gamemode and you got a quick anti money hack
Reply
#6

Quote:
Originally Posted by tour15
Посмотреть сообщение
pawn Код:
new RealMoney[500]; //at the top of the script

forward GivePlayerRealMoney(playerid, ammount);// somewhere in the script
public GivePlayerRealMoney(playerid, ammount)
{
   RealMoney[playerid] += ammount;
   GivePlayerMoney(playerid, ammount);
   return 1;
}


if(GetPlayerMoney(playerid) > RealMoney[playerid] ) { SendClientMessage(playerid, color, " Hacks Detected " ); } // Under OnPlayerUpdate
Replace every GivePlayerMoney with GivePlayerRealMoney in your gamemode and you got a quick anti money hack
So if someone hacks money he will get banned. Right?
Reply
#7

He will get a message "HAcks Detected" modifie it so he gets baned
Reply
#8

So i will add this
under the SendClientMessage thing where it says hacks detected?
pawn Код:
Ban(playerid)
?
Reply
#9

pawn Код:
new RealMoney[500]; //at the top of the script

forward GivePlayerRealMoney(playerid, ammount);// somewhere in the script
public GivePlayerRealMoney(playerid, ammount)
{
   RealMoney[playerid] += ammount;
   GivePlayerMoney(playerid, ammount);
   return 1;
}


if(GetPlayerMoney(playerid) > RealMoney[playerid] ) { SendClientMessage(playerid, color, " Hacks Detected " );    Ban(playerid); } // Under OnPlayerUpdate

I made it for you
Reply
#10

Impossible to hack money with this: https://sampforum.blast.hk/showthread.php?tid=71136
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)