CA - Game Counter

Posts 1–9 of 9 · Page 1 of 1
CA - Game Counter
Crash released his game status code and i thought of an idea to make a game counter out of it.

But i am in trouble. This code will add 1 as long as I am in game. So it will add 1 continually until I leave game. How can you make the code only add 1 once?

Code:
int game = 0
if( *(int*)0x377F551C == 1){
game++
}
This really shouldn't be that hard. Tho I shall try to explain. What if you also checked when he was outside the game aswell?
Quote Originally Posted by IcySeal View Post
This really shouldn't be that hard. Tho I shall try to explain. What if you also checked when he was outside the game aswell?
What do you mean by "outside the game"?
If you used a bool, that would be started as true. then inside your current if statement, you would check if the bool is true.in the resulting code, where you add 1 to game, set the value to false. then have an else and inside the else set the bool to true.
There are probably better ways of doing this.
IsConnectedServer()

Code:
bool isOut = true;
int times = 0;
if(*(int*)0x377F551C == 5 && isOut == false){

    isOut = true;
    times++;

}
if(*(int*)0x377F551C == 1 && isOut == true){

    isOut = false;

}
Lobby is 5, loading 3, in game 1.
I wrote a function for you:

Code:
typedef bool (*IsConnected_t)(void);

bool isIngame()
{
	//This is for CA EU, replace with your LTClient address
	DWORD* dwLTBase = (DWORD*)0x377C4450;
	IsConnected_t pConnected = *(IsConnected_t*)(*dwLTBase + 0x8C);

	return pConnected();
}
Sharing is caring.
Quote Originally Posted by Synns View Post
Sharing is caring.
Cool beans.
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us