Server Help

Bot Questions - Bot Questions

Stud^ - Fri Nov 28, 2003 5:20 am
Post subject: Bot Questions
Hi i have 2 quick questions

1. How Would I Make Merv Write Something to a text file
2. How could i make merv read something from a text file
thxs in advance icon_wink.gif
ExplodyThingy - Fri Nov 28, 2003 9:54 am
Post subject:
writing
Code: Show/Hide

#include <fstream.h>
ofstream logfile("writing.txt",ios::app);
if(logfile)
{
   logfile << "hello " << me->name<<"\n";
}
logfile.close();

reading
Code: Show/Hide

#include <fstream.h>
ifstream cfgfile;
char line[256];
cfgfile.open("reading.txt");
while(cfgfile.getline(line,255))
{
   //Do your thang here.  Each line is progessively recorded into char line[256]
}
cfgfile.close();

50% Packetloss - Sun Nov 30, 2003 9:47 pm
Post subject:
readprivateprofilestring
writeprivateprofilestring

these are a little more complex but may help out better. Look them up on msdn .
Dustpuppy - Mon Dec 01, 2003 8:01 pm
Post subject:
Less complex but they write to .inis
Dustpuppy - Mon Dec 01, 2003 8:01 pm
Post subject:
Less complex but they write to .inis
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group