Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    AddLog () function ?


    PhoenixRaider
     Share

    Recommended Posts

    Hi members of GHB.

    Earlier today , I tried to find an AddLog function that actually works.

    All I want it to do is create a file and like .. if you do AddLog("Test");

    It would create a file .txt and write Test in it.

    I looked on Google , MSDN , but I can't find anything.

     

    - Thanks

     

    P.S. I have tried the one in Tatnium .. but it gives me errors.

    Link to comment
    Share on other sites

    ofstream ofile;	
    ofile.open(GetDirectoryFile("ttnlog.txt"), ios::app);
    add_log("\n---------------------\nTatniumD3D Started...\n---------------------");
    
    void __cdecl add_log (const char *fmt, ...)
    {
    if(ofile != NULL)
    {
    	if(!fmt) { return; }
    
    	va_list va_alist;
    	char logbuf[256] = {0};
    
    	va_start (va_alist, fmt);
    	_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist);
    	va_end (va_alist);
    
    	ofile << logbuf << endl;
    }
    }

     

    Code by tatnium d3dstarterkit

     

    Edit: seen your ps... what errors? and you could use this as a base for your own func you dont need to use ofile...

     

    use the func as a base and write to a file like thi:

     

    if ( (fp = fopen ( GetDirectoryFile( szFile ), "a")) != NULL )
    {
    fprintf ( fp, "%s\n", logbuf );
    fclose (fp);
    }

    Link to comment
    Share on other sites

    ofstream ofile;	
    ofile.open(GetDirectoryFile("ttnlog.txt"), ios::app);
    add_log("\n---------------------\nTatniumD3D Started...\n---------------------");
    
    void __cdecl add_log (const char *fmt, ...)
    {
    if(ofile != NULL)
    {
    	if(!fmt) { return; }
    
    	va_list va_alist;
    	char logbuf[256] = {0};
    
    	va_start (va_alist, fmt);
    	_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist);
    	va_end (va_alist);
    
    	ofile << logbuf << endl;
    }
    }

     

    Code by tatnium d3dstarterkit

     

    Edit: seen your ps... what errors? and you could use this as a base for your own func you dont need to use ofile...

     

    use the func as a base and write to a file like thi:

     

    if ( (fp = fopen ( GetDirectoryFile( szFile ), "a")) != NULL )
    {
    fprintf ( fp, "%s\n", logbuf );
    fclose (fp);
    }

     

    Thnx Neo .

    I'm gonna try .. and if dont work .. I will try to make with CreateFile xD

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...