Hide specific TextDraw with a timer - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hide specific TextDraw with a timer (
/showthread.php?tid=98622)
Hide specific TextDraw with a timer -
clavador - 22.09.2009
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;
}
Re: Hide specific TextDraw with a timer -
Backwardsman97 - 22.09.2009
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;
}
Re: Hide specific TextDraw with a timer -
clavador - 22.09.2009
Cuz I want a single function to hide any text draw i pass to it.
Re: Hide specific TextDraw with a timer -
clavador - 22.09.2009
Anyone that can give me a clue?
Re: Hide specific TextDraw with a timer -
clavador - 23.09.2009
well, thanks anyway...
I made the timerex pass an integer like 1 for JeffersonTextDraw, 2 for LSPDTextDraw, etc...
Cheers.