fix(persist_car): fix spawning (#1122)

This commit is contained in:
Johann 2023-03-19 19:55:49 +01:00 committed by GitHub
parent ddaee3f069
commit d12c7fe69c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,28 +68,18 @@ namespace big
ImGui::SameLine(); ImGui::SameLine();
components::button("SAVE_VEHICLE"_T, [] components::button("SAVE_VEHICLE"_T, [] {
{ if (!self::veh)
if (PED::GET_VEHICLE_PED_IS_IN(self::ped, false) == 0) return g_notification_service->push_warning("PERSIST_CAR"_T.data(), "You must be in a vehicle. Please enter a vehicle before using load.");
{
g_notification_service->push_warning("PERSIST_CAR"_T.data(), "You must be in a vehicle. Please enter a vehicle before using load."); save_vehicle(vehicle_file_name_input);
}
else
{
save_vehicle(vehicle_file_name_input);
}
}); });
components::button("LOAD_VEHICLE"_T, [] components::button("LOAD_VEHICLE"_T, [] {
{ if (self::veh)
if (PED::GET_VEHICLE_PED_IS_IN(self::ped, false) != 0) return g_notification_service->push_warning("PERSIST_CAR"_T.data(), "You must not be in a vehicle. Please exit your vehicle before using load.");
{
g_notification_service->push_warning("PERSIST_CAR"_T.data(), "You must not be in a vehicle. Please exit your vehicle before using load."); load_vehicle(selected_vehicle_file);
}
else
{
load_vehicle(selected_vehicle_file);
}
}); });
ImGui::EndGroup(); ImGui::EndGroup();