void cheat_stealcar() { if (cheat_state->_generic.stealcar) { static int time = 0; if (GetTickCount() - time > 500) { struct vehicle_info *info = getGTAVehicleFromSAMPVehicleID(set.stcar); if (g_Vehicles->pSAMP_Vehicle[set.stcar]->iIsLocked) { float cPos[3] = { 0.0f, 0.0f, 0.0f }; vect3_copy(&info->base.matrix[12], cPos); cPos[2] -= 1.8f; GTAfunc_LockActor(1); if (cheat_state->state == CHEAT_STATE_VEHICLE) GTAfunc_RemoveActorFromCarAndPutAt(cPos); else cheat_teleport(cPos, gta_interior_id_get()); } else { g_RakClient->SendEnterPlayerVehicle(set.stcar, 0); GTAfunc_PutActorInCar(info); info->m_nVehicleFlags.bEngineOn = 1; cheat_state->_generic.stealcar = 0; GTAfunc_TogglePlayerControllable(0); GTAfunc_LockActor(0); pGameInterface->GetCamera()->RestoreWithJumpCut(); } time = GetTickCount(); } } }
void cheat_takecarbyid() { if (cheat_state->_generic.getauto) { for (int i = 0; i < SAMP_MAX_VEHICLES; i++) { if (g_Vehicles->iIsListed[i] == NULL) continue; if (g_Vehicles->pSAMP_Vehicle[i] == NULL) continue; if (g_Vehicles->pSAMP_Vehicle[i]->pGTA_Vehicle == NULL) continue; int car_id = (int)(((DWORD)g_Vehicles->pGTA_Vehicle[i]) - (DWORD)pool_vehicle->start) / 2584; struct vehicle_info *vinfo = vehicle_info_get(car_id, 0); int iSAMPVehicleID = getSAMPVehicleIDFromGTAVehicle(vinfo); if (iSAMPVehicleID == g_Players->pLocalPlayer->sCurrentVehicleID) continue; if (!g_Vehicles->pSAMP_Vehicle[i]->iIsLocked) { if (g_Vehicles->pGTA_Vehicle[i]->base.model_alt_id == set.find_id) { g_RakClient->SendEnterPlayerVehicle(i, 0); GTAfunc_PutActorInCar(vinfo); cheat_state->_generic.getauto = 0; break; } } } } }
// sa-mp only void cheat_handle_antiHijack ( actor_info *ainfo, vehicle_info *veh, float time_diff ) { return; if ( g_SAMP == NULL ) // return; traceLastFunc( "cheat_handle_antiHijack()" ); if ( set.anti_carjacking && veh == NULL ) { if ( cheat_state->_generic.got_vehicle_id ) cheat_state->_generic.got_vehicle_id = false; if ( cheat_state->_generic.anti_carjackTick && cheat_state->_generic.anti_carjackTick < (GetTickCount() - 500) && cheat_state->_generic.car_jacked ) { if ( cheat_state->_generic.car_jacked_last_vehicle_id == 0 ) { showGameText( "~r~Unable To Unjack~w~!", 1000, 5 ); cheat_state->_generic.anti_carjackTick = 0; cheat_state->_generic.car_jacked = false; return; } cheat_state->_generic.anti_carjackTick = 0; cheat_state->_generic.car_jacked = false; cheat_state->_generic.unrelatedToAnything = 1337; GTAfunc_PutActorInCar(GetVehicleByGtaId(cheat_state->_generic.car_jacked_last_vehicle_id)); cheat_state->_generic.unrelatedToAnything = 0x1337; struct vehicle_info *veh = GetVehicleByGtaId( cheat_state->_generic.car_jacked_last_vehicle_id ); //if ( veh != NULL ) // vect3_copy( cheat_state->_generic.car_jacked_lastPos, &veh->base.matrix[4 * 3] ); showGameText( "~r~Car Unjacked~w~!", 1000, 5 ); return; } } else if ( set.anti_carjacking ) { if ( veh->passengers[0] == actor_info_get(ACTOR_SELF, 0) ) { if ( !cheat_state->_generic.got_vehicle_id ) { cheat_state->_generic.car_jacked_last_vehicle_id = getPlayerVehicleGTAScriptingID( ACTOR_SELF ); if ( cheat_state->_generic.car_jacked_last_vehicle_id > 0 ) cheat_state->_generic.got_vehicle_id = true; } } } }