Hide specific TextDraw with a timer
#1

Hi!

I've got a question:

I have this text draw:

Code:
new Text:JeffersonTextDraw;
When people enter a certain place, it displays the text draw:

Code:
public EnterExit(playerid)
{
	// Salida interior principal del hotel comun
	if(GetPlayerDistanceToPointEx(playerid,2214.3914,-1150.5789,1025.7969) <= 1)
	{
	  SetPlayerInterior(playerid, 0);
	  SetPlayerPos(playerid, 2230.9124,-1158.8999,25.8308);
	  TextDrawHideForPlayer(playerid, JeffersonTextDraw);

    return 1;
	}
	// Entrada exterior principal del hotel comun
	if(GetPlayerDistanceToPointEx(playerid,2233.1624,-1160.1387,25.8906) <= 1)
	{
    SetPlayerInterior(playerid, 15);
	  SetPlayerPos(playerid, 2215.0,-1150.5789 + 1,1025.7969);
  	  TextDrawShowForPlayer(playerid, JeffersonTextDraw);
  	  SetTimerEx("HideDraws", 3000, false, "ii", playerid, JeffersonTextDraw);
    return 1;
	}

    return 1;
}
Now, as you see, I've tried to pass the text draw as a string too, but in game the textdraws wont disappear.

Code:
public HideDraws(playerid, draw)
{
  TextDrawHideForPlayer(playerid, draw);
	return 1;
}
What I'm I doing wrong?

I've done too:

Code:
forward HideDraws(playerid, Text:draw);

	if(GetPlayerDistanceToPointEx(playerid,2233.1624,-1160.1387,25.8906) <= 1)
	{
    SetPlayerInterior(playerid, 15);
	  SetPlayerPos(playerid, 2215.0,-1150.5789 + 1,1025.7969);
  	  TextDrawShowForPlayer(playerid, JeffersonTextDraw);
  	  SetTimerEx("HideDraws", 3000, false, "is", playerid, "JeffersonTextDraw");
    return 1;
	}

public HideDraws(playerid, Text:draw)
{
  TextDrawHideForPlayer(playerid, draw);
	return 1;
}
Reply
#2

Textdraws are special variables. Like when you do Text:TheTextdraw. I think it's like that so that you don't accidentally mess something up. Anyway, why don't you just do something like this?

pawn Code:
SetTimerEx("HideDraws", 3000, false, "i", playerid);

//Then further down
public HideDraws(playerid, draw)
{
  TextDrawHideForPlayer(playerid, JeffersonTextDraw);
  return 1;
}
Reply
#3

Cuz I want a single function to hide any text draw i pass to it.

Reply
#4

Anyone that can give me a clue?
Reply
#5

well, thanks anyway...

I made the timerex pass an integer like 1 for JeffersonTextDraw, 2 for LSPDTextDraw, etc...

Cheers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)