Eternal Life
New Member
Guys Ihave this script:
function getPlayerMoney(cid)
gold = getPlayerItemCount(cid,2148)
plat = getPlayerItemCount(cid,2152)*100
crys = getPlayerItemCount(cid,2160)*10000
money = gold + plat + crys
return money
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerMoney(cid) >= 10000 then
doPlayerRemoveMoney(cid,10000)
doPlayerAddItem(cid,2173,1)
doSendMagicEffect(getPlayerPosition(cid), 13)
else
doPlayerSendTextMessage(cid,19,"Sorry but you need 1 crystal coin to buy an aol.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return TRUE
end
What it does is that when i right click a switch it gives me and aol for 1crystal coin. So for the real reason why am posting this is becouse i want you to edit the script to work with items instead of money. Its for my vip switch system. This is what i wantit to do: When i click on the switch it takes away this item id(5887) [it is a pice of royal steel] and it gives me an item like this item id(2300) [it is a Vip Uh]
function getPlayerMoney(cid)
gold = getPlayerItemCount(cid,2148)
plat = getPlayerItemCount(cid,2152)*100
crys = getPlayerItemCount(cid,2160)*10000
money = gold + plat + crys
return money
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerMoney(cid) >= 10000 then
doPlayerRemoveMoney(cid,10000)
doPlayerAddItem(cid,2173,1)
doSendMagicEffect(getPlayerPosition(cid), 13)
else
doPlayerSendTextMessage(cid,19,"Sorry but you need 1 crystal coin to buy an aol.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return TRUE
end
What it does is that when i right click a switch it gives me and aol for 1crystal coin. So for the real reason why am posting this is becouse i want you to edit the script to work with items instead of money. Its for my vip switch system. This is what i wantit to do: When i click on the switch it takes away this item id(5887) [it is a pice of royal steel] and it gives me an item like this item id(2300) [it is a Vip Uh]