open.mp forum
[Pawn] Problem with OnPlayerClickTextdraw - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Problem with OnPlayerClickTextdraw (/showthread.php?tid=1450)



Problem with OnPlayerClickTextdraw - shane adevaratu - 2020-12-22

The OnPlayerClickTextdraw function is no longer called.

I use y_hooks in different includes to call this function. The rest of the functions that use y_hooks work,?less this.



Has anyone been through this and solved it, or do you have any idea what it might be?

A few days ago it worked perfectly.?I tried to disable each include that uses this function, or call them in the general public on gamemode, but the problem is still.


RE: Problem with OnPlayerClickTextdraw - Pinch - 2020-12-22

What do you return when you hook them?


RE: Problem with OnPlayerClickTextdraw - shane adevaratu - 2020-12-22

Return false.



Code:
hook OnPlayerClickTextDraw( playerid, Text:clickedid ) {

        //code

    return false; }



RE: Problem with OnPlayerClickTextdraw - Pinch - 2020-12-22

Don't return false,

Code:
#define Y_HOOKS_CONTINUE_RETURN_1    (1)        // Continue the hook chain, return 1
#define Y_HOOKS_CONTINUE_RETURN_0    (0)        // Continue the hook chain, return 0
#define Y_HOOKS_BREAK_RETURN_0        (~0)    // Break the hook chain, return 0
#define Y_HOOKS_BREAK_RETURN_1        (~1)    // Break the hook chain, return 1

EDIT: Those are already defined, just return them.

ex.: return Y_HOOKS_CONTINUE_RETURN_0;


RE: Problem with OnPlayerClickTextdraw - shane adevaratu - 2020-12-22

I've used the same method so far and everything worked. In addition, I have disabled all the includes in which I use y_hook.

The problem must be elsewhere.


RE: Problem with OnPlayerClickTextdraw - Pinch - 2020-12-22

Oh, I've misunderstood that, oop...



I ain't sure, added any new filterscript/inc?


RE: Problem with OnPlayerClickTextdraw - shane adevaratu - 2020-12-22

You are a genius. I used a filterscript a few days ago and I forgot to remove it. This causes the problem.


RE: Problem with OnPlayerClickTextdraw - Pinch - 2020-12-23

Well not really a genius...but good luck with the further work! ??