[HELP] How to make a RandomMSG in a server?
#1

Please teach me how to make a RandomMSG in my server Please teach me

Please tell me:
1 If we will be using Pawno what will I edit is it the gamemode or we will make a new FS

Thanks
Reply
#2

pawn Код:
// On top of your script.
#define RepeatingTime 3
// 3 = minutes

new AutoMessageNum;

//In OnFilterScriptInit or GameModeInit:
SetTimer("AutoMessage", RepeatingTime*1000*60, true);

//At the end of your script:
forward AutoMessage();
public AutoMessage()
{
    switch(AutoMessageNum)
    {
        case 0: SendClientMessageToAll(0xFFFFFFFF, "This is message number zero!");
        case 1: SendClientMessageToAll(0xFFFFFFFF, "This is message number one!");
        case 2: SendClientMessageToAll(0xFFFFFFFF, "This is message number two!");
        case 3: SendClientMessageToAll(0xFFFFFFFF, "This is message number three!");
        case 4: SendClientMessageToAll(0xFFFFFFFF, "This is message number four!");
        case 5: SendClientMessageToAll(0xFFFFFFFF, "This is message number five!");
        case 6: SendClientMessageToAll(0xFFFFFFFF, "This is message number six!");
        case 7: SendClientMessageToAll(0xFFFFFFFF, "This is message number seven!");
        case 8: SendClientMessageToAll(0xFFFFFFFF, "This is message number eight!");
        case 9: SendClientMessageToAll(0xFFFFFFFF, "This is message number nine!");
        case 10: SendClientMessageToAll(0xFFFFFFFF, "This is message number ten!");
    }
    if(AutoMessageNum < 10) { AutoMessageNum++; }
    else { AutoMessageNum = 0; }
    return true;
}
Reply
#3

Hummm, why didn't you just use an array, and the random() function?
Reply
#4

Quote:
Originally Posted by Famalamalam
Посмотреть сообщение
Hummm, why didn't you just use an array, and the random() function?
I like the messages to be in order. Random shows same message twice sometimes..
Reply
#5

Yes, random() is not all that random, I agree, lol. Still I think I'd rather use it than other ways.
Reply
#6

Quote:
Originally Posted by Famalamalam
Посмотреть сообщение
Yes, random() is not all that random, I agree, lol. Still I think I'd rather use it than other ways.
Yeah xD. But for simplicity, I did not use arrays here.
Will be little difficult for topic creator to understand if he is new.
Reply
#7

If you make it in an array, it's easier for a beginner to make it an advanced function and add random messages ingame.
Reply
#8

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
Yeah xD. But for simplicity, I did not use arrays here.
Will be little difficult for topic creator to understand if he is new.
Yes Im new

What will I open with Pawno?

Is it the Gamemode?
Reply
#9

You can use the code in a filterscript or gamemode, doesn't matter much though.
Reply
#10

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
You can use the code in a filterscript or gamemode, doesn't matter much though.
Done it!
But When I open samp server.exe

It just closes?

How to fix?

I really do not understand how to script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)