From 6a765739a59930da5d30251092a0a64d35872bfc Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 7 Apr 2022 04:53:31 -0500 Subject: [PATCH] Add create NPC (civilian) native wrapper --- scripts/server/native/connected.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/server/native/connected.js b/scripts/server/native/connected.js index 0991fd50..e8d07614 100644 --- a/scripts/server/native/connected.js +++ b/scripts/server/native/connected.js @@ -556,6 +556,22 @@ function createGameVehicle(modelIndex, position, heading, toClient = null) { // =========================================================================== +function createGameCivilian(modelIndex, position, heading, toClient = null) { + if(areServerElementsSupported()) { + let civilian = game.createCivilian(getGameConfig().skins[getGame()][modelIndex][0], 0); + if(!isNull(civilian)) { + civilian.position = position; + civilian.heading = heading; + addToWorld(civilian); + return civilian; + } + } + + return false; +} + +// =========================================================================== + function getIsland(position) { if(getServerGame() == VRR_GAME_GTA_III) { if(position.x > 616) {