Oie,
eu queria saber como faz para verificar o cap livre antes de fazer a quest
aqui o que eu tenho, se não tiver cap ele só adiciona os itens que dá.
function onUse(cid, item, frompos, item2, topos) if item.uid == 2009 then queststatus = getPlayerStorageValue(cid,2009) if queststatus == -1 then bag = doPlayerAddItem(cid, 1987, 1) -- aqui voce coloca o id de uma bag ou backpack doPlayerSendTextMessage(cid,25,"You have found a bag.") doAddContainerItem(bag, 2480, 1) -- aqui voce add os items que voce quer que o player ganhe dentro da bag doAddContainerItem(bag, 2530, 1) setPlayerStorageValue(cid,2009,1) else doPlayerSendTextMessage(cid,25,"It is empty.") end else return 0 end return 1 end
eu sei que tem que adiciona um else a mais ali só não sei como...
Vlw psol
Já resolvi ><'
aqui a solução:
function onUse(cid, item, frompos, item2, topos) pweigh = getPlayerFreeCap(cid) -- pega o cap livre do player if item.uid == 2009 then queststatus = getPlayerStorageValue(cid,2009) if queststatus == -1 then if pweigh >= 102.00 then -- Se cap disponivel for maior ou igual a 102 faz quest bag = doPlayerAddItem(cid, 1987, 1) -- aqui voce coloca o id de uma bag ou backpack doPlayerSendTextMessage(cid,25,"You have found a bag.") doAddContainerItem(bag, 2480, 1) -- aqui voce add os items que voce quer que o player ganhe dentro da bag doAddContainerItem(bag, 2530, 1) setPlayerStorageValue(cid,2009,1) else -- Senão msg dizendo que ta sem cap doPlayerSendTextMessage(cid,22,"You have found a bag. Weighing 102.00 oz it is too heavy.") end else doPlayerSendTextMessage(cid,25,"It is empty.") end else return 0 end return 1 end
Pode fechar