15.11.2012, 09:24
Hey Guys I jUst Want To Know How To Make Some Ramdom Message
new RandomMSG[][] =
{
"1: ..",//This is the first message it will send,You ca change it to any thing you want.
"2: ..",//Second Message
"3: ..",//Third Message
"4: ..",//Fourth Message
"5: .."//fifth Message
};
forward SendMSG();
public SendMSG()
{
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(-1, RandomMSG[randMSG]);
}
//under GameModeInit()
SetTimer("SendMSG", 300000, true);
pawn Код:
|
http://forum.sa-mp.com/showthread.php?t=327709
forward Random1();
forward Random2();
forward Random3();
OnPlayerConnect
SetTimer("Random1",20000,1);
SetTimer("Random2",30000,1);
SetTimer("Random3",40000,1);
public Random1()
{
SendClientMessageToAll(COLOR_LIME,"Seen a hacker report...");
}
public Random2()
{
SendClientMessageToAll(COLOR_LIME,".............");
}
public Random3()
{
SendClientMessageToAll(COLOR_LIME,"GTFO this server...");
}
If you want random messages via textdraw
PHP код:
PHP код:
|
forward RandomMessage(); public OnGameModeInit() { SetTimer("RandomMessage",120000,1); return 1; } public RandomMessage() { new mrand =random(10); new string[128]; if(mrand == 1) { //SendClientMessageToAll(COLOR,MESSAGE) } if(mrand == 2) { //SendClientMessageToAll(COLOR,MESSAGE) } if(mrand == 3) { //SendClientMessageToAll(COLOR,MESSAGE) } if(mrand == 4) { //SendClientMessageToAll(COLOR,MESSAGE) } if(mrand == 5) { //SendClientMessageToAll(COLOR,MESSAGE) } if(mrand == 6) { //SendClientMessageToAll(COLOR,MESSAGE) } if(mrand == 7) { //SendClientMessageToAll(COLOR,MESSAGE) } if(mrand == 8) { //SendClientMessageToAll(COLOR,MESSAGE) } if(mrand == 9) { //SendClientMessageToAll(COLOR,MESSAGE) } if(mrand == 10) { //SendClientMessageToAll(COLOR,MESSAGE) } }
If you want random messages via textdraw
PHP код:
PHP код:
|
SetTimer("Random1",20000,1); SetTimer("Random2",30000,1); SetTimer("Random3",40000,1); public Random1() { SendClientMessageToAll(COLOR_LIME,"Seen a hacker report..."); } public Random2() { SendClientMessageToAll(COLOR_LIME,".............") ; } public Random3() { SendClientMessageToAll(COLOR_LIME,"GTFO this server..."); } |
pawn Код:
|