Jump to content

[HELP]That error


Recommended Posts

[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
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 by murilo2929
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...