local money = 1000000
local item = 8299
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 9825 then
doPlayerRemoveMoney(cid, money)
doPlayerAddItem(cid, item)
end
return true
end
local money = 1000000
local item, count = 8299, 1
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, money) then
doPlayerAddItem(cid, item, count)
else
doPlayerSendCancel(cid, "You don't have enough money.")
end
return true
end
local money = 1000000
local item, count = 8299, 1
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 5794 then
doPlayerRemoveMoney(cid, money)
doPlayerAddItem(cid, item, count)
end
return true
end
<action itemid="ID" event="script" value="tools/lever.lua"/>
local money = 1000000
local item, count = 8299, 1
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, money) then
doPlayerAddItem(cid, item, count)
else
doPlayerSendCancel(cid, "You don't have enough money.")
end
return true
end
<action uniqueid="5794" event="script" value="lever.lua"/>
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {
cash = 1000000,
id = 8299
}
if(getPlayerMoney(cid) > cfg.cash) then
local reward = doCreateItemEx(cfg.id, 1)
if(doPlayerAddItemEx(cid, reward, true) ~= RETURNVALUE_NOERROR) then
return false
else
doPlayerRemoveMoney(cid, cash)
doCreatureSay(cid, "" .. getItemNameById(cfg.id) .. "!", TALKTYPE_ORANGE_1)
end
else
doPlayerSendCancel(cid, "You do not have enough money.")
end
return true
end
local config = {
cost = 1000000
item = 8299
},
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 5794 then
if doPlayerRemoveMoney(cid, config.cost) == true then
doPlayerAddItem(cid, config.item, 1)
else
doPlayerSendCancel(cid, "You don't have enough money.")
end
end
return true
end
<action uniqueid="5794" event="script" value="lever.lua"/>