[Y_Hooks] Callback's name replacement -
Dayrion - 10.06.2017
Hello.
I've some problems with y_hooks. As you know, you can replace any name part of a callback by a diminutive to prevent the error of 32 characters.
This code is in the YSI's include:
PHP код:
// Create the default replacements.
DEFINE_HOOK_REPLACEMENT(Checkpoint, CP );
DEFINE_HOOK_REPLACEMENT(Container , Cnt);
DEFINE_HOOK_REPLACEMENT(Inventory , Inv);
DEFINE_HOOK_REPLACEMENT(Dynamic , Dyn);
DEFINE_HOOK_REPLACEMENT(TextDraw , TD );
DEFINE_HOOK_REPLACEMENT(Update , Upd);
DEFINE_HOOK_REPLACEMENT(Object , Obj);
DEFINE_HOOK_REPLACEMENT(Command , Cmd);
DEFINE_HOOK_REPLACEMENT(DynamicCP , DynamicCP);
DEFINE_HOOK_REPLACEMENT(Spawn, Spw);
The problem is, no one of my hook is called when I use replacement.
PHP код:
hook OnPlayerSpw(playerid)
{
printf("[DEBUGG] OnPlayerSpw CALLED");
return Y_HOOKS_CONTINUE_RETURN_1;
}
hook OnPlayerCmdPerformed(playerid, cmdtext[], success)
{
printf("OnPlayerCmdPerformed: '%s'", cmdtext);
return Y_HOOKS_CONTINUE_RETURN_1;
}
Of course, I did not modify the include (except adding 'DEFINE_HOOK_REPLACEMENT(Spawn, Spw)').
Have you some suggestions? Ideas or something?
Re: [Y_Hooks] Callback's name replacement -
Nicow - 10.06.2017
This is really weird
Re: [Y_Hooks] Callback's name replacement -
OneDay - 10.06.2017
Why you shorten them, they are not 32 character
Re: [Y_Hooks] Callback's name replacement -
Dayrion - 10.06.2017
Quote:
Originally Posted by OneDay
Why you shorten them, they are not 32 character
|
You don't know, certainly, how y_hooks works.
Let's show an example :
Код:
warning 200: symbol "@yH_OnPlayerEnterRaceCheckpoint" is truncated to 31 characters
So, to avoid this warning and prevent y_hooks to works perfectly; ****** made shortcut but they dont work for me.
Re: [Y_Hooks] Callback's name replacement -
Nicow - 11.06.2017
It doesn't work with OnVehicleDmgStatusUpd (OnVehicleDamageStatusUpdate) neither
Re: [Y_Hooks] Callback's name replacement -
Dayrion - 11.06.2017
Quote:
Originally Posted by ******
I did some playing and may have found a bug in the scanner. For now, just don't shorten names that don't need it.
|
As Nicow said, we need it for OnVehicleDamageStatusUpdate. Any temporary fix or manipulation to do?
Thank you for your answer.
Re: [Y_Hooks] Callback's name replacement -
Nicow - 12.06.2017
Thank you for your answer, I saw your commit about fixes.inc support for y_hooks
So i tried to hook OnVehicleDamageStatusUpdate without fixes and without updating YSI/AMX and still the same issue
Then I tried to update YSI and amx, with and without fixes but same problem
Re: [Y_Hooks] Callback's name replacement -
Dayrion - 13.06.2017
Quote:
Originally Posted by ******
Try the version of YSI I just uploaded. I've tracked and patched some bugs. I won't say "FIXED", I can imagine some corner-cases where the fix might fail, but I'm not even sure how to construct a test for those cases.
|
Just tried and it worked!
PHP код:
hook OnVehicleDmgStatusUpd(vehicleid, playerid)
{
print("[DEBUG] OnVehicleDamageStatusUpdate called from hook.");
return Y_HOOKS_CONTINUE_RETURN_1;
}
----
DEFINE_HOOK_REPLACEMENT(Damage, Dmg);
If we get another problem about Y_Hooks, we will post there or on your GIT.
Thank you for your precious help.
Re: [Y_Hooks] Callback's name replacement -
Nicow - 13.06.2017
Thanks a lot !