SA-MP Forums Archive
Auto-Message - 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)
+--- Thread: Auto-Message (/showthread.php?tid=468937)



Auto-Message - DouglasRamirez - 11.10.2013

Hello Guys,

How to script AUTO-MESSAGE? Like
-----
Razer : Hello, Welcome to the server and enjoy your stay here
-----
Something like that every 2 mins or What time I want


Re: Auto-Message - JeaSon - 11.10.2013

here it is
pawn Код:
#define BotName                    "{FF9900}Razer:"
new RandomMessages[][] =
{ // change all this Messages to your own server MSG's, TDC means Tokyo Drift Central so just change TDC to ur server name.
    BotName"Hello, Welcome to the server and enjoy your stay here "
};

under ongamemodeinit()
1000=1 second
now what ever mins or seconds you want

public OnGameModeInit()
{
SetTimer("AutomaticMessage", 50000, true);
return 1;
}

public  AutomaticMessage()
{
    new RandomColor[] = {COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE}; // Orange ( first ) and blue ( second )

    new RandomMessage = random(sizeof(RandomMessages));
    SendClientMessageToAll(RandomColor[random(sizeof(RandomColor))], RandomMessages[RandomMessage]); // -1 is a colour for a message.
    return true;
}



Re: Auto-Message - DouglasRamirez - 11.10.2013

Where should I put it? I mean which line.


Re: Auto-Message - JeaSon - 11.10.2013

about public anywhere

and define too

but

but this should be under ongamemodeinit
pawn Код:
SetTimer("AutomaticMessage", 50000, true);



Re: Auto-Message - Juandawson - 11.10.2013

hey bro, use this : Clicky


Re: Auto-Message - DouglasRamirez - 11.10.2013

Not working


Re: Auto-Message - Team_PRO - 11.10.2013

Код:
new RandomMSG[][] =
{
    "1: ..",//This is the first message it will send,You ca change it to any thing you want.
    "2: ..",//Second Message
    "3: ..",//Third Message
    "4: ..",//Fourth Message
    "5: .."//fifth Message
};
forward SendMSG();
public SendMSG()
{
    new randMSG = random(sizeof(RandomMSG));
    SendClientMessageToAll(-1, RandomMSG[randMSG]);
}
//under GameModeInit()
SetTimer("SendMSG", 300000, true);
Under

Код:
OnGamemodeInit()
SetTimer("SendMSG", 300000, true);//1000=1 , 2000=2 change any min or sec