Register for your free account! | Forgot your password?

You last visited: Today at 17:39

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

Advertisement



Little Help :)?

Discussion on Little Help :)? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Little Help :)?

Hey.. I Have one question.. I would like to speak to my players sometimes, without entering game and whispering them! And Game.World.SendMsgToAll would be good to make it to work in Console of the server ! So if someone can help me how to make command in console of NewestCoServer(Program.cs) that will write message (BroadCoast) To all players online on server... like the CO Messages "Any Trading of game accounts are illegal and can get your acc banned " ! Thanks
PuN|SheR is offline  
Old 12/13/2010, 11:21   #2
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
World.SendMessageToAll("[SYSTEM]", "Some message", 2011, 0);

Magic
Syst3m_W1z4rd is offline  
Old 12/13/2010, 14:56   #3
 
.Beatz's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
Add this under MobThread_Execute (maybe it's called something different in your source)
Also you will need to change Actions to World.
Code:
static void Handle_Events()
        {
            switch (DateTime.Now.Minute)
            {
                case 5:
                case 13:
                    Actions.SendMsgToAll("GM", "ADD MESSAGE HERE", 2011, 0);
                    break;
                case 20:
                    Actions.SendMsgToAll("GM", "ADD MESSAGE HERE", 2011, 0);
                    break;
                case 32:
                    Actions.SendMsgToAll("GM", "ADD MESSAGE HERE", 2011, 0);
                    break;
                case 44:
                    Actions.SendMsgToAll("GM", "ADD MESSAGE HERE", 2011, 0);
                    break;
                case 56:
                    Actions.SendMsgToAll("GM", "ADD MESSAGE HERE", 2011, 0);
                    break;
                default:
                    break;
            }
        }
Fixed

Ahh I thought this was what he wanted lol
.Beatz is offline  
Old 12/13/2010, 15:03   #4
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Quote:
Originally Posted by .Kinshi View Post
Code:
while (true) {
    String cmd = Console.ReadLine();
    if (cmd.StartsWith("/broadcast"))
        SendMsgToAll("[Broadcast]", cmd.SubString(cmd.FirstIndexOf(" ")));
}
Something like that would work.
.
_Emme_ is offline  
Thanks
2 Users
Old 12/13/2010, 15:52   #5
 
elite*gold: 0
Join Date: Jun 2010
Posts: 50
Received Thanks: 10
Quote:
Originally Posted by EmmeTheCoder View Post
while(true)
{
string[] input = Console.ReadLine().Split(' ');
if (input[0] == "/broadcast")
SendMsgToAll("[Broadcast]",input[1]);
}
Code:
/broadcast Hello World
but would that not just show as in game

Code:
[Broadcast]Hello
Macnoo is offline  
Old 12/13/2010, 17:41   #6
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Code:
while (true) {
    String cmd = Console.ReadLine();
    if (cmd.StartsWith("/broadcast"))
        SendMsgToAll("[Broadcast]", cmd.SubString(cmd.FirstIndexOf(" ")));
}
Something like that would work.
.Kinshi is offline  
Thanks
1 User
Old 12/13/2010, 20:41   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by Macnoo View Post
Code:
/broadcast Hello World
but would that not just show as in game

Code:
[Broadcast]Hello
Depends on how you use the data entered... if you just use string[1] or w/e yes it will only use the first word (assuming splitting by ' ') but if you parse things properly it would work fine.

Personally what I do is if it's NOT a cmd I broadcast it.


IE:

/restart
/blablabla
/etc

all do cmds... but if I do like

Weeee!!

that gets sent to all online players.
pro4never is offline  
Thanks
1 User
Old 12/13/2010, 21:09   #8
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Doesn't work firstindexof for me.. Anyone could help me?
PuN|SheR is offline  
Old 12/13/2010, 22:13   #9
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
In ur console commands.
Try this.

Code:
Removed
Syst3m_W1z4rd is offline  
Old 12/13/2010, 22:25   #10
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Quote:
Originally Posted by Syst3m_W1z4rd View Post
In ur console commands.
Try this.

Code:
Removed
What?
PuN|SheR is offline  
Old 12/13/2010, 23:17   #11
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Fixed, Thought making GUI for Message

Problem :
When i open my GUI, the NEwestCoServer Console Gets Freezed !
PuN|SheR is offline  
Old 12/14/2010, 10:38   #12
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Don't use a while loop in the gui initilize
_Emme_ is offline  
Old 12/14/2010, 10:45   #13
 
elite*gold: 0
Join Date: Feb 2006
Posts: 550
Received Thanks: 81
run that console listener on its own thread
ChingChong23 is offline  
Old 12/14/2010, 18:22   #14
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Quote:
Originally Posted by EmmeTheCoder View Post
Don't use a while loop in the gui initilize
I Didn't use any "While"!
PuN|SheR is offline  
Old 12/14/2010, 19:10   #15
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Quote:
Originally Posted by PuN|SheR View Post
I Didn't use any "While"!
Then what's causing it to freeze?
_Emme_ is offline  
Reply




All times are GMT +2. The time now is 17:39.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.