Hooking error - 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: Hooking error (
/showthread.php?tid=636197)
Hooking error -
Eoussama - 22.06.2017
Hello there everybody, hope Y'all having a good day
so I faced this problem while trying to hook OnPlayerClickPlayerTextDraw
PHP код:
#if defined _ALS_OnPlayerClickPlayerTextDraw
#undef OnPlayerClickPlayerTextDraw
#else
#define _ALS_OnPlayerClickPlayerTextDraw
#endif
forward Hk_OnPlayerClickPlayerTextDraw(playerid, playertextid);
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid){
/*
****** etc***
*/
CallLocalFunction("Hk_OnPlayerClickPlayerTextDraw", "id", playerid, _:playertextid);
return 1;
}
I get this error each time no matter what I try to do
Код:
warning 200: symbol "_ALS_OnPlayerClickPlayerTextDra" is truncated to 31 characters
I ******d this several times, and I found ou that this problem occurs when you have a symbol more than 31 characters. This is the limit and you can't really exceed it
Код:
_ALS_OnPlayerClickPlayerTextDraw has 32 characters, the problem is from it
so is there any way I can bypass this?
I tried using y_hooks but I got the same error
Thanks in advance
Re: Hooking error -
Whatname - 22.06.2017
the callback name is too long
Re: Hooking error -
Eoussama - 22.06.2017
Quote:
Originally Posted by Whatname
the callback name is too long
|
That's just how it is
Re: Hooking error -
JasonRiggs - 22.06.2017
Try taking the First letters, I mean instead of
Код:
_ALS_OnPlayerClickPlayerTextDraw
make it
Re: Hooking error -
OneDay - 22.06.2017
PHP код:
_ALS_OnPlayerClickPlayerTD
Re: Hooking error -
Eoussama - 22.06.2017
Quote:
Originally Posted by JasonRiggs
Try taking the First letters, I mean instead of
Код:
_ALS_OnPlayerClickPlayerTextDraw
make it
|
thanks that seemed to work, so I take it that OPCPTD is a pre-defined abbreviation for OnPlayerClickPlayerTextDraw?
Re: Hooking error -
JasonRiggs - 22.06.2017
Just to shorten the name instead of OnPlayerClickPlayerTextDraw, Make it OPCTD or OnPlayerClickPlayerTD to make the name shorter..
Re: Hooking error -
OneDay - 22.06.2017
It must be _ALS_OnPlayerClickPlayerTD not _ALS_OPCTD or it won't work with other code libraries because they all must use the same name.
Re: Hooking error -
Whatname - 22.06.2017
you can use _ALS_OnPlayerClickTextDraw because both text draw and player text draws are supported
also its better than OnPlayerClickPlayerTextDraw because it can handle esc button