How i make...
#1

Hello , i'd like to know how i can make a textdraw disappear after 10 seconds.I know , i have to use a timer but i don't know how to make the textdraw disspear .
Reply
#2

TextDrawDestroy(Text:text); or TextDrawHideForAll(Text:text); or TextDrawHideForPlayer(playerid, Text:text);

What they do should be clear just use the one you need
Reply
#3

No errors but the textdraw doesn't appear
this is the code
Код:
#include <a_samp>

new Text:Textdraw0;

public OnFilterScriptInit()
{
	print("Textdraw file generated by");
	print("    Zamaroht's textdraw editor was loaded.");
	
	SetTimer("InCar",10000,1);

	Textdraw0 = TextDrawCreate(288.000000, 430.000000, "Apasa 2 pentru a repara masina si apasa CLICK pentru a adauga nitro!");
	TextDrawBackgroundColor(Textdraw0, 255);
	TextDrawFont(Textdraw0, 1);
	TextDrawLetterSize(Textdraw0, 0.280000, 1.000000);
	TextDrawColor(Textdraw0, 1502239743);
	TextDrawSetOutline(Textdraw0, 1);
	TextDrawSetProportional(Textdraw0, 1);

	return 1;
}

public OnFilterScriptExit()
{
	TextDrawHideForAll(Textdraw0);
	TextDrawDestroy(Textdraw0);
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
		TextDrawShowForPlayer(playerid, Textdraw0);
	}
	else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
	{
		TextDrawHideForPlayer(playerid, Textdraw0);
	}
	return 1;
}

forward InCar();
public InCar()
{
TextDrawDestroy(Text:Textdraw0);
return 1;
}
What's wrong ?
Reply
#4

if you " Destroy " it you're like deleting it from the server, if you want to remove it for just little time, use the Hide function instead... Destroy is there to remove it permanently till reset the script or define the textdraw again. correct me ppl if i'm wrong with this ^^.
Reply
#5

Silvan , what i am trying to do is , when a player enter a car the textdraw will appear and say "Press 2 to repair the car and CLICK to add Nitro" after 10 seconds the textdraw disappears , when he enter in car again , textdraw appears ...after 10 seconds dispappears ... you understand ?
Reply
#6

Change
pawn Код:
SetTimer("InCar",10000,1);
to
pawn Код:
SetTimerEx("InCar",10000,0,"i",playerid);
and move it under
pawn Код:
TextDrawShowForPlayer(playerid, Textdraw0);
And change
pawn Код:
forward InCar();
public InCar()
{
TextDrawDestroy(Text:Textdraw0);
return 1;
}
to
pawn Код:
forward InCar(playerid);
public InCar(playerid) TextDrawHideForPlayer(playerid, Textdraw0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)