murilo2929 Posted July 6, 2019 Share Posted July 6, 2019 [2019-07-06 00:03:05] ERRO: sistemapolicia\policiaadm.Lua:507: attempt to index local 'maxrow' (a nil value)[2019-07-06 00:03:05] sistemapolicia restarted successfully[2019-07-06 00:03:13] ERRO: sistemapolicia\policiaadm.Lua:547: attempt to index field '?' (a nil value) function getAllowList(factionID) local factionID = tonumber(factionID) if factionID then for k,v in pairs(dutyAllow) do if tonumber(v[1]) == factionID then key = k break end end return dutyAllow[key][3] --Here is appoint the error end end Link to comment
Investor Posted July 6, 2019 Share Posted July 6, 2019 dutyAllow[key] is a nil value (doesn't exist). You probably wanted dutyAllow[k] Link to comment
murilo2929 Posted July 6, 2019 Author Share Posted July 6, 2019 (edited) 4 hours ago, Investor said: dutyAllow[key] is a nil value (doesn't exist). You probably wanted dutyAllow[k] I change to dutyAllow[k] and don't work Edit: i remove the [key] and work, i just put dutyAllow. Edit2: function openDutyWindow() local availablePackages, allowList = fetchAvailablePackages(localPlayer) if #availablePackages > 0 then local dutyLevel = getElementData(localPlayer, "duty") if not dutyLevel or dutyLevel == 0 then selectPackageGUI_open(availablePackages, allowList) else triggerServerEvent("duty:offduty", localPlayer) end else outputChatBox("There is no duty available for you at this spot!") end end addCommandHandler("duty", openDutyWindow) I'm have a error with that command duty, when i type in chat /duty nothing happend Edited July 6, 2019 by murilo2929 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now