SA-MP Forums Archive
[BUG] Strange mouse behavior - 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: [BUG] Strange mouse behavior (/showthread.php?tid=328090)



[BUG] Strange mouse behavior - Psymetrix - 23.03.2012

I've been playing with player textdraws and SelectTextDraw and every thing was fine as I was using a filterscript.
After porting the code into my gamemode I noticed some weird mouse behavior after the server was reset using gmx. Basically, when I press T to chat, my mouse is blinking quite rapidly. If i show a menu with selectable textdraws and use SelectTextDraw, OnPlayerClickTextDraw is spammed until the menu is removed again. I'm not sure whats causing this. I did a lot of debugging to try and find the problem before I noticed my mouse blinking as if it was being shown and then hidden 3 - 4 times a second.

EDIT: This can probably be ignored. https://sampforum.blast.hk/showthread.php?tid=328257.


Re: [BUG] Strange mouse behavior - Nanory - 24.03.2012

@EDIT: Ups you also post the solution. Sry my fault.

You have to use CancelSelectTextDraw like this:

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if (clickedid != Text:INVALID_TEXT_DRAW)
    {
    [...]
    CancelSelectTextDraw(playerid);
    }
    return 1;
}
and NOT like this, otherwise it will end in an endless loop (blinking mouse)
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    [...]
    CancelSelectTextDraw(playerid);
    return 1;
}



Re: [BUG] Strange mouse behavior - Chriille95 - 24.03.2012

lol i have it to sometimes O_O


Re : [BUG] Strange mouse behavior - Ultrascipter - 25.03.2012

Yeah.

OnPlayerClickTextDraw(playerid, Text:clickedid) is presented like this:

OnGameModeInit:

SetTimer("OnPlayerClickTextDraw", 750, 1, "ii", playerid, Text:clickedid);


Re: [BUG] Strange mouse behavior - Kalcor - 25.03.2012

This seems to be caused by a scripting fault (causing an infinite loop between SelectTextDraw and CancelSelectTextDraw).

This thread will be locked. Feel free to reopen it if it's an SA-MP bug.