void ThreadEmulPressAlt ( ) { static BitStream bsOnfootSync ; static stOnFootData ofSync ; while ( state ) { if ( ! IsDriving ( SF -> getSAMP ( ) -> getPlayers ( ) -> sLocalPlayerID ) ) { std :: this_thread :: sleep_for ( std :: chrono :: milliseconds ( curTimeOut ) ) ; memset ( & ofSync , 0 , sizeof ( stOnFootData ) ) ; ofSync = SF -> getSAMP ( ) -> getPlayers ( ) -> pLocalPlayer -> onFootData ; ofSync . stSampKeys . keys_unknown__walkSlow = 1 ; bsOnfootSync . ResetWritePointer ( ) ; bsOnfootSync . Write ( ( BYTE ) ID_PLAYER_SYNC ) ; bsOnfootSync . Write ( ( PCHAR ) & ofSync , sizeof ( stOnFootData ) ) ; SF -> getRakNet ( ) -> SendPacket ( & bsOnfootSync ) ; ofSync . stSampKeys . keys_unknown__walkSlow = 0 ; bsOnfootSync . ResetWritePointer ( ) ; bsOnfootSync . Write ( ( BYTE ) ID_PLAYER_SYNC ) ; bsOnfootSync . Write ( ( PCHAR ) & ofSync , sizeof ( stOnFootData ) ) ; SF -> getRakNet ( ) -> SendPacket ( & bsOnfootSync ) ; g_mutex . lock ( ) ; paramsCurSession . speeds . speedSend ++ ; g_mutex . unlock ( ) ; } } }
thd = new std :: thread ( ThreadEmulPressAlt ) ;