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

Block utevo res in specific area or remove summons in this area

mRefaat

Marketing and Coding
Joined
Jan 18, 2014
Messages
854
Solutions
3
Reaction score
141
Location
Egypt
Hello,

I want a script which remove summons or block utevo res in specific areas.
any help?

using tfs 0.3.7 rev5969
 
Thanks, it worked.
But need change in lines to show the cancel msg
from
Lua:
local t = {
serpent = {x=115, y=123, z=7},
serpentto = {x=151, y=159, z=7},
zombie = {x=100, y=179, z=6},
zombieto = {x=128, y=208, z=6},
pacman = {x=32282, y=32886, z=6},
pacmanto = {x=32289, y=32895, z=6},
bomber = {x=32156, y=32549, z=6},
bomberto = {x=32165, y=32570, z=6},
ping = {x=32521, y=32780, z=6},
pingto = {x=32539, y=32787, z=6}
}

function onSay(cid, words, param, channel)
    if isPlayer(cid) and isInRange(getThingPos(cid), t.serpent, t.serpentto) or isPlayer(cid) and isInRange(getThingPos(cid), t.zombie, t.zombieto) or isPlayer(cid) and isInRange(getThingPos(cid), t.pacman, t.pacmanto) then
        if(param == "utevo res") then
            doPlayerSendCancel(cid, "You can't using this spell here.")
        end
    return true
    end
end

to
Lua:
local t = {
serpent = {x=115, y=123, z=7},
serpentto = {x=151, y=159, z=7},
zombie = {x=100, y=179, z=6},
zombieto = {x=128, y=208, z=6},
pacman = {x=32282, y=32886, z=6},
pacmanto = {x=32289, y=32895, z=6},
bomber = {x=32156, y=32549, z=6},
bomberto = {x=32165, y=32570, z=6},
ping = {x=32521, y=32780, z=6},
pingto = {x=32539, y=32787, z=6}
}

function onSay(cid, words, param, channel)
    if isPlayer(cid) and isInRange(getThingPos(cid), t.serpent, t.serpentto) or isPlayer(cid) and isInRange(getThingPos(cid), t.zombie, t.zombieto) or isPlayer(cid) and isInRange(getThingPos(cid), t.pacman, t.pacmanto) then
            doPlayerSendCancel(cid, "You can't using this spell here.")
    return true
    end
end

Because the msg in first code happens only when you say "utevo res utevo res"
 
U can put some storage on there too (insert when someone enter on TP of this event)... and check the same storage on spells.
ya I know, have other better ways to do it, but its a option for u do and learn how it works.
 
U can put some storage on there too (insert when someone enter on TP of this event)... and check the same storage on spells.
ya I know, have other better ways to do it, but its a option for u do and learn how it works.
Yea, that's going to work too.
I searched for script like that because spell use function from spells.cpp and no have lua script so I can edit.
But now it works with script.
 
@Zulfix
Lua:
local event_areas = {
    {{x = 999, y = 849, z = 7}, {x = 1029, y = 879, z = 7}}, -- {{from},{to}}
    {{x = 906, y = 831, z = 7}, {x = 963, y = 888, z = 7}}
}

function onSay(cid, words, param, channel)
 for i = 1, #event_areas do
 local cid_pos = getThingPosition(cid)
    if isPlayer(cid) and isInArea(cid_pos, event_areas[i][1], event_areas[i][2]) then
            doPlayerSendCancel(cid, "You can't using this spell here.")
            end
    return true
    end
end
 
@Zulfix
Lua:
local event_areas = {
    {{x = 999, y = 849, z = 7}, {x = 1029, y = 879, z = 7}}, -- {{from},{to}}
    {{x = 906, y = 831, z = 7}, {x = 963, y = 888, z = 7}}
}

function onSay(cid, words, param, channel)
for i = 1, #event_areas do
local cid_pos = getThingPosition(cid)
    if isPlayer(cid) and isInArea(cid_pos, event_areas[i][1], event_areas[i][2]) then
            doPlayerSendCancel(cid, "You can't using this spell here.")
            end
    return true
    end
end
Thanks, that’s better and shorter.
 
@Zulfix
Lua:
local event_areas = {
    {{x = 999, y = 849, z = 7}, {x = 1029, y = 879, z = 7}}, -- {{from},{to}}
    {{x = 906, y = 831, z = 7}, {x = 963, y = 888, z = 7}}
}

function onSay(cid, words, param, channel)
for i = 1, #event_areas do
local cid_pos = getThingPosition(cid)
    if isPlayer(cid) and isInArea(cid_pos, event_areas[i][1], event_areas[i][2]) then
            doPlayerSendCancel(cid, "You can't using this spell here.")
            end
    return true
    end
end
Where do I put this script?
 
Talkactions
XML:
<talkaction log="no" access="0-3" words="utevo res" filter="word-spaced" event="script" value="scriptname.lua"/>
 
Back
Top