Kod:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x=toPosition.x, y=toPosition.y, z=toPosition.z}
if item.actionid == 20000 then
local player = getCreaturePos(cid)
local pozdoprzejscia = { x=pos.x, y=pos.y+1, z=pos.z}
local pozdowyjscia = { x=pos.x, y=pos.y-1, z=pos.z}
if (player.x == pozdoprzejscia.x) and (player.y == pozdoprzejscia.y) and (player.z == pozdoprzejscia.z) then
if isCreature(getThingFromPos({x=toPosition.x, y=toPosition.y-1, z=toPosition.z}).uid) or isCreature(getThingFromPos({x=toPosition.x, y=toPosition.y-2, z=toPosition.z}).uid) then
doPlayerSendCancel(cid,"Full")
else
doTeleportThing(cid,{x=pos.x, y=pos.y-1, z=pos.z})
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
else
if (player.x == pozdowyjscia.x) and (player.y == pozdowyjscia.y) and (player.z == pozdowyjscia.z) then
doTeleportThing(cid,{x=pozdoprzejscia.x,y=pozdoprzejscia.y,z=pozdoprzejscia.z})
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
else
doPlayerSendCancel(cid,"Stan naprzeciw drzwi!")
end
end
end
return TRUE
end
Teleportuje jak trzeba ale... w?a?nie teleportuje nawet kiedy kto? jest w ?rodku. Wie kto? jak zrobi? poprawnie ?eby sprawdza? czy kto? ju? tam trenuje, a gdy tak to wy?wietla komunikat, ?e kto? ju? tam jest?