You are viewing our Forum Archives. To view or take place in current topics click here.
Get Host [MW2 TU8] {Stupid 15 Charactrers Min Length}
Posted:

Get Host [MW2 TU8] {Stupid 15 Charactrers Min Length}Posted:

SnapppiestJaack
  • Junior Member
Status: Offline
Joined: Jul 21, 201212Year Member
Posts: 68
Reputation Power: 2
Status: Offline
Joined: Jul 21, 201212Year Member
Posts: 68
Reputation Power: 2
Been getting a lot a questions along the line of

Why does my menu not work online, I send it to client 0, any ideas?

So im posting this here, not the most impressive thing but, hopefully it will help a few people out and stop me getting spammed.

Credits : Nitram, Craigchirst.

Ohh and FYI, this information was out there, but people couldn't search/add the pieces together for reason.

Just call _GetClients(); then send the HOST menu to HostIndex.
// Get How Many Clients Are In Game & Detect When They Connect & There Gamertag //
typedef DWORD (*playerState_t)(int clientNum);
playerState_t playerState = (playerState_t)0x821E66A8;

char CurrentGamertag[18][0xF] = {""};
int HostIndex = 0;

void _GetClients()
{
   for( int clientID = 0; clientID < 18; clientID++)
   {
      ps = playerState(clientID);
      ps += 0x44;
             strcpy(CurrentGamertag[clientID], (char*)ps);
   }
   _GetHost();
}
// ---------------------------------------------------------------------------- //

// Get Which Client Number Is The Host //
struct XenonUserData
{
   int signInState;
   char name[0x20];
};

XenonUserData * xenonUserData = (XenonUserData *)0x838BA820;

void _GetHost()
{
   for( int clientID = 0; clientID < 18; clientID++)
      if(!strcmp(xenonUserData[0].name,CurrentGamertag[clientID]))
         HostIndex = clientID;
   printf("Host is [Client %i] (%s)\n",HostIndex,xenonUserData[0].name);
}
// ----------------------------------- //


This is hopefully noob proof, and simply enough for people to get it. Most probably a easier way but this was already on my pc, so whatever.

The following 1 user thanked SnapppiestJaack for this useful post:

-Peacee (02-12-2013)
#2. Posted:
Furibunda
  • Challenger
Status: Offline
Joined: Dec 13, 201212Year Member
Posts: 198
Reputation Power: 11
Status: Offline
Joined: Dec 13, 201212Year Member
Posts: 198
Reputation Power: 11
Me gusta, message me on aim later
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.