Hide textdraw if ESC is pressed
#1

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

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

It should automatically remove it when you press ESC.
Reply
#4

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
Reply
#5

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

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

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

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

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
Reply
#10

Maybe try

PHP код:
DestroySelectionMenu(playerid); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)