SK
tfs 0.3

Erro comando leavehouse

Por sk8maleski, 18 de ago. de 2016 em Scripts

otx
2
1.3k
sk8maleskiS
18 de agosto de 2016 às 17:25

Estou com pequeno erro no comando "Leavehouse"

 

Uso versão OTX

8ebb016e2a8c43d0838c1b16ba2702b2.png

 

Script leavehouse.lua

 

 



function onSay(cid, words, param, channel)
    if(not checkExhausted(cid, 666, 10)) then
        return false
    end

    local house = getHouseFromPos(getCreaturePosition(cid))
    if(not house) then
        doPlayerSendCancel(cid, "You are not inside a house.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return false
    end

    local owner = getHouseInfo(house).owner
    if(owner ~= getPlayerGUID(cid) and (owner ~= getPlayerGuildId(cid) or getPlayerGuildLevel(cid) ~= GUILDLEVEL_LEADER)) then
        doPlayerSendCancel(cid, "You are not the owner of this house.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return false
    end

    setHouseOwner(house, 0)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
    return false
end

 

Night WolfN
18 de agosto de 2016 às 22:57

troca

    if(not checkExhausted(cid, 666, 10)) then
        return false
    end 

por
 

   if not exhaustion.check(cid, 666) then        return false    end 	exhaustion.set(cid, 666, 10)