Big Smoker Posted July 2, 2017 Posted July 2, 2017 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á
Moderators Lord Henry Posted July 2, 2017 Moderators Posted July 2, 2017 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). Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
DNL291 Posted July 9, 2017 Posted July 9, 2017 Desculpe ter que falar isso, mas o que deve fazer pra corrigir? O óbvio: veja qual funcão retorna o valor booleano e o por quê. Please do not PM me with scripting related question nor support, use the forums instead.
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