Keys & Selecting textdraws
#1

Why doesn't this work?

pawn Code:
if ( PRESSED ( KEY_YES ) ) // Initiate the Dashboard!
    {
        if( accViewing [ playerid ] == 0 )  // They're not looking at anything else!
        {
            ShowPlayerDashboard ( playerid ), accViewing [ playerid ] = 1;
            SelectTextDraw( playerid, 0xC90411FF );
        }
           
        else return false;
    }
   
    if ( PRESSED ( KEY_NO ) ) // Hide the Dashboard!
    {
        if( accViewing [ playerid ] == 1 ) // They have the dashboard open already!
        {
            HidePlayerDashboard ( playerid ), accViewing [ playerid ] = 0;
            CancelSelectTextDraw ( playerid );
        }
    }
You don't need ShowPlayerDashboard or HidePlayerDashboard to diagnose this problem, all they do is show/hide textdraws.

The problem is, once you hit Y (KEY_YES), you can't hit N until you hit escape and cancel the mouse selection.
Reply
#2

Keys are disabled when selecting textdraws.
Reply
#3

Quote:
Originally Posted by Psymetrix
View Post
Keys are disabled when selecting textdraws.
Any way of getting around this?
Reply
#4

Hide them when they press ESC (INVALID_TEXT_DRAW passed to OnPlayerClick(Player)TextDraw).
Reply
#5

Quote:
Originally Posted by MP2
View Post
Hide them when they press ESC (INVALID_TEXT_DRAW passed to OnPlayerClick(Player)TextDraw).
So..

pawn Code:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if( playertextid == INVALID_TEXT_DRAW )
{
//they hit esc
}
return true;
}
? Good to know!

EDIT:

Odd, this doesn't seem to work..

pawn Code:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if( _:playertextid == INVALID_TEXT_DRAW )
    {
        // They hit ESC!
        HidePlayerDashboard ( playerid );
        accViewing [ playerid ] = 0;
    }
    return true;
}
Reply
#6

http://forum.sa-mp.com/showpost.php?...78&postcount=2

https://sampforum.blast.hk/showthread.php?tid=328195
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)