freddzor11
Member
- Joined
- May 25, 2009
- Messages
- 695
- Reaction score
- 5
Greetings people!
I got a teleport script, but when I having an event like Zombie event or something then people can use it in there and win, so I wanna ask you if it's possible to make that you can't use it while you are in NO-PVP zone?
Here is teleport script
I got a teleport script, but when I having an event like Zombie event or something then people can use it in there and win, so I wanna ask you if it's possible to make that you can't use it while you are in NO-PVP zone?
Here is teleport script
Code:
local t = {}
function count(cid, time)
if isPlayer(cid) then
if getCreatureCondition(cid,CONDITION_INFIGHT) == false and isPlayerPzLocked(cid) == false then
if time > 0 then
doSendAnimatedText(getThingPos(cid), time, COLOR_RED)
addEvent(count, 1000, cid, time - 1)
return
else
local p = getPlayerMasterPos(cid)
doTeleportThing(cid, p)
doSendMagicEffect(p, CONST_ME_ENERGYAREA)
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Teleport to temple cancelled because you got attacked!")
end
end
t[cid] = nil
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if t[cid] then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your teleporter already in use.")
return true
end
if getCreatureCondition(cid, CONDITION_INFIGHT) or isPlayerPzLocked(cid) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can't use this while you are in battle.")
return true
end
count(cid, 5, temple)
t[cid] = true
return true
end