local config =
{
dpCoords = {x = , y =, z = }
}
local text = "You are pz locked, you cannot teleport to dp."
function onSay(cid, words, param)
if(isPlayerPzLocked(cid) == false) then
text = "You came back to depo."
doTeleportThing(cid, config.doCoords, true)
end
doPlayerSendTextMessage(cid, 22, text)
return true
end
First script(not tested)
Code:local config = { dpCoords = {x = , y =, z = } } local text = "You are pz locked, you cannot teleport to dp." function onSay(cid, words, param) if(isPlayerPzLocked(cid) == false) then text = "You came back to depo." doTeleportThing(cid, config.doCoords, true) end doPlayerSendTextMessage(cid, 22, text) return true end
local config =
{
dpCoords = {x = , y =, z = }
}
local text1 = "You are pz locked, you cannot teleport to dp."
local text2 = "You came back to depot."
function onSay(cid, words, param)
if(isPlayerPzLocked(cid) == true) then
doPlayerSendTextMessage(cid, 22, text1)
else
doTeleportThing(cid, config.doCoords, true)
doPlayerSendTextMessage(cid, 22, text2)
end
return true
end
local t =
{
pos = {x=999, y=999, z=9}, -- Temple pos
}
function onSay(cid, words, param)
if(isPlayerPzLocked(cid) == true) then
doPlayerSendCancel(cid,'You are in combat')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
else
doTeleportThing(cid, t.pos, false)
end
end
<talkaction words="!dp" event="script" value="!dp.lua"/>
i tested its not working
error in line 8
local t =
{
pos = {x=999, y=999, z=9}, -- Temple pos
}
function onSay(cid, words, param)
if(isPlayerPzLocked(cid) == true) then
doPlayerSendTextMessage(cid, 22, You are in combat)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
else
doTeleportThing(cid, t.pos, false)
end
end
I would be glad if u could rep me cuz of this script.
In my script text change if somebody don't have pz. In other situation send:
"You are pz locked, you cannot teleport to dp."
Dude comeon you cant beg for rep, if a user thinks you deserve rep then he/she will probably give you rep...:thumbup:
local function teleport(cid)
if(isPlayer(cid)) then
if(isPlayerPzLocked(cid) or hasCondition(cid, CONDITION_INFIGHT)) then
doPlayerSendCancel(cid, "You're PZed. You cant use this.")
return true
end
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
local nPos = getTownTemplePosition(getPlayerTown(cid))
doTeleportThing(cid, nPos, true)
doSendMagicEffect(nPos, CONST_ME_TELEPORT)
end
return true
end
local function animation(cid, t)
if(isPlayer(cid)) then
doSendAnimatedText(getCreaturePosition(cid), t, TEXTCOLOR_ORANGE)
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isPlayerPzLocked(cid) or hasCondition(cid, CONDITION_INFIGHT)) then
doPlayerSendCancel(cid, "You're PZed. You cannot use this.")
return true
end
if(exhaustion.get(cid, item.itemid) == false) then
for i = 1, 5 do
addEvent(animation, i * 1000, cid, 6 - i)
end
addEvent(teleport, 5 * 1000, cid)
exhaustion.set(cid, item.itemid, 5)
else
doPlayerSendCancel(cid, "Plx wait a few secs.")
end
return true
end
reped~!