[BUG] Strange mouse behavior
#1

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.
Reply
#2

@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;
}
Reply
#3

lol i have it to sometimes O_O
Reply
#4

Yeah.

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

OnGameModeInit:

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)