Textdraw Help
#1

Yo, I have problem, I am working with Player Textdraws, and I wanted to create if player press ESC to textdraw hide, but how should I do it while I am using OnPlayerClickPlayerTextDraw. Also I read on wiki and forums that I need to use OnPlayerClickTextDraw callback for that, I did, but I get warning showing up: (4 : warning 213: tag mismatch
Line is: if(clickedid == INVALID_TEXT_DRAW)// ESC

Any help?
Reply
#2

Try using:
Код:
if(playertextid == INVALID_TEXT_DRAW)
Or if it dosent work then use this include : https://sampforum.blast.hk/showthread.php?tid=575261
And check if the textdraw is valid using this function
Код:
IsValidPlayerTextDraw(playerid, PlayerText:text);
Reply
#3

Quote:
Originally Posted by K0P
Посмотреть сообщение
Try using:
Код:
if(playertextid == INVALID_TEXT_DRAW)
Or if it dosent work then use this include : https://sampforum.blast.hk/showthread.php?tid=575261
And check if the textdraw is valid using this function
Код:
IsValidPlayerTextDraw(playerid, PlayerText:text);
First thing, I tried. Here is the result of the first try:
Код:
warning 213: tag mismatch
Also I don`t understand how should I check if is Invalid textdraw vaild? :O
Reply
#4

Quote:
Originally Posted by Sanady
Посмотреть сообщение
First thing, I tried. Here is the result of the first try:
Код:
warning 213: tag mismatch
Also I don`t understand how should I check if is Invalid textdraw vaild? :O
Have you tried that include?
Reply
#5

remove the tag...
Reply
#6

do it onplayerclicktextdraw idk why but it doesnt hide onplayerclickplayertextdraw
Reply
#7

Remember
PHP код:
Text:
// And
PlayerText
are like float. You HAVE to use it correctly. This is where the error is coming from.

PHP код:
new PlayerText:gPlayerText
new Text:gServerText 
PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid
PHP код:
if(clickedid == Text:INVALID_TEXT_DRAW
Reply
#8

Quote:
Originally Posted by Sanady
Посмотреть сообщение
Код:
warning 213: tag mismatch
It is showing the tag mismatch error because you are trying a "Global TextDraw" function on a "Player TextDraw"

Download this include: https://sampforum.blast.hk/showthread.php?tid=575261

Here is the code for you:

PHP код:
public OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid)
{
    if(
IsValidPlayerTextDraw(playeridplayertextid /*your textdraw id*/))
    {
        
//Do your work here
    
}
    return 
1;

Reply
#9

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
_:clickedid == INVALID_TEXT_DRAW)
    {
        
//Do your work here
    
}
    return 
1;

Reply
#10

Jlalt has it... It calls OnPlayerClickTextDraw, not OnPlayerClickPlayerTextdraw when Esc is pressed.
Reply


Forum Jump:


Users browsing this thread: