Merge branch 'nightly' into ragemp

This commit is contained in:
Vortrex
2022-05-31 08:35:59 -05:00
17 changed files with 207 additions and 66 deletions

View File

@@ -461,9 +461,13 @@ function getNPCInfoCommand(command, params, client) {
function getClosestNPC(position) {
let npcs = getServerData().npcs;
let interior = getPlayerInterior(client);
let dimension = getPlayerDimension(client);
let closest = 0;
for(let i in npcs) {
if(getDistance(npcs[i].ped.position, position) < getDistance(npcs[closest].ped.position, position)) {
if(getDistance(npcs[i].ped.position, position) < getDistance(npcs[closest].ped.position, position) && npcs[closest].interior == interior && npcs[closest].dimension == dimension) {
closest = i;
}
}