mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-22 16:52:30 +08:00
Added a delete button to Persist Vehicle. (#2354)
This commit is contained in:
@ -49,6 +49,16 @@ namespace big
|
||||
return spawn_vehicle_full(vehicle_json, self::ped, spawn_coords);
|
||||
}
|
||||
|
||||
void persist_car_service::delete_vehicle(std::string_view file_name, std::string folder_name)
|
||||
{
|
||||
const auto file = check_vehicle_folder(folder_name).get_file(file_name);
|
||||
|
||||
if (file.exists())
|
||||
{
|
||||
std::filesystem::remove(file.get_path());
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> persist_car_service::list_files(std::string folder_name)
|
||||
{
|
||||
std::vector<std::string> file_paths;
|
||||
|
@ -13,6 +13,7 @@ namespace big
|
||||
static Vehicle clone_ped_car(Ped ped, Vehicle vehicle);
|
||||
static void save_vehicle(Vehicle vehicle, std::string_view file_name, std::string folder_name);
|
||||
static Vehicle load_vehicle(std::string_view file_name, std::string folder_name = "", const std::optional<Vector3>& = std::nullopt);
|
||||
static void delete_vehicle(std::string_view file_name, std::string folder_name);
|
||||
|
||||
private:
|
||||
static constexpr auto model_attachment_key = "model_attachment";
|
||||
|
Reference in New Issue
Block a user