From ef25baf8e2e3f39ebd8d313a7da4b0548bc3d2b3 Mon Sep 17 00:00:00 2001 From: voxty <135042947+voxty@users.noreply.github.com> Date: Sat, 19 Oct 2024 00:03:43 -0400 Subject: [PATCH] Update client.ts --- integrations/call911/client/client.ts | 58 --------------------------- 1 file changed, 58 deletions(-) diff --git a/integrations/call911/client/client.ts b/integrations/call911/client/client.ts index 31a87bc..8b5de14 100644 --- a/integrations/call911/client/client.ts +++ b/integrations/call911/client/client.ts @@ -66,62 +66,4 @@ onNet(Events.Send911ToAll, async ({ name, description, position }: { name: strin "^7" + name + " | Call Description: " + description + " | Postal: " + postal + " | Street: " + lastStreetName ] }); -}) - - -onNet(Events.Send911, ({ source, description }: EventData) => { - console.log(`911 Call Received from Player ID: ${source}. Description: ${description}`); - - const playerPed: number = GetPlayerPed(-1); - const [x, y, z]: number[] = GetEntityCoords(playerPed, true); - const [lastStreet]: number[] = GetStreetNameAtCoord(x!, y!, z!); - const lastStreetName: string = GetStreetNameFromHashKey(lastStreet); - - let proximity: number = 500; - let foundPlayers: boolean = false; - - while (!foundPlayers && proximity <= 2000) { - const playersInProximity: number[] = []; - - const players: number[] = GetActivePlayers(); - - for (const playerId of players) { - if (playerId !== source) { - const targetPed: number = GetPlayerPed(playerId); - const [targetX, targetY, targetZ]: number[] = GetEntityCoords(targetPed, true); - - const distance: number = Vdist(x!, y!, z!, targetX ?? 0, targetY ?? 0, targetZ ?? 0); - - if (distance <= proximity) { - playersInProximity.push(playerId); - } - } - } - - if (playersInProximity.length > 0) { - foundPlayers = true; - TriggerEvent('chat:addMessage', playersInProximity, { - color: [255, 255, 255], - multiline: true, - args: [ - "^1 [Emergency Services]", - "^7 A 911 call has been received | " + description + " | Located At: " + lastStreetName - ] - }); - } else { - proximity += 100; - } - - if (playersInProximity.length >= 4) { - foundPlayers = true; - } - } - - if (!foundPlayers) { - TriggerEvent('chat:addMessage', -1, { - color: [255, 255, 255], - multiline: true, - args: ["^1 [Emergency Services]", "^7 A 911 call has been received | " + description + " | Located At: " + lastStreetName] - }); - } });