How to make textdraw appear randomly
#1

How do i make random textdraw appear on the screen for every player. Kinda like Announcement system. It need to be easy to put a new line. :P

This is my current code, but it not appearing in my game.
Код:
#include <a_samp>
new Text:Text;

public OnFilterScriptInit()
{
	new var0[128];
	format(var0, 128, " ");
 	Text = TextDrawCreate(84.000000, 437.000000, var0);
 	TextDrawLetterSize(Text, 0.430000, 1.000000);
	TextDrawSetOutline(Text, 1);
	TextDrawFont(Text, 1);
	TextDrawColor(Text, -1);
	TextDrawSetOutline(Text, 0);
	TextDrawSetProportional(Text, 1);
	TextDrawSetShadow(Text, 1);
	SetTimer("TextDraw", 5000, true);

	return 1;
} //add this under ongamemodeinit

new aMessage[4][128] =
{
  {"Announcement 1"},
  {"Announcement 2"},
  {"Announcement 3"},
  {"Announcement 4"}
};

forward Timer();
public Timer() //SetTimer OnGameModeInit
{
  TextDrawSetString(Text:Text, aMessage[random(sizeof(aMessage))]);
  TextDrawShowForAll(Text:Text);
}
Reply


Messages In This Thread
How to make textdraw appear randomly - by GamerZPro - 27.05.2010, 10:53
Re: How to make textdraw appear randomly - by Bomber - 27.05.2010, 11:13
Re: How to make textdraw appear randomly - by Conroy - 27.05.2010, 12:06
Re: How to make textdraw appear randomly - by Bomber - 27.05.2010, 12:12
Re: How to make textdraw appear randomly - by GamerZPro - 27.05.2010, 13:02

Forum Jump:


Users browsing this thread: 1 Guest(s)