• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] y_hooks multiple includes
#1
Shocked 
I have a problem using y_hooks:

I have the main gamemode (main.pwn), and two "modules" that are included in it: "module1.inc" and "module2.inc".



In both of them, I have to use y_hooks. From what I knew, you had to reinclude y_hooks if you wanted to hook to the same function, so at top of each module, I have

Code:
#include "..\include\YSI\y_hooks.inc"

But I get a "symbol already defined" error in "module2" for the callbacks that have already been hooked to in the first one.
  Reply
#2
You're right it needs including in every file, but order is also important - it should be the last include in every file:



https://github.com/pawn-lang/YSI-Include...odeinit003
  Reply
#3
(2019-06-08, 12:55 AM)Y_Less Wrote: You're right it needs including in every file, but order is also important - it should be the last include in every file:



https://github.com/pawn-lang/YSI-Include...odeinit003

I know, but it already is. It is actually the only include in one of the files:



module1.inc:

Code:
#include "..\include\evf.inc"



#include "..\include\YSI\y_hooks.inc"



module2.inc:

Code:
#include "..\include\YSI\y_hooks.inc"
  Reply
#4
Ahh, don't write the `.inc` part.
  Reply


Forum Jump: