Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] y_hooks - multi level hooking problem

 
  • 0 Vote(s) - 0 Average
Pawn y_hooks - multi level hooking problem
Luciano
Offline

Burgershot Member
Posts: 8
Threads: 6
Joined: Apr 2019
Reputation: 0
#1
2019-07-24, 09:02 PM
I have the following files:

Code:
====== gamemodes/mymode.pwn ======
#include <a_samp>
#include <YSI_Coding\y_hooks>
#include .\src\first.pwn

public OnGameModeInit()
{
    printf("mymode.pwn");
}


====== gamemodes/src/first.pwn ======
#include <YSI_Coding\y_hooks>
#include .\src\second.pwn

hook OnGameModeInit()
{
    printf("first.pwn");
}



====== gamemodes/src/second.pwn ======
#include <YSI_Coding\y_hooks>

hook OnGameModeInit()
{
    printf("second.pwn");
}


I'm getting this error: 
Code:
.\first.pwn(6) : error 021: symbol already defined: "@[email protected]"

Is it possible to use hooks like this and if yes, what is my mistake?
Manyula
Offline

Burgershot Member
Posts: 52
Threads: 5
Joined: Apr 2019
Reputation: 5
Location: Germany
#2
2019-07-25, 06:53 PM
You're including y_hooks three times in one file. Make sure to include it only once in a file. Remember that every file that uses the hooks needs to include y_hooks.
Y_Less
Offline

Administrator

Posts: 323
Threads: 16
Joined: Feb 2019
Reputation: 90
#3
2019-07-26, 10:26 AM
You can include it multiple times. Just make sure it is always the last include in a file.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode