The Mapper
Just Imagine
- Joined
- Jul 22, 2009
- Messages
- 182
- Reaction score
- 2
Hello OTland, can anybody make me a talkaction so that when players under lvl 50 say !temple they get teleported to their corresponding city? PZ Lock pls.
function onSay(cid, words, param)
local playerPos = getCreaturePosition(cid)
if getTilePzInfo(playerPos) then
doSendMagicEffect(playerPos, CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
return true
end
if getCreatureCondition(cid, CONDITION_INFIGHT) then
doCreatureSay(cid, 'You are in combat', TALKTYPE_MONSTER) -- remove this line if you dont want text in default chat
doSendMagicEffect(playerPos, CONST_ME_POFF)
return true
end...
function onSay(player, words, param)
local playerPos = player:getPosition()
if player:isPzLocked() then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You are PZ locked.')
playerPos:sendMagicEffect(CONST_ME_POFF)
return true
end
if player:getLevel() > 50 then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You must be level 50 or below to use this command.')
playerPos:sendMagicEffect(CONST_ME_POFF)
return true
end
player:teleportTo(player:getTown():getTemplePosition())
return true
end
function onSay(cid, words, param)
local playerPos = getCreaturePosition(cid)
if isPlayerPzLocked(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You are PZ locked.')
doSendMagicEffect(playerPos, CONST_ME_POFF)
return true
end
if getPlayerLevel(cid) > 50 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You must be level 50 or below to use this command.')
doSendMagicEffect(playerPos, CONST_ME_POFF)
return true
end
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
return true
end
isPlayerPzLocked(cid) == true
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You are PZ locked.')
and
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You must be level 50 or below to use this command.')
doCreatureSay(cid, 'You are PZ locked.', TALKTYPE_MONSTER)
and
doCreatureSay(cid, 'You must be level 50 or below to use this command.', TALKTYPE_MONSTER)
this is the exact same as doing isPlayerPzLocked(cid)isPlayerPzLocked(cid) == true
tryAlso PZ Locked is not working on 0.3.6/0.4
if not isPlayerPzLocked(cid) then
this is the exact same as doing isPlayerPzLocked(cid)
all conditions in if statements return either true/false
tryit might return false (meaning the player is not pz locked), my mistakeCode:if not isPlayerPzLocked(cid) then
also replace all of the "return true"s to "return false"
after that it shouldn't show the command in default chat
this is the exact same as doing isPlayerPzLocked(cid)
all conditions in if statements return either true/false
Can you copy it all?Well i got other script working, using it that way.
Well the script it not the same as this.Can you copy it all?
Hehe ok, that explains why the isPlayerPzLocked didnt work, im not sure if it's possible to check if the player is battle locked.Im sorry I wanted battle locked. Sorry my english is not that good.
isPlayerPzLocked(cid) or getCreatureCondition(cid, CONDITION_PHYSICAL)
Not working thoHehe ok, that explains why the isPlayerPzLocked didnt work, im not sure if it's possible to check if the player is battle locked.
I will have a look if i find something
change the isPlayerPzLocked(cid) to this
Code:isPlayerPzLocked(cid) or getCreatureCondition(cid, CONDITION_PHYSICAL)
what if u change it to this insteadNot working tho
isPlayerPzLocked(cid) or getCreatureCondition(cid, CONDITION_INFIGHT)
condition_infight should be fine for both occurrences (just monster attack or actually in pvp)what if u change it to this instead
Code:isPlayerPzLocked(cid) or getCreatureCondition(cid, CONDITION_INFIGHT)
thats true, i just like to be sure when i make scripts then im 100% sure it wont bug.condition_infight should be fine for both occurrences (just monster attack or actually in pvp)
Still not working. Who wants to come to the server?thats true, i just like to be sure when i make scripts then im 100% sure it wont bug.
again, use the not keywordStill not working. Who wants to come to the server?
if not getCreatureCondition(cid, CONDITION_INFIGHT) then
if getCreatureCondition(cid, CONDITION_INFIGHT) == false then
function onSay(cid, words, param)
local playerPos = getCreaturePosition(cid)
if getTilePzInfo(playerPos) then
doSendMagicEffect(playerPos, CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
return true
end
if getCreatureCondition(cid, CONDITION_INFIGHT) then
doCreatureSay(cid, 'You are in combat', TALKTYPE_MONSTER) -- remove this line if you dont want text in default chat
doSendMagicEffect(playerPos, CONST_ME_POFF)
return true
end
if getPlayerLevel(cid) > 50 then
doCreatureSay(cid, 'You must be level 50 or below to use this command', TALKTYPE_MONSTER) -- remove this line if you dont want text in default chat
doSendMagicEffect(playerPos, CONST_ME_POFF)
return true
end
doSendMagicEffect(playerPos, CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
return true
end