08.09.2012, 15:12
Okay today I will show you how can you make Random Messages.
Lets Begin!
The first step you will do to make random messages is this.
I added 4 messages here you can add as many as you want but after every message you need to make a
and you do not have to do this for last one.
Under on gamemode init you need to set timer like this
Timer is in miliseconds so 30000 is 30 seconds for 1 minute you can use 60000 and so on.
You need to forward this to make it work like this.
Now just you need to add callback of this its just sending the message to player.
I hope you have learned something from this.
Lets Begin!
The first step you will do to make random messages is this.
pawn Code:
new RandomMSG[][] =
{
"Random Tutorial Message 1",//This is the first message it will send,You ca change it to any thing you want.
"Random Tutorial Message 2",//Second Message
"Random Tutorial Message 3",//Third Message
"Random Tutorial Message 4"//Fourth Message
};
Code:
,
Under on gamemode init you need to set timer like this
pawn Code:
SetTimer("SendMSG", 30000, true);
You need to forward this to make it work like this.
pawn Code:
forward SendMSG();
pawn Code:
public SendMSG()
{
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(-1, RandomMSG[randMSG]);
}