Hello,
I try write script - when i put item on table, and use lever, items remove and give me addon.
My idea is to write it like this: If there is an item "ID1" in the amount of "Q1" and item "ID2" in the amount of "Q2" then the player gets an addon 1.
If these indices are not on the table, it checks the next condition on the same principle.
Can you help me please?
I try write script - when i put item on table, and use lever, items remove and give me addon.
My idea is to write it like this: If there is an item "ID1" in the amount of "Q1" and item "ID2" in the amount of "Q2" then the player gets an addon 1.
If these indices are not on the table, it checks the next condition on the same principle.
Can you help me please?
local itemsPos = {1935, 1217, 7}
local stackpos = {1,2,3,4,5,6,7,8,9,10}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPremium(cid) == FALSE then
doPlayerSendCancel(cid, "Sorry, only premium players may use addon lever.")
return TRUE
end
if getItemCountFromPosition(6500, item_pos) >= 500 and getPlayerStorageValue(cid) > 9000 then
doRemoveItem(uid,500)
setPlayerStorageValue(cid,9001,1)
doPlayerAddOutfit(cid,279,1)
doPlayerAddOutfit(cid,278,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, You have unlocked new addon!")
else if getItemCountFromPosition(2001, item_pos) >= 100 then
doRemoveItem(uid,100)
setPlayerStorageValue(cid,9002,1)
doPlayerAddOutfit(cid,279,2)
doPlayerAddOutfit(cid,278,2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, You have unlocked new addon!")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You dont have needed items!")
end
return true
end
Last edited: