Help Press [ESC] to close TextDraw
#21

Okay now I am wondering how to detect ESC key there now
I was almost sure it would work lol
Reply
#22

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)
Reply
#23

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

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

thanh niкn việt nam hello việt nam

P/s say : Vietnamese
Reply
#26

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


Forum Jump:


Users browsing this thread: 1 Guest(s)