Re: Help Press [ESC] to close TextDraw -
v1k1nG - 05.09.2018
Okay now I am wondering how to detect ESC key there now

I was almost sure it would work lol
Re: Help Press [ESC] to close TextDraw -
Mobtiesgangsa - 05.09.2018
To determin key presses for textdraws
use OnPlayerKeyStateChange(playerid, ......)
newkeys <=> oldkeys
dont forget to define that key also if you plan to use it (its called key mapping internal in to the server)
Re: Help Press [ESC] to close TextDraw -
khoinewghost - 06.09.2018
Quote:
Originally Posted by Mobtiesgangsa
To determin key presses for textdraws
use OnPlayerKeyStateChange(playerid, ......)
newkeys <=> oldkeys
dont forget to define that key also if you plan to use it (its called key mapping internal in to the server)
|
i don't really undertand - can u help me

i want my testdraw in OnPlayerClickPlayerTextDraw close when i press ESC
Re: Help Press [ESC] to close TextDraw -
Sew_Sumi - 06.09.2018
Quote:
Originally Posted by khoinewghost
i don't really undertand - can u help me  i want my testdraw in OnPlayerClickPlayerTextDraw close when i press ESC
|
That guy doesn't know what he's on about as Esc isn't picked up by PlayerKeyStateChange...
You should follow Lokii and v1k1nG.
The Text:INVALID_TEXT_DRAW is important, and when you make those sort of things, you need to make them like...
PHP код:
new Text:SewRocks; //Textdraw
new PlayerText:EveryoneRocks[MAX_PLAYERS] //Player Textdraw
If you don't then argument type mismatches will come up because you haven't created it as the right type, for the function that it's being passed on to.
Mind this as well...
Quote:
|
Originally Posted by wiki
When a player presses ESC to cancel selecting a textdraw, OnPlayerClickTextDraw is called with a textdraw ID of 'INVALID_TEXT_DRAW'. OnPlayerClickPlayerTextDraw won't be called also.
|
So you can't use OnPlayerClickPlayerTextDraw, you need to use OnPlayerClickTextDraw, and keep track of whether they are in a player textdraw menu, or a normal one via variables.
Re: Help Press [ESC] to close TextDraw -
sonn51280 - 06.09.2018
thanh niкn việt nam

hello việt nam
P/s say : Vietnamese
Re: Help Press [ESC] to close TextDraw -
NaS - 06.09.2018
Quote:
Originally Posted by Sew_Sumi
So you can't use OnPlayerClickPlayerTextDraw, you need to use OnPlayerClickTextDraw, and keep track of whether they are in a player textdraw menu, or a normal one via variables.
|
Actually that is pretty irrelevant. You just need to know in which menu they currently are (by a menu ID or whatever).
Generally you don't split menus etc by their type of TextDraw in this regard, but you hide and show the WHOLE thing at once.
So if the player is in a Weapon Selection and they press ESC, you hide all TextDraws of the Weapon Selection. Doesn't matter if those are global, per-player or mixed.
The callback is a bit misleading in that regard, it's called for aborting TextDraw selection. The TD selection is always for both types, not either of them.