SA-MP Forums Archive
Textdraw not showing.. - 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: Textdraw not showing.. (/showthread.php?tid=626922)



Textdraw not showing.. - danielpalade - 21.01.2017

-- DELETED --


Re: Textdraw not showing.. - Triggerz - 21.01.2017

The problem is that there's no timer for the textdraws to disappear. So it has to be done manually;

Use
Код:
TextDrawDestroy(//nameoftextdraw)
// or if it's a per player textdraw
PlayerTextDrawDestroy(//nameoftextdraw)
After you've destroyed the first text draw you can then create another one.

It is recommended that you use a timer to destroy text draws at a certain time, unless you want it to be done manually.


Re: Textdraw not showing.. - danielpalade - 23.01.2017

Quote:
Originally Posted by Triggerz
Посмотреть сообщение
The problem is that there's no timer for the textdraws to disappear. So it has to be done manually;

Use
Код:
TextDrawDestroy(//nameoftextdraw)
// or if it's a per player textdraw
PlayerTextDrawDestroy(//nameoftextdraw)
After you've destroyed the first text draw you can then create another one.

It is recommended that you use a timer to destroy text draws at a certain time, unless you want it to be done manually.
This is my timer:

Код:
	new Get[6];
    gettime(Get[3],Get[4],Get[5]);
    getdate(Get[0],Get[1],Get[2]);

    printf("clock");

	for(new i; i < MAX_PLAYERS; i++)
	{
		TextDrawDestroy(DateHUD);
		format(szMessage, sizeof(szMessage) , "%02d.%02d.%02d" , Get[ 2 ] , Get[ 1 ] , Get[ 0 ] );
		TextDrawSetString(DateHUD, szMessage);
		TextDrawShowForPlayer(i, DateHUD);

		TextDrawDestroy(TimeHUD);
		format(szMessage, sizeof(szMessage), "%02d:%02d", Get[3],Get[4]);
		TextDrawSetString(TimeHUD, szMessage);
		TextDrawShowForPlayer(i, TimeHUD);
	}
The timer works, as I get every second the message "clock" in the console.
But the TD is still not showing.


Re: Textdraw not showing.. - iLearner - 23.01.2017

Problem is ... The textdraw you created is global... And you're trying to use it as player textdraw.


Re: Textdraw not showing.. - danielpalade - 23.01.2017

Quote:
Originally Posted by iLearner
Посмотреть сообщение
Problem is ... The textdraw you created is global... And you're trying to use it as player textdraw.
And how do I have to create it then?