TUT Oneline Games Codes

Posts 1–13 of 13 · Page 1 of 1
TUT Oneline Games Codes
You want to make a Date-Funktion in your d3d hack?
Us this code:
Code:
char* DATE(void)
{
static char cdate[20] = "";
struct tm * current_tm;
time_t current_time;
time (&current_time);
current_tm = localtime (&current_time);
sprintf( cdate, "%d-%02d-%d",current_tm->tm_mon+1,current_tm->tm_mday,current_tm->tm_year-100+2000);
return cdate;
}
Credits [G]a[M]e[R]

==================================================
Panickey Function

You want to make a Panickey Function in your d3d hack?
Us this code:

Code:
if(panic)
{
        if( GetAsyncKeyState( VK_CONTROL))
{
                if( GetAsyncKeyState( VK_SPACE))
{
                        ExitGame(0);
}
}
}


Credits [G]a[M]e[R]
==================================================
FPS

Code:
/* #include */
#include <time.h>
float fLastTickCount=0.0f;
float fCurrentTickCount;
char CH_FPS [20];

/* MENU[MENUMAXITEMS]; */
int CH_NoFPS=0;

/* void RebuildMenu(void) */
MenuAddItem("Framerate:",(char **)CH_FPS,0,0,MENUTEXT);

/* HRESULT WINAPI myPresent */
if(CH_FPS)
{
         fCurrentTickCount=clock() * 0.001f;
         CH_NoFPS++;
if((fCurrentTickCount - fLastTickCount)>1.0f)
{
         fLastTickCount=fCurrentTickCount;
         sprintf(CH_FPS, "%d", CH_NoFPS);
         CH_NoFPS=0;
}
}
None of these are really creds to you..Just saying
problem
Quote Originally Posted by [G]a[M]e[R] View Post
Really by ME 100%
why after i build , i have this eroor problem

error C2365: 'DATE' : redefinition; previous definition was 'typedef'
1> c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(1019) : see declaration of 'DATE'


thanx ,before , for the Source code . .
Should be posted in the snippets thread.
How in the world would this be useful to someone ?, By the way GAKS is Fugly, And this thread made me cry.

Seriously, Fugly code is Fugly D:, And anybody with common knowledge would implement these ideas more cutely than that..
Quote Originally Posted by Melodia View Post
this thread made me cry.
OP needs to die then (=
Quote Originally Posted by Hell_Demon View Post
OP needs to die then (=
Obviously.

BTW does anyone get this line?
Code:
struct tm * current_tm;
Is he declaring an empty structure and creating a pointer to it on the same line? I've never seen a declaration like that.
in C you have to declare using Struct before.

Struct <StructName> <varname>

Code:
struct Xpto {
      int test;
}
C++:

Xpto *lalal;

C:

Struct Xpto *lala; //Otherwise: Error
Oh thanks Brinuz. Learn something new everyday.
Won't work for crossfire Damn Xtrap
I love how people always think that if you just copy and paste some random code, it will work. It always makes me laugh.
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us