SA-MP Forums Archive
Hide textdraw if ESC is pressed - 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: Hide textdraw if ESC is pressed (/showthread.php?tid=549921)



Hide textdraw if ESC is pressed - dionisak0s - 09.12.2014

I need some help with this system https://sampforum.blast.hk/showthread.php?tid=549234
I downloaded it and everything works fine but when I press ESC the textdraw stucks on the screen, that means I have to use /wheelsmenu again and click on the "CLOSE" button in order to close it completely. Can you please show me how to do it? I know it's on OnPlayerClickTextDraw but I didn't get how to detect it so it may close after I press ESC; I tryed to find a solution but I didn't understand it.


Re: Hide textdraw if ESC is pressed - HY - 09.12.2014

Well, there's no key for Esc... but you can use another keys from here!

Here's a little script.

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_FIRE))
    {
        HideWheels(playerid)
    }
    return 1;
}
If he press KEY_FIRE [LMB] his textdraws will disappear.


Re: Hide textdraw if ESC is pressed - Abagail - 09.12.2014

It should automatically remove it when you press ESC.


Re: Hide textdraw if ESC is pressed - dionisak0s - 09.12.2014

I am talking about ESC, there's no ESC Key but you can do it using public OnPlayerClickTextDraw(playerid, Text:clickedid)
For the sake of god, I don't need any other key or I wouldn't ever bother myself to make a thread. I just want to hide the textdraw if I press ESC


Re: Hide textdraw if ESC is pressed - MrCallum - 09.12.2014

As Abagail said:

Quote:

It should automatically remove it when you press ESC.

It should already do this unless you have not defined the textdraw not being removed with the ESC Key being hit.


Re: Hide textdraw if ESC is pressed - HY - 09.12.2014

Quote:
Originally Posted by dionisak0s
Посмотреть сообщение
I am talking about ESC, there's no ESC Key but you can do it using public OnPlayerClickTextDraw(playerid, Text:clickedid)
For the sake of god, I don't need any other key or I wouldn't ever bother myself to make a thread. I just want to hide the textdraw if I press ESC
No, you can't. -_-


Re: Hide textdraw if ESC is pressed - dionisak0s - 09.12.2014

Quote:
Originally Posted by HY
Посмотреть сообщение
No, you can't. -_-
I am not an idiot mate, I know what I am doing and it's possible.


Re: Hide textdraw if ESC is pressed - Puff - 09.12.2014

It should remove it automatically, if it dosent then there is some fault with the script, try changing textdraw menu


Re: Hide textdraw if ESC is pressed - dionisak0s - 09.12.2014

Quote:
Originally Posted by Puff
Посмотреть сообщение
It should remove it automatically, if it dosent then there is some fault with the script, try changing textdraw menu
It doesn't, I gotta add something under OnPlayerClickTextdraw


Re: Hide textdraw if ESC is pressed - Puff - 09.12.2014

Maybe try

PHP код:
DestroySelectionMenu(playerid);