From 8ec35a5b62703822e17aae6df5656c365ea15678 Mon Sep 17 00:00:00 2001 From: Laszlo Dindeleux Date: Wed, 7 Mar 2018 15:16:35 +0100 Subject: [PATCH] Fix loop limit error Resolves the "attempt to get length" error, which caused that the robbery didn't stop when being too far from the zone, and sending notification to police officers. Tested and working. --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 98275f9d..9129b1b1 100644 --- a/server/main.lua +++ b/server/main.lua @@ -11,7 +11,7 @@ end RegisterServerEvent('esx_holdup:toofar') AddEventHandler('esx_holdup:toofar', function(robb) local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayers = ESX.GetPlayers() rob = false for i=1, #xPlayers, 1 do local xPlayer = ESX.GetPlayerFromId(xPlayers[i])