Please help me about Textdraw
#1

I have a TextDraw type CreatePlayerTextDraw, when I use the / test command, it will display TextDraw, but when I press ESC it is still there. So when I press ESC it will hide TextDraw, I need someone who can help me, please.
Reply
#2

The textdraw wont just disappear by pressing ESC on its own you have to add that perhaps onplayerkeystatechange and visit Samp Keys Wiki
for the samp keys and using hidetextdrawforplayer Samp Wiki Textdraw (Hide)
Reply
#3

I hope this helps.

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
Text:INVALID_TEXT_DRAW == clickedid)
        
TextDrawHideForPlayer(playeridclickedid)

    return 
1;

Reply
#4

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
The textdraw wont just disappear by pressing ESC on its own you have to add that perhaps onplayerkeystatechange and visit Samp Keys Wiki
for the samp keys and using hidetextdrawforplayer Samp Wiki Textdraw (Hide)
Quote:
Originally Posted by Eoussama
Посмотреть сообщение
I hope this helps.

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
Text:INVALID_TEXT_DRAW == clickedid)
        
TextDrawHideForPlayer(playeridclickedid)
    return 
1;

But my is OnPlayerClickPlayerTextDraw
Reply
#5

adapt it with it then,
Reply
#6

Quote:
Originally Posted by hoanduy
Посмотреть сообщение
But my is OnPlayerClickPlayerTextDraw
public OnPlayerClickPlayerTextDraw(playerid, Text:clickedid)
{
if(clickedid == Text:INVALID_TEXT_DRAW)
{
TextDrawHideForPlayer(playerid, Textdraw0)
// add your textdraws here
}
return 1;
}
Reply
#7

Thanks All
Reply
#8

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
public OnPlayerClickPlayerTextDraw(playerid, Text:clickedid)
{
if(clickedid == Text:INVALID_TEXT_DRAW)
{
TextDrawHideForPlayer(playerid, Textdraw0)
// add your textdraws here
}
return 1;
}
That won't work. OnPlayerClickPlayerTextDraw isn't called when cancelling TD selection, only OnPlayerClickTextDraw.
SelectTextDraw is for both, global and per-player TextDraws so it wouldn't make any sense calling both callbacks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)