From b632e1d26b759b2dd1412228573dd0e129abd8fd Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 23 Feb 2023 01:16:16 -0600 Subject: [PATCH] Add vehicle occupants native wrap --- scripts/server/native/connected.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/server/native/connected.js b/scripts/server/native/connected.js index a7562569..558ac309 100644 --- a/scripts/server/native/connected.js +++ b/scripts/server/native/connected.js @@ -1471,4 +1471,19 @@ function addAllEventHandlers() { } } +// =========================================================================== + +function getVehicleOccupants(vehicle) { + let occupants = []; + + let clients = getClients(); + for (let i in clients) { + if (getPlayerVehicle(clients[i]) == vehicle) { + occupants.push(clients[i]); + } + } + + return occupants; +} + // =========================================================================== \ No newline at end of file