xD i had your source rememebr
O.OQuote:
tanels & hadesets
if (str == "/restart")
{
World.SendMsgToAll("Server Restart in 10 seconds!", "SYSTEM", 2011);
new Thread(new ThreadStart(
delegate()
{
Console.WriteLine("Server Restarting in 10 seconds!");
Thread.Sleep(5000);
Console.WriteLine("Server Restarting in 5 seconds!");
World.SendMsgToAll("Server Restart in 5 seconds!", "SYSTEM", 2011);
Thread.Sleep(5000);
General.ServerRestart();
}
)).Start();
}
private void button7_Click(object sender, EventArgs e)
{
}
private void restartToolStripMenuItem_Click(object sender, EventArgs e)
{
Process nServ = new Process();
nServ.StartInfo.FileName = Application.StartupPath + @"\Toxic.exe";
nServ.Start();
World.SaveAllChars();
Environment.Exit(0);
}
Quote:
Btw, Keving could you help me out...
I need to configure the buttons, I haven't done anything like this before to tell you the thruth.
For example, the Restart button I would like to configure it.
The code is.
Code:if (str == "/restart") { World.SendMsgToAll("Server Restart in 10 seconds!", "SYSTEM", 2011); new Thread(new ThreadStart( delegate() { Console.WriteLine("Server Restarting in 10 seconds!"); Thread.Sleep(5000); Console.WriteLine("Server Restarting in 5 seconds!"); World.SendMsgToAll("Server Restart in 5 seconds!", "SYSTEM", 2011); Thread.Sleep(5000); General.ServerRestart(); } )).Start(); }
Now how do I configure it to be added to the form.
Here is the code for Form1.cs
Code:private void button7_Click(object sender, EventArgs e) { }
Can you please tell me how to add the restart code between here.
private void button7_Click(object sender, EventArgs e)
{
General.ServerRestart();
}
For me, it's:Quote:
Restart code? :
Code:private void restartToolStripMenuItem_Click(object sender, EventArgs e) { Process nServ = new Process(); nServ.StartInfo.FileName = Application.StartupPath + @"\Toxic.exe"; nServ.Start(); World.SaveAllChars(); Environment.Exit(0); }
private void button7_Click(object sender, EventArgs e)
{
General.ServerRestart();
}
public static void
public static void ServerRestart ();
as you already have a textbox just make it send the message from text box to the server through World.SendMsgToAll i dont have mine anymore if we go on TV i can do it for you probablyQuote:
I had done that -.-
anyway, for some reason it said I was missing:
so I just made one in General called :Code:public static void
But I can't seem to get my 'Send Message' to work.Code:public static void ServerRestart ();
Any help?
First one to reply wins:p
:rolleyes:
private void button9_Click(object sender, EventArgs e)
{
World.SendMsgToAll(textBox.Text, "SYSTEM", 2011);
}
I dont fail at all, You got the error because your TextBox name isn't the same as mine.Quote:
No prownage you fail
World.SendMsgToAll(textBox.Text, "SYSTEM", 2011);
I get an error on textBox.
Ook sure tell me how to create an account, the more the merrier
nice guide some 1 will find this usefull bring back loft^^ and ahh btw nice consol :DQuote:
I bet most of you already know how to do this, but this is just for the people that don't know how to make the form open up.
First, open LOTF.
Then right-click on COServerProject in the Solution Explorer.
Click Add > Windows Form...
Then Form1.cs should be in the Solution Explorer.
Now go to View > Toolbox and you can start adding buttons and stuff.
Now to make the form load with the console, you go to General.cs
Above Console.ReadLine(); , add this code:
Note: if you rename Form1.cs to something else, Make Application.Run(new YourFormName());Code:Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1());
#Edit
If you get The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)
You need to add a reference by right-clicking on COServerProject > Add Reference > System.Core in the .NET tab.
Now the form will load and you make a control panel with the Toolbox provided on the side.
Look at my signature and you'll see how mine looks like. It looks kinda basic, but I'm accustomed to it.