sick
Member
I've got a problem on my script. I need someone to edit it so that people couldn't use lever when they are standing on empty place, where has to be wall ( when lever pulled ).
Thanks in advance.
Code:
function onUse(cid, item, frompos, item2, topos)
gatepos1 = {x=1018, y=989, z=6, stackpos=1}
gatepos2 = {x=1018, y=990, z=6, stackpos=1}
getgate1 = getThingfromPos(gatepos1)
getgate2 = getThingfromPos(gatepos2)
if item.uid == 5000 and item.itemid == 1945 and getgate1 and getgate2.itemid == 6857 then
doRemoveItem(getgate1.uid,1)
doRemoveItem(getgate2.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 5000 and item.itemid == 1946 and getgate1 and getgate2.itemid == 0 then
doCreateItem(6857,1,gatepos1)
doCreateItem(6857,1,gatepos2)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end
Thanks in advance.