• 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!

Block talkaction say in protection zone.

margoh

{{ user.title }}
Joined
Apr 1, 2013
Messages
807
Solutions
18
Reaction score
355
Hello,

I want to make my talkaction impossible to use in protection zones, houses.
Can someone tell me how to do it? Because idk how ;/

Thanks for your answer.
Best wishes,
margoh.
 
Add this
Code:
local pos = getPlayerPosition(cid) 

if getTilePzInfo(pos) == TRUE then 
        doRemoveCondition(cid,CONDITION_INFIGHT) 
else 
doPlayerSendCancel(cid,"You can use this command in PZ.") 
        return TRUE 
 end
below this function onSay(cid, words, param, channel)
 
Thank you :)
I have one more question, can you tell me how to block teleporting to pz? I mean when i am outside the pz and 2nd player is in pz. I have blocked possibility to use command.
 
First of all,
_Aion_'s script will not work. That will do the opposite of what you requested.

Now, here's a fixed version:

LUA:
local pos = getPlayerPosition(cid) 

if getTilePzInfo(pos) == TRUE then 
    doPlayerSendCancel(cid,"You may not use this command while standing inside of a protection zone.") 
    return TRUE 
end

And, for your other request, the 2nd player is placed in a parameter. Here's an example :
Code:
/command "2ndplayername"
without the quotation marks.

Here's a script, add this below function onSay(cid, words, param).
LUA:
    local t = string.explode(param, ",")
    if t[1] then
        local pid, pidpos = getPlayerByNameWildcard(t[1]), getThingPos(getPlayerByNameWildcard(t[1]))
        if not getTilePzInfo(pos) then

After this line, make sure to add two ends before the last end in your script. Example:

LUA:
function onSay(cid, words, param)
    local t = string.explode(param, ",")
    if t[1] then
        local pid, pidpos = getPlayerByNameWildcard(t[1]), getThingPos(getPlayerByNameWildcard(t[1]))
        if not getTilePzInfo(pos) then
            doCreatureSay(cid, "Command will return true.", TALKTYPE_MONSTER)
        else
            doCreatureSay(cid, "Command will not work because target player is inside of protection zone tile.", TALKTYPE_MONSTER)
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        end
    else
        doCreatureSay(cid, "Wrong specified parameter(s).", TALKTYPE_MONSTER)
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    end
    return true
end
 
Last edited:
Back
Top