Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 00:17

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

Advertisement



[Question]Ban for 5165

Discussion on [Question]Ban for 5165 within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old 02/20/2010, 02:42   #16
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
okay btw i get 85 errors i did everything.

"The name 'Database' does not exist in the current context"
and
"Expected class, delegate. enum, interface, or struct"

and some more



copz1337 is offline  
Old 02/20/2010, 02:48   #17
 
elite*gold: 20
Join Date: Oct 2009
Posts: 1,009
Received Thanks: 621
Quote:
Originally Posted by copz1337 View Post
okay btw i get 85 errors i did everything.

"The name 'Database' does not exist in the current context"
and
"Expected class, delegate. enum, interface, or struct"

and some more
You put it in the wrong place.
You suppose to put the first two methods inside the class. You probably put elsewhere.


spare2 is offline  
Old 02/20/2010, 02:58   #18
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Quote:
Originally Posted by spare2 View Post
You put it in the wrong place.
You suppose to put the first two methods inside the class. You probably put elsewhere.
yea but i changed it and still..
copz1337 is offline  
Old 02/20/2010, 02:59   #19
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,276
Quote:
Originally Posted by copz1337 View Post
yea but i changed it and still..
Where did you put it.
Screenshot please?


Arcо is offline  
Old 02/20/2010, 03:02   #20
 
elite*gold: 20
Join Date: Oct 2009
Posts: 1,009
Received Thanks: 621
Quote:
Originally Posted by copz1337 View Post
yea but i changed it and still..
Okay...
Try finding CreateCharacter method and place CheckBan and AddBan right after it. ...
spare2 is offline  
Old 03/15/2010, 23:01   #21
 
elite*gold: 0
Join Date: May 2006
Posts: 297
Received Thanks: 58
Quote:
Originally Posted by spare2 View Post
Okay, make sure you following the directions below step by step and carefully.
First go to Database.cs and put the following code inside the Database class.
Code:
        public static bool CheckBan(string Name)
        {
            if (File.Exists(@"C:\OldCODB\banname.txt"))
            {
                TextReader tr = new StreamReader(@"C:\OldCODB\banname.txt");//You can change to where ever your OldCODB is
                string name;
                while ((name = tr.ReadLine()) != null)
                {
                    if (name == Name)
                    {
                        return true;
                    }
                }
                tr.Close();
            }
            return false;
        }
        public static void AddBan(string Name)
        {
            if (!CheckBan(Name))
            {
                TextWriter tw = new StreamWriter(@"C:\OldCODB\banname.txt");//You can change to where ever your OldCODB is
                tw.WriteLine(Name);
                tw.Close();
            }

        }
Then find the following line in your project:
Code:
GC.Soc = StO.Sock;
And put this code under it:
Code:
                                if (GC.AuthInfo.LogonType == 3)
                                {
                                    GC.AddSend(Packets.SystemMessage(GC.MessageID, "You are banned!"));
                                }
Then find
Code:
public bool Ghost = false;
Put this below it
Code:
public string AccountName;
Next, find
Code:
if (Game.World.H_Chars.Contains(GC.MyChar.EntityID))
And place this above it
Code:
GC.MyChar.AccountName = Acc;
Then find the following line (make sure you don't use the one that's commented)
Code:
Info.LogonType = 1;
Place this under
Code:
                        if (CheckBan(RealAccount))
                            Info.LogonType = 3;
Finally place this command in the chat commands
Code:
                        if (Cmd[0] == "/ban")
                        {
                            Game.Character C = Game.World.CharacterFromName(Cmd[1]);
                            if (C != null)
                                Database.AddBan(C.AccountName);
                                C.MyClient.Disconnect();
                        }
I have tested it personally.
Where do i make the defenition of CheckBan?
pintser is offline  
Old 03/16/2010, 20:03   #22
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
It's much easier doing this with a MySQL source, since the banned info is right there in the database
walmartboi is offline  
Old 10/03/2010, 11:53   #23
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
it worked for my thx very much guys
sohaib is offline  
Old 10/03/2010, 20:18   #24
 
elite*gold: 0
Join Date: Sep 2010
Posts: 90
Received Thanks: 26
I cannot find:

if (Game.World.H_Chars.Contains(GC.MyChar.EntityID))
peterpiper99 is offline  
Old 10/03/2010, 20:19   #25
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,276
People don't bump old threads.


Arcо is offline  
Reply



« pkcity world msg | Setting Vip on Char Creation »

Similar Threads
Question about a code (5165)
08/23/2010 - CO2 Private Server - 3 Replies
SERVER 5165 LOTF Well, what this npc is suppose to do in order is: Check if you have 50k cps or more, check if you are level 130 or more, check if you are level 137 or less (so check if your between level 130-137 and also checks if you have 50k or more cps). If true, the npc takes away 50k cps from your inventory, and adds a level and broadcasts that you bought a lvl. Otherwise, it gives an error message. But I'm getting 2 errors on the line where "else" is which are "Invalid Expression...
[5165]Question...
06/16/2010 - CO2 Private Server - 3 Replies
Can i add in 5165 to make allies , enemies and to change the buletin? can i add that or it`s imposible :D ?
[Question] how to changes npc name (5165)
05/17/2010 - CO2 Private Server - 3 Replies
hi guys , who can tell on how to changes the npc name?
One question about 5165
05/03/2010 - CO2 Private Server - 4 Replies
Today I was playing with my archer on my 5165 private server and he is the GM i was looking through the gm commands and i seen counter kill so I typed it in and there it was in my skill list i made counter kill active attacked a guard and the attack was countered. So the skill works and is already in the source without me adding it. But I can't find where to get it on my normal ninja char in game. Where do you find counter kill? or how can I give it to a existing npc so when you talk to him he...
[QUESTION]About NPC and IDs (5165)
12/02/2009 - CO2 Private Server - 9 Replies
Can someone give me IDs for ninja gear for the 5165 source? And also can someone tell me what number represents the + on the item below: Thanks.



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


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

BTC: 33E6kMtxYa7dApCFzrS3Jb7U3NrVvo8nsK
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

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