mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Updating getNearbyPlayers
- Added an 'early' return with an empty table if the source or the playerCoord are not given.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user