[Help] TextDrawDestroy - 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: [Help] TextDrawDestroy (
/showthread.php?tid=553357)
[Help] TextDrawDestroy -
Arxalan - 29.12.2014
Hello , i want to Destroy the TextDraw After 5 or 7 seconds
E.G.
PHP код:
new Text:welcomeText;
public OnGameModeInit()
{
// This line is used to create the textdraw.
// Note: This creates a textdraw without any formatting.
welcomeText = TextDrawCreate(240.0,580.0,"Welcome to my SA-MP server");
return 1;
}
public OnPlayerConnect(playerid)
{
//This is used to show the player the textdraw when they connect.
TextDrawShowForPlayer(playerid,welcomeText);
}
This is the code so i want that when player watch this textdraw , it automatically disappear after 5 seconds.
Re: [Help] TextDrawDestroy -
Pottus - 29.12.2014
So make a timer and function....
pawn Код:
SetTimerEx("DelayTextDrawHide", 6000, false, "ii", playerid, _:welcomeText);
forward DelayTextDrawHide(playerid, Text:id);
public DelayTextDrawHide(playerid, Text:id) { TextDrawHideForPlayer(playerid, id); }
Re: [Help] TextDrawDestroy -
dominik523 - 29.12.2014
Use a timer.
pawn Код:
SetTimerEx("TextdrawHide", 5000, false, "d", playerid);
forward public TextdrawHide(playerid);
public TextdrawHide(playerid)
{
TextDrawHideForPlayer(playerid, welcomeText);
return 1;
}
EDIT: Pottus was faster than me so I didn't see the post.
Re: [Help] TextDrawDestroy -
Arxalan - 29.12.2014
6000 and 5000 is time in seconds?
Re: [Help] TextDrawDestroy -
Pottus - 29.12.2014
Yes the difference between our posts is I made a generic function that would work with any textdraw his only works with one textdraw.
Re: [Help] TextDrawDestroy -
Arxalan - 29.12.2014
I want it for 5-7 but you typed 5000/6000 , is that milliseconds?
AW: Re: [Help] TextDrawDestroy -
Nero_3D - 29.12.2014
Quote:
Originally Posted by Arxalan
I want it for 5-7 but you typed 5000/6000 , is that milliseconds?
|
Yes, for information on natives you should check the wiki
https://sampwiki.blast.hk/wiki/SetTimerEx