wdvx
Sniper 7.4 War
- Joined
- Mar 5, 2013
- Messages
- 263
- Reaction score
- 14
I'm trying to create an auto-refiller when using items (such as food) but i'm stuck and need help.
Console error:
item was not found
Appreciate every help!
LUA:
local MAX_FOOD = 1200
function onUse(cid, item, frompos, item2, topos)
if (FOODS[item.itemid] == nil) then
return FALSE
end
local size = FOODS[item.itemid][1]
local sound = FOODS[item.itemid][2]
if (getPlayerFood(cid) + size > MAX_FOOD) then
doPlayerSendCancel(cid, "You are full.")
return TRUE
end
doRemoveItem(item.uid, 1)
--[[ This part below this text ]] --
local f = function()
return doTransformItem(item.uid, item.itemid, getPlayerItemCount(cid, item.itemid) + 1)
end
if getPlayerItemCount(cid, item.itemid) < 100 then
addEvent(f, 2000)
end
doPlayerFeed(cid, size)
return TRUE
end
Console error:
item was not found
Appreciate every help!