• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

HELP [SIMPLE]somebody asap please before starting my ot i need to fix this

Fidgitz444

Banned User
Joined
Feb 24, 2014
Messages
215
Reaction score
55
i know its ismple for you guys
i use a teleport script for my ot so if u say !t1 etc it will tp u there but
when your red pz it says You have pz so its good thing
but I need to fix it so if i have BATTLE status i cant tp and it will say
"You have Battle Status" or so;p thx

hers my .lua inside talkactions


function onSay(cid, words, param, channel)
if(isPlayerPzLocked(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you got PZ")
return true
end
local master = false
if(words == '/t') then
master = true
elseif(param == '') then
local str = ""
for i, town in ipairs(getTownList()) do
str = str .. town.name .. "\n"
end

doShowTextDialog(cid, 2160, str)
return true
end

local tid, t = cid, string.explode(param, ",")
if(t[(master and 1 or 2)]) then
tid = getPlayerByNameWildcard(t[(master and 1 or 2)])
if(not tid or (isPlayerGhost(tid) and getPlayerAccess(tid) > getPlayerAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[(master and 1 or 2)] .. " not found.")
return true
end
end

local tmp = getPlayerTown(cid)
if(not master) then
tmp = t[1]
if(not tonumber(tmp)) then
tmp = getTownId(tmp)
if(not tmp) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Town " .. t[1] .. " does not exists.")
return true
end
end
end

local pos = getTownTemplePosition(tmp, false)
if(type(pos) ~= 'table' or isInArray({pos.x, pos.y}, 0)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Town " .. t[1] .. " does not exists or has invalid temple position.")
return true
end

pos = getClosestFreeTile(tid, pos)
if(type(pos) ~= 'table' or isInArray({pos.x, pos.y}, 0)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
return true
end

tmp = getCreaturePosition(tid)
if(doTeleportThing(tid, pos) and not isPlayerGhost(tid)) then
doSendMagicEffect(tmp, CONST_ME_POFF)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
end

return true
end
 
Replace:
Code:
if(isPlayerPzLocked(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you got PZ")
return true
end

with:
Code:
if getCreatureCondition(cid, CONDITION_INFIGHT) == true then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have Battle Status")
    return true
end
 
Last edited:
Replace:
Code:
if(isPlayerPzLocked(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you got PZ")
return true
end

with:
Code:
if getCreatureCondition(cid, CONDITION_INFIGHT) == true then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have Battle Status")
    return true
end
works thx mate :)
 
Back
Top