Auto-Message
#1

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
Reply
#2

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;
}
Reply
#3

Where should I put it? I mean which line.
Reply
#4

about public anywhere

and define too

but

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

hey bro, use this : Clicky
Reply
#6

Not working
Reply
#7

Код:
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)