Witam, mam problem z skryptem usuwającym ścianę. Otóż raz działa, a raz nie.
Czasami ściany się nie respią, a czasami zamiast jednej jest ich kilka.
Czasami ściany się nie respią, a czasami zamiast jednej jest ich kilka.
PHP:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=389, y=274, z=8, stackpos=1}
getgate = getThingfromPos(gatepos)
local timetocreate = 15
if item.uid == 9908 and item.itemid == 1945 and getgate.itemid == 1025 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You removed the wall.")
local function create(cid)
doCreateItem(1025, gatepos)
end
addEvent(create, timetocreate*1000*60, cid)
elseif item.uid == 9908 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"The wall is already removed.")
end
return 1
end