|
You last visited: Today at 11:33
Advertisement
My NPC Adder !
Discussion on My NPC Adder ! within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
01/12/2011, 14:49
|
#16
|
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.
_|_
|
|
|
01/12/2011, 15:04
|
#17
|
elite*gold: 0
Join Date: Dec 2010
Posts: 162
Received Thanks: 31
|
Quote:
Originally Posted by Ian*
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
|
|
|
01/12/2011, 16:22
|
#18
|
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
|
Quote:
Originally Posted by Iron~Man
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...
|
|
|
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();
|
|
|
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
|
|
|
01/13/2011, 12:30
|
#21
|
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
|
Quote:
Originally Posted by damnfuck
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 ?
|
|
|
01/13/2011, 12:38
|
#22
|
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
|
Quote:
Originally Posted by Syst3m_W1z4rd
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.. )
|
|
|
01/14/2011, 17:25
|
#23
|
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
|
rofl.
|
|
|
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
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);
|
|
|
01/16/2011, 10:38
|
#25
|
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
|
Yap, I Forgot about that
|
|
|
01/16/2011, 12:20
|
#26
|
elite*gold: 0
Join Date: Dec 2010
Posts: 162
Received Thanks: 31
|
I Doubt you even know about that
|
|
|
01/26/2011, 00:34
|
#27
|
elite*gold: 0
Join Date: Jun 2009
Posts: 239
Received Thanks: 47
|
Quote:
Originally Posted by Iron~Man
I Doubt you even know about that
|
And You're OUT !
|
|
|
07/20/2011, 22:46
|
#28
|
elite*gold: 0
Join Date: Jun 2011
Posts: 10
Received Thanks: 0
|
Quote:
Originally Posted by PuN|SheR
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:/?
|
|
|
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.
|
|