Add create NPC (civilian) native wrapper

This commit is contained in:
Vortrex
2022-04-07 04:53:31 -05:00
parent 50208c76c8
commit 6a765739a5

View File

@@ -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) {