Возможно ли перевести данный код в CLEO:
Код:
void cheat_handle_bike_crasher()
{
traceLastFunc( "cheat_handle_bike_crasher()" );
if(cheat_state->_generic.bikecrasher == 0)
return;
if(cheat_state->state != CHEAT_STATE_VEHICLE)
return;
if(g_SAMP == NULL || g_SAMP->iGameState != GAMESTATE_CONNECTED)
return;
if(g_Players == NULL && g_Vehicles == NULL)
return;
struct actor_info *pSelfActor = actor_info_get( ACTOR_SELF, 0 );
struct vehicle_info *pSelfVehicle = vehicle_info_get( VEHICLE_SELF, NULL );
float *coord = ( cheat_state->state == CHEAT_STATE_VEHICLE ) ? cheat_state->vehicle.coords : cheat_state->actor.coords;
static bool bBikeCrasherState = 0;
static bool bTrainSpeedState = 0;
static DWORD dwBikeCrasherTimerTick = GetTickCount();
uint16_t sCurrentVehicleID = g_Players->pLocalPlayer->sCurrentVehicleID;
BYTE byteCurrentWeapon;
if ( cheat_state->state == CHEAT_STATE_VEHICLE )
byteCurrentWeapon = g_Players->pLocalPlayer->inCarData.byteCurrentWeapon;
else if ( cheat_state->state == CHEAT_STATE_ACTOR )
byteCurrentWeapon = g_Players->pLocalPlayer->onFootData.byteCurrentWeapon;
else byteCurrentWeapon = 0;
if(dwBikeCrasherTimerTick < GetTickCount() - 50)
{
if(!bBikeCrasherState)
{
stInCarData vehSync;
RakNet::BitStream bsVehicleSync;
memset(&vehSync, 0, sizeof(stInCarData));
vehSync.sVehicleID = sCurrentVehicleID;
vehSync.bytePlayerHealth = pSelfActor->hitpoints;
vehSync.byteArmor = pSelfActor->armor;
vehSync.byteCurrentWeapon = byteCurrentWeapon;
vehSync.fPosition[0] = coord[0];
vehSync.fPosition[1] = coord[1];
vehSync.fPosition[2] = coord[2];
vehSync.fVehicleHealth = pSelfVehicle->hitpoints;
if(!bTrainSpeedState)
vehSync.fTrainSpeed = (float)0xFFFFFFFFFFFFFFFF;
bTrainSpeedState ^= 1;
g_iRakClient->SendInCarFullSyncData(&vehSync);
}
else
{
float fPos[3], fSpeed[3];
fPos[0] = coord[0];
fPos[1] = coord[1];
fPos[2] = coord[2] + 1.5f;
g_iRakClient->SendFakeOnfootSyncData(fPos, pSelfActor->hitpoints, pSelfActor->armor, byteCurrentWeapon, fSpeed);
}
bBikeCrasherState ^= 1;
dwBikeCrasherTimerTick = GetTickCount();
}
}