SA-MP Forums Archive
[HELP] How to make a RandomMSG in a server? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] How to make a RandomMSG in a server? (/showthread.php?tid=272189)



[HELP] How to make a RandomMSG in a server? - RockandRol123 [PH] - 27.07.2011

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


Re: [HELP] How to make a RandomMSG in a server? - iPLEOMAX - 27.07.2011

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;
}



Re: [HELP] How to make a RandomMSG in a server? - Famalamalam - 27.07.2011

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


Re: [HELP] How to make a RandomMSG in a server? - iPLEOMAX - 27.07.2011

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..


Re: [HELP] How to make a RandomMSG in a server? - Famalamalam - 27.07.2011

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


Re: [HELP] How to make a RandomMSG in a server? - iPLEOMAX - 27.07.2011

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.


Re: [HELP] How to make a RandomMSG in a server? - Niixie - 27.07.2011

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


Re: [HELP] How to make a RandomMSG in a server? - RockandRol123 [PH] - 28.07.2011

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?


Re: [HELP] How to make a RandomMSG in a server? - iPLEOMAX - 28.07.2011

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


Re: [HELP] How to make a RandomMSG in a server? - RockandRol123 [PH] - 28.07.2011

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