Ta aí!
local config = {
prices = {
[2173] = 250
},
words = {
["aol"] = "amulet of loss"
}
}
function onSay(cid, words, param, channel)
if(param == "") then
doPlayerSendCancel(cid, words .." [item name]")
return true
end
if(config.words[param]) then
param = config.words[param]
end
local id = getItemIdByName(param, false)
if(not id) then
doPlayerSendCancel(cid, "This item does not exist.")
return true
end
if(not config.prices[id]) then
doPlayerSendCancel(cid, "Sorry, you can not buy this item.")
return true
end
local backpack = doCreateItemEx(1988, 1)
local amount = getContainerCap(backpack)
local cost = config.prices[id] * amount
if(not doPlayerAddSoul(cid, -cost)) then
doPlayerSendCancel(cid, "Sorry, you do not have enough soul.")
return true
end
for i = 1, getContainerCap(backpack) do
doAddContainerItemEx(backpack, doCreateItemEx(id, 1))
end
doPlayerAddItemEx(cid, backpack)
return true
end








info
Grupo: Campones
Registrado: 14/02/13
Posts: 12
Reputação: +1
Eu não falo muito Português por isso vou ser breve
Possível remover soul points e nao dinheiro.
local config = { prices = { [2173] = 250 }, words = { ["aol"] = "amulet of loss" } } function onSay(cid, words, param, channel) if(param == "") then doPlayerSendCancel(cid, words .." [item name]") return true end if(config.words[param]) then param = config.words[param] end local id = getItemIdByName(param, false) if(not id) then doPlayerSendCancel(cid, "This item does not exist.") return true end if(not config.prices[id]) then doPlayerSendCancel(cid, "Sorry, you can not buy this item.") return true end local backpack = doCreateItemEx(1988, 1) local amount = getContainerCap(backpack) local cost = config.prices[id] * amount if(not doPlayerRemoveMoney(cid, cost)) then doPlayerSendCancel(cid, "Sorry, you do not have enough money.") return true end for i = 1, getContainerCap(backpack) do doAddContainerItemEx(backpack, doCreateItemEx(id, 1)) end doPlayerAddItemEx(cid, backpack) return true end