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

TFS 1.X+ PZ Locked Functions Help

CesarZ

Well-Known Member
Joined
Sep 20, 2012
Messages
272
Solutions
4
Reaction score
66
I go this Function im trying to add when they die from The Arena They also Take off the PZLock and skulls if they Have


LUA:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
        local player = Player(cid)
        if player:isPlayer() then
            local ppos = player:getPosition()
            if isInRange(ppos, arena.frompos, arena.topos) then
                local maxhp = player:getMaxHealth()
                player:addHealth(maxhp)


---I know it goes somewhere around here---


                addEvent(doCreatureAddHealth, 100, player:getId(), maxhp)
                player:sendTextMessage(MESSAGE_STATUS_WARNING,"[Arena]: You lost the duel.")
            end
            if isInRange(ppos, arena.frompos, arena.topos) then
                player:teleportTo(arena.exitpos)
                return true
            end
        end
        return true
    end
 
    function onLogin(cid)
        local player = Player(cid)
        player:registerEvent("pvparena")
        return true
    end
 
Try adding this, Its supposed to remove all conditions and white/yellow skull.
LUA:
local conditions = {CONDITION_POISON,
                    CONDITION_FIRE,
                    CONDITION_ENERGY,
                    CONDITION_PARALYZE,
                    CONDITION_DRUNK,
                    CONDITION_DROWN,
                    CONDITION_FREEZING,
                    CONDITION_DAZZLED,
                    CONDITION_INFIGHT,
                    CONDITION_EXHAUST_HEAL,
                    CONDITION_SPELLCOOLDOWN,
                    CONDITION_SPELLGROUPCOOLDOWN,
                    CONDITION_EXHAUST_COMBAT,
                    CONDITION_EXHAUSTED,
                    CONDITION_EXHAUST,
                    CONDITION_EXHAUST_WEAPON,
                    CONDITION_BLEEDING,
                    CONDITION_CURSED
                }
            for _, condition in ipairs(conditions) do
            if(player:getCondition(condition)) then
                player:removeCondition(condition)
            end
            end
            if isInArray({SKULL_YELLOW, SKULL_WHITE}, player:getSkull()) then
            player:setSkull(SKULL_NONE)
            player:setSkullTime(0)
            end
 
it worked, it takes everything off, but the pzlock.
Post automatically merged:

Try adding this, Its supposed to remove all conditions and white/yellow skull.
LUA:
local conditions = {CONDITION_POISON,
                    CONDITION_FIRE,
                    CONDITION_ENERGY,
                    CONDITION_PARALYZE,
                    CONDITION_DRUNK,
                    CONDITION_DROWN,
                    CONDITION_FREEZING,
                    CONDITION_DAZZLED,
                    CONDITION_INFIGHT,
                    CONDITION_EXHAUST_HEAL,
                    CONDITION_SPELLCOOLDOWN,
                    CONDITION_SPELLGROUPCOOLDOWN,
                    CONDITION_EXHAUST_COMBAT,
                    CONDITION_EXHAUSTED,
                    CONDITION_EXHAUST,
                    CONDITION_EXHAUST_WEAPON,
                    CONDITION_BLEEDING,
                    CONDITION_CURSED
                }
            for _, condition in ipairs(conditions) do
            if(player:getCondition(condition)) then
                player:removeCondition(condition)
            end
            end
            if isInArray({SKULL_YELLOW, SKULL_WHITE}, player:getSkull()) then
            player:setSkull(SKULL_NONE)
            player:setSkullTime(0)
            end
 
Try adding this in a line separately
LUA:
player:removeCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)
 
Solution
Back
Top