[FilterScript] Random Messages Script !
#6

You can use pastebin for short scripts like this.
Also :
Did you compile this ? ( the .pwn file of your script )
pawn Код:
//Credits To Giroud12//

#include <a_samp>

forward Servermessage();
public OnGameModeInit
SetTimer("Servermessage",1800000,1);
public Servernachricht()()
{
new rand = random(2);
 return 1;
}
switch(rand)
{
case 0: //If random select case 0
{
SendClientMessageToAll(-1,"[Bot]:Welcome To YourServerName 0.3x !");
}
case 1: //If Random select case 1
{
 SendClientMessageToAll(-1,"[Bot]:Play Fair And Follow Server Rules !");
}
case 1: //If Random select case 2
{
 SendClientMessageToAll(-1,"[Bot]:Use /report To Report Hackers !");
}
case 0: //If random select case 3
{
SendClientMessageToAll(-1,"[Bot]:Use /admins To See How Many Admins Online !");
}


//Then Add More If U Wanna Add More Messages ;)
//Its My First Script So Please Correct My Mistakes 0_0
What's that? Weird piece of code. When I compile that, my pawno crashes.
Rewritten code :
pawn Код:
#include < a_samp >

new
    g_szRandomMessages[ ][ ] = {
        "[Bot]: Welcome to my server ( 0.3x ) !",
        "[Bot]: Play fair and follow the server rules !",
        "[Bot]: Use /report to report hackers !",
        "[Bot]: Use /admins to see the list of online admins !"
    };
   
public OnFilterScriptInit( ) {
    SetTimer( "ServerMessage", 1000 * 60 /* 1 minutes */, true );
    return true;
}

forward ServerMessage( );
public ServerMessage( ) {
    new
        i = random( sizeof g_szRandomMessages );
    SendClientMessageToAll( -1, g_szRandomMessages[ i ] );
    return true;
}
I hope this helped, and don't give up on scripting! Try to make more things.
Reply


Messages In This Thread
Random Messages Script ! - by Giroud12 - 08.04.2013, 07:47
Re: Random Messages Script ! - by Xport6050 - 08.04.2013, 07:55
Re: Random Messages Script ! - by Giroud12 - 08.04.2013, 07:57
Re: Random Messages Script ! - by lean1337 - 08.04.2013, 12:51
Re: Random Messages Script ! - by Giroud12 - 09.04.2013, 09:10
Re: Random Messages Script ! - by greentarch - 09.04.2013, 10:52
Re: Random Messages Script ! - by RiChArD_A - 09.04.2013, 11:29
Re: Random Messages Script ! - by Biesmen - 09.04.2013, 11:34
Re: Random Messages Script ! - by Gamer_007 - 09.04.2013, 13:01

Forum Jump:


Users browsing this thread: 1 Guest(s)