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.