How to make Texdraw random messages! -
Beljulji - 19.03.2013
1. We need to define timer:
Code:
forward RandomMessage();
2. We need to define texdraw:
Code:
new Text:randommsg;
3.Now we need to define messages that will show for players:
Code:
new RandomMessages[][] =
{
"~g~Message1",
"~r~Message2",
"~y~Message3",
"~b~Message4"
// You can add more messages but just make shure that you have "," everywhere just not on last message.
};
4. Now timer, add this code under OnGameModeInit:
Code:
SetTimer("RandomMessage",60000,1); // 60000 is for 1 Minute, if you want more or less seconds change "60000" to number you want 1 second = 1000 miliseconds
5. Put this code under OnGameModeInit:
Code:
randommsg = TextDrawCreate(7.000000, 427.000000, "");
TextDrawBackgroundColor(randommsg, 255);
TextDrawFont(randommsg, 1);
TextDrawLetterSize(randommsg, 0.379999, 1.499999);
TextDrawColor(randommsg, -1);
TextDrawSetOutline(randommsg, 1);
TextDrawSetProportional(randommsg, 1);
6.Now add public function for timer, add it anywhere you want.
Code:
public RandomMessage()
{
TextDrawSetString(randommsg, RandomMessages[random(sizeof(RandomMessages))]); // without this timer wont work!
return 1;
}
7. And Finally last step is make messages show when player connect or spawn.
Code:
TextDrawShowForPlayer(playerid, randommsg); // add this under OnPlayerSpawn (you can add it under OnPlayerConnect too!)
Hope i helped you, anyway this is my first tut so maybe im not so good at this for now.
Re: How to make Texdraw random messages! -
Gamer_007 - 19.03.2013
This Tut. was already posted.anyway,Nice
Re: How to make Texdraw random messages! -
Beljulji - 19.03.2013
Quote:
Originally Posted by Gamer_007
This Tut. was already posted.anyway,Nice
|
well i didnt know what tutorial to make so i made this one even i know that there is another one!
Re: How to make Texdraw random messages! -
qazwsx - 23.07.2013
Hahaha another good tutorial here
Thanks mane
Re: How to make Texdraw random messages! -
MiFi - 24.07.2013
Good job!