Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Fabolous's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    192.168.1.01
    Posts
    2,706
    Reputation
    261
    Thanks
    682
    My Mood
    Paranoid

    [RELEASE] Time & Date Function

    Hi All! I am new to MPGH. I'll throw u guys some functions

    Includes:
    [php]#include <time.h>[/php]

    Time:
    [php]/*****************The Time*******************/
    char *TheTime()
    {
    char *logbuf = new char[ 256 ];
    struct tm *newtime;
    char am_pm[] = "AM";
    time_t long_time;
    time( &long_time );
    newtime = localtime( &long_time );
    if( newtime->tm_hour > 12 )
    strcpy( am_pm, "PM" );
    if( newtime->tm_hour > 12 )
    newtime->tm_hour -= 12;
    if( newtime->tm_hour == 0 )
    newtime->tm_hour = 12;
    sprintf( logbuf, "[ %02d:%02d:%02d %s ]", newtime->tm_hour, newtime->tm_min, newtime->tm_sec, am_pm );
    return logbuf;
    }
    /*****************The Time*******************/[/php]

    Date:
    [php]/*****************The Date*******************/
    char *TheDate()
    {
    time_t curtime = time(0);
    tm now=*localtime(&curtime);
    char dest[BUFSIZ]={0};
    const char format[]="[ %d:%b:%Y ]";
    if (strftime(dest, sizeof(dest)-1, format, &now)>0)
    return dest;
    }

    /*****************The Date*******************/[/php]


    If you have any C++ Common sense, you'd know how to draw it I am not out to post "Copy and Paste" code. Figure it out yourself


    IF YOU ARE GOING TO USE IN YOUR HACK, REMEMBER TO GIVE ME CREDITS

    Remember to Thank Me!
    Last edited by Fabolous; 07-12-2010 at 07:15 AM.

  2. The Following 10 Users Say Thank You to Fabolous For This Useful Post:

    Crash (07-13-2010),HaX4LiFe! (07-12-2010),Houston (07-12-2010),MissRandomSpam (07-12-2010),Mordecai (07-12-2010),MugNuf (07-12-2010),Solify (07-12-2010),whatup777 (07-12-2010),zmansquared (07-12-2010),Zoom (07-12-2010)

  3. #2
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,088
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    It works. i just added it and compiled and got it to work.

    thanks bro
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  4. #3
    Mordecai's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    My Mood
    Cheerful
    Nice Release
    This Works.
    Last edited by Mordecai; 07-12-2010 at 07:05 AM.

  5. #4
    Fabolous's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    192.168.1.01
    Posts
    2,706
    Reputation
    261
    Thanks
    682
    My Mood
    Paranoid
    Thank you Guys!

  6. #5
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,030
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Nice Job Unknown and welcome.
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  7. #6
    Fabolous's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    192.168.1.01
    Posts
    2,706
    Reputation
    261
    Thanks
    682
    My Mood
    Paranoid
    Don't say it, press it!

  8. #7
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,088
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    i pressed it!!!!!!
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  9. #8
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    This also works :
    Code:
    SYSTEMTIME st;
    
    GetSystemTime(&st);
    
    st.w(insert time measurement here)
    For example :

    Code:
    char timebuffer[512];
    
    sprintf_s(timebuffer, 512, "[ %d / %d / %d ] - [ %d : %d : %d ]", (int)st.wMonth, (int)st.wDay, (int)st.wYear, (int)st.wHour - 4, (int)st.wMinute, (int)st.wSecond);
    
    DrawString(10, 10, timebuffer, D3DCOLOR_XRGB(255, 0, 0));
    Right now it would output this :
    [ 07 / 12 / 2010 ] - [ 3 : 22 : 18 ]

    At least where I live.

  10. #9
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,088
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    they both work. seals is a alittle easier for a noob to understand
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  11. #10
    Fabolous's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    192.168.1.01
    Posts
    2,706
    Reputation
    261
    Thanks
    682
    My Mood
    Paranoid
    It works either way, thats just my method.

  12. #11
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,030
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Quote Originally Posted by Sealionone View Post
    This also works :
    Code:
    SYSTEMTIME st;
    
    GetSystemTime(&st);
    
    st.w(insert time measurement here)
    For example :

    Code:
    char timebuffer[512];
    
    sprintf_s(timebuffer, 512, "[ %d / %d / %d ] - [ %d : %d : %d ]", (int)st.wMonth, (int)st.wDay, (int)st.wYear, (int)st.wHour - 4, (int)st.wMinute, (int)st.wSecond);
    
    DrawString(10, 10, timebuffer, D3DCOLOR_XRGB(255, 0, 0));
    Right now it would output this :
    [ 07 / 12 / 2010 ] - [ 3 : 22 : 18 ]

    At least where I live.
    Shouldn't you use GetLocalTime instead?
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  13. #12
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    Quote Originally Posted by UnknownCoder View Post
    It works either way, thats just my method.
    If you wouldn't mind putting it up there with yours that would be nice.

    @whatup777 : If they don't set their computer's clock to the right time they're retarded.

  14. #13
    ~Shadow's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    STL
    Posts
    3,063
    Reputation
    33
    Thanks
    410
    My Mood
    Happy
    can you put one for C# and VB? i am going to try something with this later

  15. #14
    Mordecai's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    My Mood
    Cheerful
    Lol. You can do that yourself. Copy the code. Like you were going to anyways. Except instead of copying and pasting into C++. Go to google, and find a C++/C# Code Converter, and place it in there to convert it into a C# Code.

  16. #15
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,088
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    those converters are so expensive though
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

Page 1 of 2 12 LastLast

Similar Threads

  1. [Help]Time and Date
    By ◘◘◘◘◘◘ in forum Combat Arms Coding Help & Discussion
    Replies: 5
    Last Post: 10-17-2010, 07:50 PM
  2. Time and Date Function
    By God601 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 29
    Last Post: 10-02-2010, 02:39 PM
  3. [C++ SOURCE]Simple D3D Show Time and Date
    By mastermods in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 12
    Last Post: 08-11-2010, 09:50 AM
  4. [Info] Dave's Release Day or Date?
    By slayerboyxx in forum CrossFire Hacks & Cheats
    Replies: 22
    Last Post: 01-10-2010, 02:05 AM
  5. Release Time
    By Dave84311 in forum WarRock - International Hacks
    Replies: 22
    Last Post: 06-01-2007, 03:41 AM