• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Donate item lever ( rep +++ )

Dramix

New Member
Joined
Jun 26, 2009
Messages
289
Reaction score
1
Hello, I'm Searching for a script so i can get a refund for the donation items i have bought on the website, i was thinking for something like... when i use a lever i get like half of the points back or something like that.
 
Made this real quick, try it.

local item = 2444 -- Change this number to whatever the id of the item u want to remove.
local points = 100 -- Change this to how many points you want to add.
local effect = 56 -- change that to the effect you want to have given after using.

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerItemCount(cid,item) < 1 then
return doPlayerSendCancel(cid,"You dont have a "..getItemNameById(item)..".")
end
if (getPlayerItemCount(cid,item) == 1) then
if (getPlayerSlotItem(cid, itemslot).itemid == item) then
return doSendMagicEffect(getThingPos(cid),2) and doCreatureSay(cid,"You are wearing that item ",TALKTYPE_MONSTER)
end
return doPlayerRemoveItem(cid, item, getPlayerItemCount(cid,item)) and doSendMagicEffect(getThingPos(cid),40) and doPlayerAddMoney(cid,cost) and doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have sold a "..getItemNameById(item).." for "..cost.." gold coins")
end
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `name` = '" .. getAccountByName(getCreatureName(itemEx.uid)) .. "' LIMIT 1;")
doCreatureSay(cid, "You have received " .. points .. " premium points!", TALKTYPE_ORANGE_1, false, nil, toPosition)
doSendMagicEffect(toPosition, effect)
return true
end
 
Last edited:
The same but decent

LUA:
Local item = 2444 -- Change this number to whatever the id of the item u want to remove.
local points = 100 -- Change this to how many points you want to add.
local effect = 56 -- change that to the effect you want to have given after using.

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerItemCount(cid,item) < 1 then
return doPlayerSendCancel(cid,"You dont have a "..getItemNameById(item)..".")
end
if (getPlayerItemCount(cid,item) == 1) then
if (getPlayerSlotItem(cid, itemslot).itemid == item) then
return doSendMagicEffect(getThingPos(cid),2) and doCreatureSay(cid,"You are wearing that item ",TALKTYPE_MONSTER)
end
return doPlayerRemoveItem(cid, item, getPlayerItemCount(cid,item)) and doSendMagicEffect(getThingPos(cid),40) and doPlayerAddMoney(cid,cost) and doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Yo u have sold a "..getItemNameById(item).." for "..cost.." gold coins")
end
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `name` = '" .. getAccountByName(getCreatureName(itemEx.uid)) .. "' LIMIT 1;")
doCreatureSay(cid, "You have received " .. points .. " premium points!", TALKTYPE_ORANGE_1, false, nil, toPosition)
doSendMagicEffect(toPosition, effect)
return true
end
 
alright, open ur actions.xml then put this in there

<action uniqueid="xxxx" event="script" value="other/lever.lua"/>

what this will do when u put a unique id for the lever in the map editor, it will make it check for the item, and see if u have it, and if u do itll remove the item from u and then give u premium points
 
local item = 2444 -- Change this number to whatever the id of the item u want to remove.
local points = 100 -- Change this to how many points you want to add.
local effect = 56 -- change that to the effect you want to have given after using.
local storage = xxxx -- change this to the storage value that vip players have.

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerStorageValue(cid, storage) == 1 and
if getPlayerItemCount(cid,item) < 1 then
return doPlayerSendCancel(cid,"You dont have a "..getItemNameById(item)..".")
end
if (getPlayerItemCount(cid,item) == 1) then
if (getPlayerSlotItem(cid, itemslot).itemid == item) then
return doSendMagicEffect(getThingPos(cid),2) and doCreatureSay(cid,"You are wearing that item ",TALKTYPE_MONSTER)
end
return doPlayerRemoveItem(cid, item, getPlayerItemCount(cid,item)) and doSendMagicEffect(getThingPos(cid),40) and doPlayerAddMoney(cid,cost) and doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Yo u have sold a "..getItemNameById(item).." for "..cost.." gold coins")
end
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
doCreatureSay(cid, "You have received " .. points .. " premium points!", TALKTYPE_ORANGE_1, false, nil, toPosition)
doSendMagicEffect(toPosition, effect)
return true
end

not tested, somebody wanna test it and lemme know if theres errors?
 
Back
Top