Random mesage
#1

how to make one that'll escape three lines per column as like here:




do it in this script

new rMessageList[][] = {
"Random Message 1 - Will not be preceeded or folowed by itself.\nRandom Message 2 - Will not be preceeded or folowed by itself.\nRandom Message 2 - Will not be preceeded or folowed by itself.",
"Random Message 2 - Will not be preceeded or folowed by itself.",
"Random Message 3 - Will not be preceeded or folowed by itself.",
"Random Message 4 - Will not be preceeded or folowed by itself.",
"Random Message 5 - Will not be preceeded or folowed by itself. \nHello world -------- its not working ;("
};
new rCheckList[sizeof(rMessageList)];

forward rMessage();

public rMessage()
{
new rNumber, Check = 0;
do{
for(new i=0; i<sizeof(rCheckList); i++)
if(rCheckList[i] != 0)
Check++;
if(Check == sizeof(rCheckList))
for(new i=0; i<sizeof(rCheckList); i++)
rCheckList[i] = 0;
rNumber = random(sizeof(rMessageList));
}while(rCheckList[rNumber]);
SendClientMessageToAll(COLOR_GOLD, rMessageList[rNumber]);
rCheckList[rNumber] = 1;
}

public OnFilterScriptInit()
{
SetTimer("rMessage", TIMER, true);
}
Reply
#2

I created a random server msg system (Link) once, which includes no-repeat of previous message. You might want to take a look at the source, I hope it can be of any help to you.
Reply
#3

new TipRandMessages[][] =
{
"TEXT",
"TEXT"
};
----------------------------
forward TipMessages();
----------------------------
public TipMessages()
{

SendClientMessageToAll(0xE100E1FF, TipRandMessages[random(sizeof(TipRandMessages))]);
return 1;
}
-------------------------
SetTimer("TipMessages",200000,1); //every 2 minutes ... also put this ongamemodeinit
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) OnPlayerConnect(i);
-------------------------


Best Regards
Stunt_Guy_Drift_Guy
Reply
#4

http://forum.sa-mp.com/showthread.ph...ght=p-messages
Reply
#5

Want to make random msgs? Well:
pawn Код:
public OnGameModeInit( )
{
    SetTimer ( "RandomMsgs", 120*1000, 1 ); // Will send a message every 2 minutes
    return 1;
}
pawn Код:
forward RandomMsgs( );
public RandomMsgs( )
{
    new msgs = random ( 5 ); // 5 msgs max!
    switch ( msgs )  
    {
        case 0: SendClientMessageToAll ( colorhere, "Message1" );
        case 1: SendClientMessageToAll ( colorhere, "Message2" );
        case 2: SendClientMessageToAll ( colorhere, "Message3" );
        case 3: SendClientMessageToAll ( colorhere, "Message4" );
        case 4: SendClientMessageToAll ( colorhere, "Message5" );
    }
    return 1;
}
Ofc change the "colorhere" to HEX color, and change "Message" to your rand message!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)