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

RevScripts script anti-push

pisquila

New Member
Joined
Nov 14, 2023
Messages
28
Reaction score
3
Is there any script where the player cannot be pulled into the pz area?

tfs 0.4 / 8.60
 
Revscript and Tfs 0.4
Do u mind to share the source? ;)

Looking on fireelemental source it seems like you got onPush function
LUA:
onPush(cid, target)

so try this:
LUA:
function onPush(cid, target)
    local cidPos = getThingPos(cid)
    local targetPos = getThingPos(target)
    local dir = getDirectionTo(targetPos, targetPos)
    local destPos = getPosByDir(targetPos, dir)
    if getTilePzInfo(cidPos) and getTilePzInfo(targetPos) then
        return true
    end
    if getTilePzInfo(destPos) then
        doPlayerSendCancel(cid, "You cannot push players into a protection zone.")
        return false
    end
    return true
end

LUA:
<event type="push" name="AntiPzPush" event="script" value="anti_pz_push.lua"/>

LUA:
registerCreatureEvent(cid, "AntiPzPush")

and don't waste your time with 0.4 :D
 
Revscript and Tfs 0.4
Do u mind to share the source? ;)

Looking on fireelemental source it seems like you got onPush function
LUA:
onPush(cid, target)

so try this:
LUA:
function onPush(cid, target)
    local cidPos = getThingPos(cid)
    local targetPos = getThingPos(target)
    local dir = getDirectionTo(targetPos, targetPos)
    local destPos = getPosByDir(targetPos, dir)
    if getTilePzInfo(cidPos) and getTilePzInfo(targetPos) then
        return true
    end
    if getTilePzInfo(destPos) then
        doPlayerSendCancel(cid, "You cannot push players into a protection zone.")
        return false
    end
    return true
end

LUA:
<event type="push" name="AntiPzPush" event="script" value="anti_pz_push.lua"/>

LUA:
registerCreatureEvent(cid, "AntiPzPush")

and don't waste your time with 0.4 :D
It would be possible to put it on the floor, not on the entire floor. It would be on a certain floor.
 
Back
Top