hook function
#1

hi community.
i work on my anti cheat system
i know how to hook maybe OnPlayerConnect but idk how to hook maybe GivePlayerMoney.
Can anyone tell me how to hook maybe GivePlayerMoney ?
Reply
#2

You can use y_hooks, and you can do this:
pawn Код:
stock TG_GivePlayerMoney( playeid, CASH )
{
    GivePlayerMoney( playerid, CASH );
    return YOUR_HOOK( );
}
Reply
#3

Put at the end of the include this:
Код:
#define GetPlayerMoney sGetPlayerMoney
#define GivePlayerMoney sGivePlayerMoney
#define ResetPlayerMoney sResetPlayerMoney
You can take a look on my Anti-Cheat.

@ aRoach: Fail.
Reply
#4

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Put at the end of the include this:
Код:
#define GetPlayerMoney sGetPlayerMoney
#define GivePlayerMoney sGivePlayerMoney
#define ResetPlayerMoney sResetPlayerMoney
You can take a look on my Anti-Cheat.

@ aRoach: Fail.
can you give me a link ?
Reply
#5

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
can you give me a link ?
https://sampforum.blast.hk/showthread.php?tid=284282
Reply
#6

i understand your inc
can you hook GivePlayerMoney and give me code ?
Reply
#7

y_hooks is the best
Reply
#8

so how to hook functions ? maybe GivePlayerMoney

for callbacks i allready use _ALS_
Reply
#9

pawn Код:
stock Ex_GivePlayerMoney(...)
{
   // hello
   return GivePlayerMoney(...);
}
#define GivePlayerMoney Ex_GivePlayerMoney
Before all scripts, which use GivePlayerMoney. That's it!
Reply
#10

Quote:
Originally Posted by wups
Посмотреть сообщение
pawn Код:
stock Ex_GivePlayerMoney(...)
{
   // hello
   return GivePlayerMoney(...);
}
#define GivePlayerMoney Ex_GivePlayerMoney
Before all scripts, which use GivePlayerMoney. That's it!
Thanks,i was checking out this topic,thanks a lot bro.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)