[Release] event handler / system message for 5165 source

03/15/2010 01:59 gulpi_de_gulat#1
i was partially made this and completed by pringle, i dont know if pringle is in here in this forum. but still credit to him.

Go to Program.cs and find:
Code:
public static Random Rnd = new Random();
Above this add:
Code:
public static DateTime SystemMsgTime = new DateTime();
scroll down and you found this
Code:
static void ServerStuff_Execute()
        {
            try
            {
                [COLOR="Red"]if (World.BroadCastCount > 0 && DateTime.Now > World.LastBroadCast.AddMinutes(1))[/COLOR]
                {
                    BroadCastMessage B = World.BroadCasts[0];

                    for (int i = 0; i < World.BroadCastCount; i++)
                        World.BroadCasts[i] = World.BroadCasts[i + 1];

                    World.BroadCastCount--;

                    World.SendMsgToAll(B.Name, B.Message, 2500, 0);
                    World.LastBroadCast = DateTime.Now;
                    World.CurrentBC = B;
                }
            }
above the red color add this
Code:
if (DateTime.Now > SystemMsgTime.AddMinutes(1))
                {
                    Handle_Events();
                    SystemMsgTime = DateTime.Now;
                }
scroll down again and you see this
Code:
static void CompanionThread_Execute()
Above this add:
Code:
 static void Handle_Events()
        {
            switch (DateTime.Now.Minute)
            {
                case 7:
                case 8:
                    Game.World.SendMsgToAll("GM", "GMs have [GM] or [PM] at the end of their names. Don`t trust anyone claiming to be a GM but not having [GM]/[PM] in their names.", 2011, 0);
                    break;
                case 19:
                case 20:
                    Game.World.SendMsgToAll("GM", "File account problems and TQ Point Card purchase problems at SUPPORT on the official site.", 2011, 0);
                    break;
                case 31:
                case 32:
                    Game.World.SendMsgToAll("GM", "Help UnknownMan at Market (212,204) to level up quickly.", 2011, 0);
                    break;
                case 43:
                case 44:
                    Game.World.SendMsgToAll("GM", "Trading of game accounts is illegal and may result in the instant banning of the accounts involved in the trading.", 2011, 0);
                    break;
                case 55:
                case 56:
                    Game.World.SendMsgToAll("GM", "co.91.com is the only official website of CO, which is also the only website where you can purchase Dragonballs.", 2011, 0);
                    break;
                default:
                    break;
            }
        }
you can put any event you want, but be sure not upset to each other
03/15/2010 02:08 ImFlamedCOD#2
This is a nice release ill say was waiting when somone would say something about this. Thought when the pk tourny's and other events got released someone would have released this sooner good job man.
03/15/2010 02:32 walmartboi#3
I've had this forever, but thanks for contributing.
03/15/2010 03:06 .Beatz#4
The name 'SystemMsgTime' does not exist in the current context

How do i make this work? sorry still quite a noob at coding :D would be good if someone can help me :)
03/15/2010 03:11 Arcо#5
Quote:
Originally Posted by mattyc2580 View Post
The name 'SystemMsgTime' does not exist in the current context

How do i make this work? sorry still quite a noob at coding :D would be good if someone can help me :)
You skipped step one.
public static DateTime SystemMsgTime = new DateTime();
03/15/2010 03:14 .Beatz#6
Quote:
Originally Posted by .Arco View Post
You skipped step one.
public static DateTime SystemMsgTime = new DateTime();

**EDIT**
yer got it working now .Arco i didnt copy the whole line right lol
03/15/2010 03:49 gulpi_de_gulat#7
hmmm, pls follow the thread correctly before the complain
03/15/2010 05:17 Arcо#8
Quote:
Originally Posted by gulpi_de_gulat View Post
hmmm, pls follow the thread correctly before the complain
He didn't quite complain, more as ask for further assistance.
03/15/2010 05:44 dieg900#9
I needed this for this source, I used a lot, because I had no idea how to modify the message and change my way, and another language, good job
03/18/2010 07:45 sawickas#10
Nice Thanks :)
How i can add His date?>>>>
Quote:
(DateTime.Now.DayOfWeek == DayOfWeek.Friday == DateTime.Now.Hour == 19 && DateTime.Now.Minute >= 45)
?
05/01/2010 14:46 nader_sah2000#11
how i can make it work