Updating getNearbyPlayers

- Added an 'early' return with an empty table if the source or the playerCoord are not given.
This commit is contained in:
Canis_Lupus
2023-07-24 19:58:27 +02:00
committed by GitHub
parent 30d497500d
commit b6e1c4deba
+2
View File
@@ -15,12 +15,14 @@ local function getNearbyPlayers(source, closest, distance, ignore)
if not source then
error("Received invalid first argument (source); should be playerId")
return result
end
playerCoords = GetEntityCoords(playerPed)
if not playerCoords then
error("Received nil value (playerCoords); perhaps source is nil at first place?")
return result
end
end