[CS 1.6] How to add Auto Offsets

01/08/2010 11:32 Zo0YorK3h#1
No section for CS =[ But, i found a crap load of my old coding on my old hard drive so i decided to share :D.

This is how to add auto offsets to a CS 1.6 Hack source.

Anywhere in client.cpp
PHP Code:
void func_offsetlog()
{
    
string filepath getOgcDirFile(cmd.argC(1));
    
filepath += "OffsetLog.ini";
    
ofstream outfile;
    
outfile.open(filepath.c_str(), ofstream::out ofstream::trunc);

    
outfile<<"SoundByte : 0x" <<soundbyte<<endl;
    
outfile<<"GlobalTime : 0x" <<globaltime<<endl;
    
outfile<<"PlayerMove : 0x" <<ppmove<<endl;
    
outfile<<"EngineFuncs : 0x" <<pEngfuncs<<endl;
    
outfile<<"SlotsPointer : 0x" <<slots<<endl;
    
outfile<<"EngineStudio : 0x" <<pstudio<<endl;
    
outfile<<"StudioInterface : 0x" <<ppinterface<<endl;
    
    
outfile.close();

Then register it.
PHP Code:
cmd.AddCommand("logoffsets" ,func_offsetlog);
//or most src's are set like
REGISTER_COMMAND(logoffsets); 
all done =]

This will make a file in ur hack directory named offsets.iini
01/08/2010 16:16 .SketchBear#2
give credits im sure its not your work ;)
01/08/2010 18:02 Zo0YorK3h#3
It is my work -.-, If you knew c++ it's not very hard to make it write to a file.