Jump to content

Recommended Posts

Boa Tarde pessoal preciso de ajuda nessa função

if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then -- AVISO AQUI!
	local col = getElementData(getLocalPlayer(),"currentCol")
		if #getElementsWithinColShape(col,"player") > 1 or getNetworkStats().packetlossLastSecond > 1 then return end
		x,y,z = getElementPosition(getLocalPlayer())
		if pcount ~= nil and pcount < getTickCount() then
			pcount = getTickCount() + 2000
			x,y,z = getElementPosition(getLocalPlayer())
			outputChatBox("Wait... Press '" ..tostring(key).. "' (you must not move!)",255,255,255)
			return false
		elseif pcount == nil then
			pcount = getTickCount() + 2000
			x,y,z = getElementPosition(getLocalPlayer())
			return false
		end
		local x1,y1,z1 = getElementPosition(getLocalPlayer())
			if x1 ~= x or y1 ~= y or z1 ~= z then
				pcount = nil
				return false
			end
			pcount = nil
			triggerServerEvent("onPlayerTakeItemFromGround", getLocalPlayer(), itemName, col)
			setElementData(getLocalPlayer(),"loot",false)
			setElementData(getLocalPlayer(),"currentCol",false)
			disableMenu()
		else
			startRollMessage2("Inventory","Inventory is full!",255,0,0)
		end
	end

O AVISO NA LINHA 1: attempt to perform arithmetic on a boollean value

 

Obrigado desde de já

Link to comment
  • Other Languages Moderators

Você não deve somar funções pois elas podem retornar false, o aviso está dizendo que ele não conseguiu fazer um cálculo com valor booleano (false).

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...