hey i updated to 0.3.5 distro and i put over the buy.lua and i say !buy "aol it say invalid item why?
code:
code:
Code:
-----------------------By Nahruto--------------------------
-------------------http://otfans.net/----------------------
function getPlayerMoney(cid)
gold = getPlayerItemCount(cid,2148)
plat = getPlayerItemCount(cid,2152)*100
crys = getPlayerItemCount(cid,2160)*10000
money = gold + plat + crys
return money
end
local items = {
["aol"] = {cash=10000, id=2173, amount=1},
["backpack"] = {cash=20, id=2000, amount=1},
["shovel"] = {cash=50, id=2554, amount=1},
["rope"] = {cash=50, id=2120, amount=1},
["food"] = {cash=100, id=2672, amount=10}
}
---------End Config ---------
function onSay(cid, words, param)
bitem = items[param]
if (bitem ~= nil) then
if getPlayerMoney(cid) >= bitem.cash then
doPlayerAddItem(cid,bitem.id,bitem.amount)
doPlayerRemoveMoney(cid,bitem.cash)
doSendMagicEffect(getPlayerPosition(cid),14)
else
doPlayerSendCancel(cid,"Sorry, you dont have enough money")
doSendMagicEffect(getPlayerPosition(cid),2)
end
else
doPlayerSendCancel(cid, "Invalid item.")
doSendMagicEffect(getPlayerPosition(cid),2)
end
return 1
end