25-02-2013, 02:03 PM
PHP Code:
local teleportPos = {x=1000, y=1000, z=7} -- miejsce w którym pojawia się teleport
local teleportTo = {x=500, y=500, z=7} -- miejsce w które będzie przenosił teleport
local _time = 10 -- czas w sekundach po jakim zniknie teleport gdy podamy -1 teleport zniknie dopiero po restarcie
function onTrigger(cid, thing1, frompos, thing2, topos, trigger, text)
if(trigger.id == 1)then
itemUid = doCreateItem(1930, 1, teleportPos)
setItem(itemUid, {text = teleportTo.x .. ";" .. teleportTo.y .. ";" .. teleportTo.z})
doPlayerSendTextMessage(cid, 22, "Portal bedzie otwarty przez ".._time.." sekund")
if(_time ~= -1)then
addEvent(function(uid) doRemoveItem(uid, 1) end, _time*1000, itemUid)
end
end
return 1
end
Spróbuj tak.

