Textdraw Help - 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: Textdraw Help (
/showthread.php?tid=613080)
Textdraw Help -
Sanady - 24.07.2016
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?
Re: Textdraw Help -
K0P - 24.07.2016
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);
Re: Textdraw Help -
Sanady - 24.07.2016
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
Re: Textdraw Help -
K0P - 24.07.2016
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?
Re: Textdraw Help -
Logic_ - 24.07.2016
remove the tag...
Re: Textdraw Help -
Deadpoop - 24.07.2016
do it onplayerclicktextdraw idk why but it doesnt hide onplayerclickplayertextdraw
Re: Textdraw Help -
Sew_Sumi - 24.07.2016
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(playerid, Text:clickedid)
PHP код:
if(clickedid == Text:INVALID_TEXT_DRAW)
Re: Textdraw Help -
K0P - 24.07.2016
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(playerid, PlayerText:playertextid)
{
if(IsValidPlayerTextDraw(playerid, playertextid /*your textdraw id*/))
{
//Do your work here
}
return 1;
}
Re: Textdraw Help -
jlalt - 24.07.2016
PHP код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid == INVALID_TEXT_DRAW)
{
//Do your work here
}
return 1;
}
Re: Textdraw Help -
Sew_Sumi - 24.07.2016
Jlalt has it... It calls OnPlayerClickTextDraw, not OnPlayerClickPlayerTextdraw when Esc is pressed.