Hello guys, I'm using TFS 1.2 and when I buy something from NPC he won't sell me unless I don't have enough capacity. I want to make him throw stuff under me if I don't have the capacity.
Here's the part of the script that check's if I have cap or not:
What do I need to change here?
Here's the part of the script that check's if I have cap or not:
Lua:
local a, b = doNpcSellItem(cid, shop_itemid[cid], shop_amount[cid], shop_subtype[cid], false, false, 1988)
if(a < shop_amount[cid]) then
local msgId = MESSAGE_NEEDMORESPACE
if(a == 0) then
msgId = MESSAGE_NEEDSPACE
end
local msg = module.npcHandler:getMessage(msgId)
msg = module.npcHandler:parseMessage(msg, parseInfo)
module.npcHandler:say(msg, cid)
if(a > 0) then
Player(cid):removeMoney(a * shop_cost[cid])
if shop_itemid[cid] == ITEM_PARCEL then
doNpcSellItem(cid, ITEM_LABEL, shop_amount[cid], shop_subtype[cid], true, false, 1988)
end
return true
end
return false
else
local msg = module.npcHandler:getMessage(MESSAGE_ONBUY)
msg = module.npcHandler:parseMessage(msg, parseInfo)
module.npcHandler:say(msg, cid)
Player(cid):removeMoney(cost)
if shop_itemid[cid] == ITEM_PARCEL then
doNpcSellItem(cid, ITEM_LABEL, shop_amount[cid], shop_subtype[cid], true, false, 1988)
end
return true
end
What do I need to change here?