How To Make Ramdom Message
#1

Hey Guys I jUst Want To Know How To Make Some Ramdom Message
Reply
#2

pawn Код:
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);
Reply
#3

Quote:
Originally Posted by xMCx
Посмотреть сообщение
pawn Код:
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);
Ok I Will Try This
Reply
#4

Quote:
Originally Posted by Team_PRO
Посмотреть сообщение
Ok I Will Try This
tell me if it worked
Reply
#5

If you want random messages via textdraw
PHP код:
http://forum.sa-mp.com/showthread.php?t=327709 
If you want it with SendClientMessageToAll use timers. Example:
PHP код:
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...");

Reply
#6

Quote:
Originally Posted by xMCx
Посмотреть сообщение
tell me if it worked
It Work
i will use it too
Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
If you want random messages via textdraw
PHP код:
http://forum.sa-mp.com/showthread.php?t=327709 
If you want it with SendClientMessageToAll use timers. Example:
PHP код:
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...");

Thanks i will use this
Reply
#7

Код:
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)
	}
}
Reply
#8

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
If you want random messages via textdraw
PHP код:
http://forum.sa-mp.com/showthread.php?t=327709 
If you want it with SendClientMessageToAll use timers. Example:
PHP код:
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...");

LOL ...
Quote:

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 i will need 20 messages, i will make for that 20 timers? =) this is not a good option.

use xMCx script:
Quote:
Originally Posted by xMCx
Посмотреть сообщение
pawn Код:
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);
Reply
#9

More no. of timers = more lag.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)