SA-MP Forums Archive
Random seting Text's on TextDraw's Problem! - 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: Random seting Text's on TextDraw's Problem! (/showthread.php?tid=342351)



Random seting Text's on TextDraw's Problem! - Edvin - 13.05.2012

Hi all!

I created a mini-filterscript, to set random texts to a textdraw.

Here it is:
Код:
#include <a_samp>

new Text:Random_TD_Texts;
new TD_Random_Messages[ ][ ] =
{
	"Text1",
	"Text2",
	"Text3",
	"Text4",
	"Text5"
};

public OnPlayeSpawn( playerid )
{
TextDrawShowForPlayer( playerid, Random_TD_Texts );
return 1;
}

public OnFilterScriptInit( )
{
        SetTimer( "Random_TD_Messages", 3000, 1 );

        Random_TD_Texts = TextDrawCreate(241.000000, 401.000000, "_");
	TextDrawBackgroundColor(Random_TD_Texts, 255);
	TextDrawFont(Random_TD_Texts, 1);
	TextDrawLetterSize(Random_TD_Texts, 0.200000, 1.000000);
	TextDrawColor(Random_TD_Texts, -1);
	TextDrawSetOutline(Random_TD_Texts, 0);
	TextDrawSetProportional(Random_TD_Texts, 1);
	TextDrawSetShadow(Random_TD_Texts, 1);
        return 1;
}

forward Random_TD_Messages( );
public Random_TD_Messages( )
{
	TextDrawSetString( Text:Random_TD_Texts, TD_Random_Messages[random(sizeof(TD_Random_Messages))]);
	return 1;
}
Here it is, but i don't know what to do it, because don't show any of that 5 Text's ... Please help


Re: Random seting Text's on TextDraw's Problem! - ViniBorn - 13.05.2012

pawn Код:
SetTimer( "Random_TD_Messages", 3000, 1 );

Random_TD_Texts = TextDrawCreate(241.000000, 401.000000, "_");
You are trying to use TextDrawSetString before TextDrawCreate


Re: Random seting Text's on TextDraw's Problem! - Edvin - 13.05.2012

EDIT: Working ) ... thaks!