[Tutorial] How to make Texdraw random messages!
#1

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

This Tut. was already posted.anyway,Nice
Reply
#3

Quote:
Originally Posted by Gamer_007
View Post
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!
Reply
#4

Hahaha another good tutorial here
Thanks mane
Reply
#5

Good job!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)