Register for your free account! | Forgot your password?

You last visited: Today at 00:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Adding form to load (LOTF)

Discussion on [Release] Adding form to load (LOTF) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old 04/04/2009, 02:12   #16
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
xD i had your source rememebr
PeTe Ninja is offline  
Old 04/04/2009, 09:33   #17


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
Quote:
tanels & hadesets
O.O

Same person, yes?
KraHen is offline  
Old 04/10/2009, 20:07   #18
 
Vortex.'s Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 275
Received Thanks: 22
Exclamation

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.
Vortex. is offline  
Old 04/10/2009, 20:30   #19
 
justprownage's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 203
Received Thanks: 87
Yeah, Keving go help him out.
justprownage is offline  
Old 04/10/2009, 20:33   #20
 
elite*gold: 0
Join Date: Apr 2008
Posts: 56
Received Thanks: 8
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);
        }
DungMaster is offline  
Old 04/10/2009, 20:40   #21
 
elite*gold: 0
Join Date: Apr 2009
Posts: 354
Received Thanks: 105
Quote:
Originally Posted by Vortex. View Post
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.

just do this... and it should work

Code:
private void button7_Click(object sender, EventArgs e)
        {
               General.ServerRestart();
        }
CoAttack is offline  
Thanks
1 User
Old 04/10/2009, 20:41   #22
 
justprownage's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 203
Received Thanks: 87
Quote:
Originally Posted by DungMaster View Post
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);
        }
For me, it's:
Code:
private void button7_Click(object sender, EventArgs e)
{
   General.ServerRestart();
}
#edit
****, CoAttack posted 1 minute faster than me.
justprownage is offline  
Old 04/10/2009, 20:44   #23
 
elite*gold: 0
Join Date: Apr 2009
Posts: 354
Received Thanks: 105
Quote:
Originally Posted by justprownage View Post
For me, it's:
Code:
private void button7_Click(object sender, EventArgs e)
{
   General.ServerRestart();
}
#edit
****, CoAttack posted 1 minute faster than me.
hahah ...
CoAttack is offline  
Old 04/10/2009, 21:54   #24
 
Vortex.'s Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 275
Received Thanks: 22
Exclamation

I had done that -.-
anyway, for some reason it said I was missing:

Code:
public static void
so I just made one in General called :

Code:
public static void ServerRestart ();
But I can't seem to get my 'Send Message' to work.

Any help?

First one to reply wins
Vortex. is offline  
Old 04/10/2009, 23:23   #25
 
elite*gold: 0
Join Date: Apr 2009
Posts: 354
Received Thanks: 105
Cool

Quote:
Originally Posted by Vortex. View Post
I had done that -.-
anyway, for some reason it said I was missing:

Code:
public static void
so I just made one in General called :

Code:
public static void ServerRestart ();
But I can't seem to get my 'Send Message' to work.

Any help?

First one to reply wins
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 probably
CoAttack is offline  
Old 04/11/2009, 01:41   #26
 
justprownage's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 203
Received Thanks: 87
That's easy, just do:
Code:
private void button9_Click(object sender, EventArgs e)
{
  World.SendMsgToAll(textBox.Text, "SYSTEM", 2011);
}
...I win
justprownage is offline  
Thanks
1 User
Old 04/11/2009, 02:02   #27
 
elite*gold: 0
Join Date: Apr 2009
Posts: 354
Received Thanks: 105
Quote:
Originally Posted by justprownage View Post
That's easy, just do:
Code:
private void button9_Click(object sender, EventArgs e)
{
  World.SendMsgToAll(textBox.Text, "SYSTEM", 2011);
}
...I win
next tell him how to create an account ( hint* doesn't have ini files so not like yours )

xD
CoAttack is offline  
Old 04/11/2009, 02:26   #28
 
Vortex.'s Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 275
Received Thanks: 22
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
Vortex. is offline  
Old 04/11/2009, 04:46   #29
 
justprownage's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 203
Received Thanks: 87
Quote:
Originally Posted by Vortex. View Post
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
I dont fail at all, You got the error because your TextBox name isn't the same as mine.

#edit
Btw, to add Account Creation for MySQL you need to add a function for the form to connect to your Database.
justprownage is offline  
Old 04/11/2009, 07:19   #30
 
superplox's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 275
Received Thanks: 23
Quote:
Originally Posted by justprownage View Post
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:
Code:
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
Note: if you rename Form1.cs to something else, Make Application.Run(new YourFormName());

#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.
nice guide some 1 will find this usefull bring back loft^^ and ahh btw nice consol
superplox is offline  
Reply


Similar Threads Similar Threads
[Release] Adding Ninja LOTF
07/04/2011 - CO2 PServer Guides & Releases - 73 Replies
You can add (Ninja , New Character ) Items , Skills , NPcs ...... By following the links and info And i can call it It isn't code or something like that .. i can help you to add ninja on LOTF (5017) ------------------- First go to YourConquerFolder/ini/ProfessionalName.ini in it add 50 means Character id . The command will be /job 50 for internNinja Now you added the character
how cant load agility in lotf 5165
02/21/2010 - CO2 Private Server - 2 Replies
i want to cant load agility in lotf coz it get attak is big in archers and all characters so can any one tell me how to fix it or didnt load agility
[HELP] LOTF - Form
05/01/2009 - CO2 Private Server - 0 Replies
Hey all, i fallow the http://www.elitepvpers.com/forum/co2-pserver-discus sions-questions/227896-release-adding-form-load-lo tf.html I make own Form u can see here: http://img91.imageshack.us/img91/426/lolvex.jpg How i need? I need to fix Day/Night on top Control Panel, what to write in button line? And i need add progresBar function on click restart server,
[Release] Adding Form to your Server
09/21/2008 - CO2 Private Server - 35 Replies
You wanna have an Form like on CoFuture? -Then you are here right. Info: Says nothing about my English, I've tried my best 1) Create a new form "Control.cs" 2) Look in General.cs for: "public static System.IO.StreamWriter sw = new System.IO.StreamWriter(Application.StartupPath + @"\ServerLog.txt", true);"
[Help] With adding skills in lotf
09/09/2008 - CO2 Private Server - 4 Replies
How exactly would i like add skills in lotf casue i want to add some more skills. I'll release it if some one could help me on how to do it :)



All times are GMT +1. The time now is 00:22.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.