Register for your free account! | Forgot your password?

You last visited: Today at 11:33

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

Advertisement



My NPC Adder !

Discussion on My NPC Adder ! within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old 01/12/2011, 14:49   #16
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
private void button1_Click(object sender, EventArgs e)
{
string text = this.textBox3.Text;
string str2 = this.textBox1.Text;
string str3 = this.textBox5.Text;
string str4 = this.textBox2.Text;
string str5 = this.textBox4.Text;
new FileStream(@"C:\\OldCODB\NPCs.txt", FileMode.Append, FileAccess.Write).Close();
StreamReader reader = new StreamReader(@"C:\\OldCoDB\NPCs.txt");
string str6 = reader.ReadToEnd();
reader.Close();
StreamWriter writer = new StreamWriter(@"C:\\OldCODB\NPCs.txt");
writer.Write(str6);
writer.WriteLine(text + " " + str3 + " 2 66 " + str2 + " " + str4 + " " + str5);
writer.Close();
}

theres his code.

make ur own.

_|_
Ian* is offline  
Old 01/12/2011, 15:04   #17
 
Iron~Man's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 162
Received Thanks: 31
Quote:
Originally Posted by Ian* View Post
private void button1_Click(object sender, EventArgs e)
{
string text = this.textBox3.Text;
string str2 = this.textBox1.Text;
string str3 = this.textBox5.Text;
string str4 = this.textBox2.Text;
string str5 = this.textBox4.Text;
new FileStream(@"C:\\OldCODB\NPCs.txt", FileMode.Append, FileAccess.Write).Close();
StreamReader reader = new StreamReader(@"C:\\OldCoDB\NPCs.txt");
string str6 = reader.ReadToEnd();
reader.Close();
StreamWriter writer = new StreamWriter(@"C:\\OldCODB\NPCs.txt");
writer.Write(str6);
writer.WriteLine(text + " " + str3 + " 2 66 " + str2 + " " + str4 + " " + str5);
writer.Close();
}

theres his code.

make ur own.

_|_
At least he could make the path to be chosen by the users
Iron~Man is offline  
Old 01/12/2011, 16:22   #18
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Quote:
Originally Posted by Iron~Man View Post
At least he could make the path to be chosen by the users
LOL , there's no need for path, OldCODB must be in C:/ so it can work...
PuN|SheR is offline  
Old 01/12/2011, 16:29   #19
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
one thing.
U dont need this:
Code:
StreamReader reader = new StreamReader(@"C:\\OldCoDB\NPCs.txt");
string str6 = reader.ReadToEnd();
reader.Close();
Syst3m_W1z4rd is offline  
Old 01/12/2011, 20:52   #20
 
elite*gold: 0
Join Date: Mar 2008
Posts: 5
Received Thanks: 0
can some one tell me what i have to delete from the NPCDialog.cs to delete a createt npc again cuz my server doesnt work anymore when i added a new npc
damnfuck is offline  
Old 01/13/2011, 12:30   #21
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Quote:
Originally Posted by damnfuck View Post
can some one tell me what i have to delete from the NPCDialog.cs to delete a createt npc again cuz my server doesnt work anymore when i added a new npc
How about using this ?
PuN|SheR is offline  
Old 01/13/2011, 12:38   #22
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Quote:
Originally Posted by Syst3m_W1z4rd View Post
one thing.
U dont need this:
Code:
StreamReader reader = new StreamReader(@"C:\\OldCoDB\NPCs.txt");
string str6 = reader.ReadToEnd();
reader.Close();
I Did that,cause when i use streamwriter , it deletes all npc's in there,and writes only what i wrote, so i did streamreader reader ..
string allnpcsbefore =reader.ReadToEnd(); and then
writer.WriteLine(allnpcsbefore)
writer.Writeline(textbox.text etc.. )
PuN|SheR is offline  
Old 01/14/2011, 17:25   #23
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
rofl.
_DreadNought_ is offline  
Old 01/14/2011, 18:32   #24
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Quote:
Originally Posted by PuN|SheR View Post
I Did that,cause when i use streamwriter , it deletes all npc's in there,and writes only what i wrote, so i did streamreader reader ..
string allnpcsbefore =reader.ReadToEnd(); and then
writer.WriteLine(allnpcsbefore)
writer.Writeline(textbox.text etc.. )
You could just do:
Code:
StreamWriter SW = new StreamWriter(@"C:\OldCODB\npc.txt", FileMode.Append);
Syst3m_W1z4rd is offline  
Old 01/16/2011, 10:38   #25
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Yap, I Forgot about that
PuN|SheR is offline  
Old 01/16/2011, 12:20   #26
 
Iron~Man's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 162
Received Thanks: 31
I Doubt you even know about that
Iron~Man is offline  
Old 01/26/2011, 00:34   #27
 
PuN|SheR's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
Quote:
Originally Posted by Iron~Man View Post
I Doubt you even know about that
And You're OUT !
PuN|SheR is offline  
Old 07/20/2011, 22:46   #28
 
elite*gold: 0
Join Date: Jun 2011
Posts: 10
Received Thanks: 0
Quote:
Originally Posted by PuN|SheR View Post
LOL , there's no need for path, OldCODB must be in C:/ so it can work...
No. I have my OldCODB in my source directory, in "My documents". Lols. I don't know why everyone believes that you have to have OldCODB in c:/?
Tjix is offline  
Reply

Tags
add, auto npc, npc


Similar Threads Similar Threads
6/7 adder/changer bugged.
02/23/2013 - Metin2 Private Server - 6 Replies
Whenever I try to use a 6 and 7 bonus adder to my items, it wont apply.. Looks like this: http://i28.tinypic.com/2gtw9op.jpg I'm assuming it has to do with the DB settings so this is what I have for it:



All times are GMT +2. The time now is 11:33.


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.