Ranyo13
ManCausingMayhem
- Joined
- Aug 22, 2009
- Messages
- 981
- Reaction score
- 39
Hello otlanders..
I got a buy command that lets you buy certain items for certain ammount of gold coins. e.g: The player enters !buy backpack or !buy aol.. It takes an ammount of money from the buyer and gives the item.. Well i wanted to edit it so when the buyer says (!buy) only he gets a list of whats available that he cud buy.. I think its posted somewhere but i realy cant find it so heres the script:
Please help me with what i requested and i will add u reputation, if u can't script it just dun comment like a weird guy..
Thanks in advance,
Ranyo13
I got a buy command that lets you buy certain items for certain ammount of gold coins. e.g: The player enters !buy backpack or !buy aol.. It takes an ammount of money from the buyer and gives the item.. Well i wanted to edit it so when the buyer says (!buy) only he gets a list of whats available that he cud buy.. I think its posted somewhere but i realy cant find it so heres the script:
Code:
local buyableitems = {
["aol"] = {money=10, id=2173, amount=1},
["food"] = {money=1, id=2671, amount=100},
["backpack"] = {money=100, id=1988, amount=1}
}
function onSay(cid, words, param)
buyitem = buyableitems[param]
if (buyitem ~= nil) then
if getPlayerMoney(cid) >= buyitem.money then
doSendMagicEffect(getCreaturePosition(cid), 14)
doPlayerAddItem(cid,buyitem.id,buyitem.amount)
doPlayerRemoveMoney(cid,buyitem.money)
doPlayerSendTextMessage(cid,24,"You've succesfully bought "..param.."!")
else
doPlayerSendCancel(cid,"You need "..buyitem.money.." gold to buy this item.")
end
else
doPlayerSendCancel(cid,"You can not buy this item.")
end
return TRUE
end
Thanks in advance,
Ranyo13