void toggleEnableChat( bool enable ) {
DWORD oldVP;
DWORD base = reinterpret_cast<DWORD>( GetModuleHandleA( "samp" ) );
if ( enable ) {
// off - set retn
VirtualProtect( reinterpret_cast<void *>( base + 0x657E0 ), sizeof( uint8_t ), PAGE_EXECUTE_READWRITE, &oldVP );
*reinterpret_cast<uint8_t *>( base + 0x657E0 ) = 0xC3;
VirtualProtect( reinterpret_cast<void *>( base + 0x657E0 ), sizeof( uint8_t ), oldVP, &oldVP );
} else {
// on - set sub
VirtualProtect( reinterpret_cast<void *>( base + 0x657E0 ), sizeof( uint8_t ), PAGE_EXECUTE_READWRITE, &oldVP );
*reinterpret_cast<uint8_t *>( base + 0x657E0 ) = 0x83;
VirtualProtect( reinterpret_cast<void *>( base + 0x657E0 ), sizeof( uint8_t ), oldVP, &oldVP );
}
}