SA-MP Forums Archive
Concept for native function hooks - 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: Concept for native function hooks (/showthread.php?tid=417405)



Concept for native function hooks - Chaprnks - 21.02.2013



In a module based script, there's times where I need to hook a native function more than once.. I've been trying to figure out a way to keep the actual SetPlayerArmor intact, then have additional code hooked onto that function. My idea was to have main.pwn basically be a header hook that has the actual function inside it; then the rest acting as added code. I'm curious to see what others think of this. It's almost like turning SetPlayerArmor into a callback; with additional hooks added.


Re: Concept for native function hooks - Psymetrix - 21.02.2013

I'm having the exact same problem. I have 10 include files, each with OnPlayerClickPlayerTextDraw hooked. All 10 files may, or may not come together in the end - this is my problem. A header file would be fine, if I didn't want each include to be stand-alone. I would prefer to hook once and call each includes own function, but that means knowing what files are included in advance. I don't want that if it can be helped.

I'm very new to multi-file scripting. Any documentation/tutorials on this subject would be appreciated.


Re: Concept for native function hooks - Chaprnks - 22.02.2013

You should organize the documentation in an easier to read format.. This isn't the first time I've seen someone have a question, that is already documented deep in the pile of posts.


EDIT:
I'd be willing to help you document; I know what YSI is capable of, but without clear documentation of all that it can do.. its basically not seeing its full potential.


Re: Concept for native function hooks - MP2 - 23.02.2013

Quote:
Originally Posted by Chaprnks
View Post
You should organize the documentation in an easier to read format.. This isn't the first time I've seen someone have a question, that is already documented deep in the pile of posts.


EDIT:
I'd be willing to help you document; I know what YSI is capable of, but without clear documentation of all that it can do.. its basically not seeing its full potential.
*cough* https://sampforum.blast.hk/showthread.php?tid=166016 *cough*


Re: Concept for native function hooks - LarzI - 24.02.2013

Quote:
Originally Posted by MP2
View Post
Quote:
Originally Posted by Chaprnks
View Post
You should organize the documentation in an easier to read format.. This isn't the first time I've seen someone have a question, that is already documented deep in the pile of posts.


EDIT:
I'd be willing to help you document; I know what YSI is capable of, but without clear documentation of all that it can do.. its basically not seeing its full potential.
*cough* https://sampforum.blast.hk/showthread.php?tid=166016 *cough*
*doublecough* http://ysi.wikia.com/wiki/YSI_Wiki *cough*


Re: Concept for native function hooks - Chaprnks - 24.02.2013

Quote:
Originally Posted by LarzI
View Post
Thanks!