diff --git a/resources/[soz]/soz-core/src/client/housing/housing.property.zone.provider.ts b/resources/[soz]/soz-core/src/client/housing/housing.property.zone.provider.ts index 2ad97fbe79..3dcd305882 100644 --- a/resources/[soz]/soz-core/src/client/housing/housing.property.zone.provider.ts +++ b/resources/[soz]/soz-core/src/client/housing/housing.property.zone.provider.ts @@ -35,6 +35,7 @@ import { HousingRepository } from '../repository/housing.repository'; import { TargetFactory } from '../target/target.factory'; import { VehicleGarageProvider } from '../vehicle/vehicle.garage.provider'; import { HousingMenuProvider } from './housing.menu.provider'; +import { InputService } from '../nui/input.service'; const BlipSprite = { house: { @@ -73,6 +74,9 @@ export class HousingPropertyZoneProvider { @Inject(BlipFactory) private blipFactory: BlipFactory; + @Inject(InputService) + private inputService: InputService; + private temporaryAccess = new Set(); @Exportable('GetPlayerApartmentAccess') @@ -588,8 +592,13 @@ export class HousingPropertyZoneProvider { return; } + const confirm = await this.inputService.askConfirm( + 'Voulez-vous vraiment expulser votre colocataire ? Entrez OUI pour confirmer.' + ); - await this.housingMenuProvider.removeRoommate({ apartmentId: apartments[0].id, propertyId: property.id }); + if (confirm) { + await this.housingMenuProvider.removeRoommate({ apartmentId: apartments[0].id, propertyId: property.id }); + } } private getUniqueApartment(property: Property): Apartment | null { @@ -618,7 +627,7 @@ export class HousingPropertyZoneProvider { await this.vehicleGarageProvider.openHouseGarageMenu(property.identifier, apartments); } - public leavePropertyAsRoommate(property: Property) { + public async leavePropertyAsRoommate(property: Property) { const player = this.playerService.getPlayer(); if (!player) { @@ -630,7 +639,12 @@ export class HousingPropertyZoneProvider { if (!apartment) { return; } + const confirm = await this.inputService.askConfirm( + 'Voulez-vous vraiment quitter la colocation ? Entrez OUI pour confirmer.' + ); - TriggerServerEvent(ServerEvent.HOUSING_REMOVE_ROOMMATE, property.id, apartment.id); + if (confirm) { + TriggerServerEvent(ServerEvent.HOUSING_REMOVE_ROOMMATE, property.id, apartment.id); + } } }