Keys & Selecting textdraws - 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: Keys & Selecting textdraws (
/showthread.php?tid=338708)
Keys & Selecting textdraws -
2KY - 30.04.2012
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.
Re: Keys & Selecting textdraws -
Psymetrix - 30.04.2012
Keys are disabled when selecting textdraws.
Re: Keys & Selecting textdraws -
2KY - 30.04.2012
Quote:
Originally Posted by Psymetrix
Keys are disabled when selecting textdraws.
|
Any way of getting around this?
Re: Keys & Selecting textdraws -
MP2 - 30.04.2012
Hide them when they press ESC (INVALID_TEXT_DRAW passed to OnPlayerClick(Player)TextDraw).
Re: Keys & Selecting textdraws -
2KY - 30.04.2012
Quote:
Originally Posted by MP2
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;
}
Re: Keys & Selecting textdraws -
CyNiC - 01.05.2012
http://forum.sa-mp.com/showpost.php?...78&postcount=2
https://sampforum.blast.hk/showthread.php?tid=328195