Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local itemsSell = {
- ["wpr shield"] = {itemId = 5931, idMoeda = 3911, custo = 100}, -- [nome do item] = id do item que ira vender, id da moeda que sera cobrada, quantidade de moeda que sera removida.
- ["wpr legs"] = {itemId = 4545, idMoeda = 7532, custo = 200},
- ["wpr helmet"] = {itemId = 7432, idMoeda = 1234, custo = 777},
- ["wpr boots"] = {itemId = 3456, idMoeda = 2323, custo = 898},
- ["wpr sword"] = {itemId = 5452, idMoeda = 4343, custo = 1},
- ["wpr wand"] = {itemId = 1243, idMoeda = 2160, custo = 10000}
- }
- function onSay(cid, words, param, channel)
- if param == "" then
- doPlayerSendCancel(cid, "Paremetro invalido!")
- return true
- end
- param = string.lower(param)
- if itemsSell[param] then
- if doPlayerRemoveItem(cid, itemsSell[param].idMoeda, itemsSell[param].custo) then
- doPlayerAddItem(cid, itemsSell[param].itemId, 1)
- doPlayerSendTextMessage(cid,4, "Parabéns você adquiriu um ".. getItemNameById(itemsSell[param].itemId) ..".")
- else
- doPlayerSendTextMessage(cid, 4, "São necessarios ".. itemsSell[param].custo .." ".. getItemNameById(itemsSell[param].idMoeda) .." para comprar este item.")
- end
- else
- doPlayerSendCancel(cid, "Este não é um item válido!")
- end
- return true
- end
Add Comment
Please, Sign In to add comment