Code:
using fnChangeTeam = bool ( __thiscall* )( void* /* this */, uint32_t /* teamId */, int32_t /* a3 */);
auto s4 = reinterpret_cast< uint32_t >( GetModuleHandleA( "S4Client.exe" ) );
auto ppgsc = reinterpret_cast< GameServerClient** >( s4 + 0x16BD348 );
auto GSC_ChangeTeam = reinterpret_cast< fnChangeTeam >( s4 + 0xB55C90 );
// -------------------------------------------------------------------
uint32_t teamId; // shouldn't be a stack var in this kinda usage
g_pGUI->RegisterEventHandler( CONTROLS::TextBox, Helpers::GetControlByID("txt_teamid"), &teamId );
// -------------------------------------------------------------------
// internally offsets GSC to GameRuleC2S (+0x6C)
// then calls the third vfunc to send a Room_TeamChange_Req
GSC_ChangeTeam( ppgsc, teamId, 1 );
Code:
"neutral = 0, alpha = 1, beta = 2, auto assign = 3"