23.10.2017, 19:13
It's possible to use hook more times to a same public in different includes?
Ex:
Structure files.
-gamemode.pwn
In gamemode.pwn
In FolderSystems/system_name1.inc
In FolderSystems/system_name2.inc
And i got this error error 021: symbol already defined: "@yH_OnPlayerKeyStateChange@005" on system_name2.
This mean i can't use hook multiple times on a same public or I do something wrong?
How i should make my 'modular programming'... if hook don't work multiple times for a same public?
Should i make a function in system_name1, system_name2 and then calling on OnPlayerKeyStateChange in gamemode.pwn.
If i need do so, why i should use y_hook?
I have a big problema, anyone can explain me, ty.
I hope u undestood me.
Ex:
Structure files.
-gamemode.pwn
FolderSystems-system_name1.inc
-system_name2.inc
In gamemode.pwn
Код:
#include <samp> ... #include <YSI/y_hook> ... #include <FolderSystems/system_name1> #include <FolderSystems/system_name2> ... public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } ...
Код:
hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { //do something. return 1; }
Код:
hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { //do something. return 1; }
This mean i can't use hook multiple times on a same public or I do something wrong?
How i should make my 'modular programming'... if hook don't work multiple times for a same public?
Should i make a function in system_name1, system_name2 and then calling on OnPlayerKeyStateChange in gamemode.pwn.
If i need do so, why i should use y_hook?
I have a big problema, anyone can explain me, ty.
I hope u undestood me.