Random seting Text's on TextDraw's Problem!
#1

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
Reply
#2

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

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

EDIT: Working ) ... thaks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)