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