Skip to content

Commit

Permalink
[Répondeur entreprise] Ajout du nom de l'endroit dans lequel la sonet…
Browse files Browse the repository at this point in the history
…te a été actionné pour les entreprises avec plusieurs sonnettes.
  • Loading branch information
DreamXZE committed Jan 8, 2024
1 parent 92b5633 commit 82e76f1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions resources/[soz]/soz-core/src/client/job/job.bell.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TargetFactory } from '../target/target.factory';
type BellProps = {
job: JobType;
number: string;
location?: string;
};

const BELL_ZONES: Zone<BellProps>[] = [
Expand Down Expand Up @@ -155,6 +156,7 @@ const BELL_ZONES: Zone<BellProps>[] = [
data: {
job: JobType.Baun,
number: '555-BAUN',
location: "Bahama",
},
},
{
Expand All @@ -167,6 +169,7 @@ const BELL_ZONES: Zone<BellProps>[] = [
data: {
job: JobType.Baun,
number: '555-BAUN',
location: "Unicorn",
},
},
{
Expand Down Expand Up @@ -267,14 +270,14 @@ export class JobBellProvider {
return GetGameTimer() - this.lastCall > 15000;
},
action: () => {
this.callSociety(zone.data.number);
this.callSociety(zone.data.number, zone.data?.location);
},
},
]);
}
}

private callSociety(number: string) {
private callSociety(number: string, location: string = undefined) {
this.lastCall = GetGameTimer();
this.animationService.playAnimation({
base: {
Expand All @@ -288,10 +291,15 @@ export class JobBellProvider {
},
});

let message = "Une personne vous demande à l'accueil"
if (!location) {
message += ` - ${location}`
}

TriggerServerEvent('phone:sendSocietyMessage', 'phone:sendSocietyMessage:' + uuidv4(), {
anonymous: false,
number,
message: "Une personne vous demande à l'accueil",
message: message,
position: true,
});
}
Expand Down

0 comments on commit 82e76f1

Please sign in to comment.