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

house protection

Dogrinha

New Member
Joined
Oct 6, 2019
Messages
206
Solutions
1
Reaction score
2
Hello, I would like to know how do I protect the players' house, well I can protect not to throw items inside, but the backpacks on the door are not being protected. How do I not have access to the backpacks that other players leave at the door? tfs 0.4

I use this house trash script


LUA:
function onMoveItem(moveItem, frompos, position, cid)
    if position.x == CONTAINER_POSITION then
        return true
    end

    local house = getHouseFromPos(position)
    if type(house) == 'number' then
        local owner = getHouseOwner(house)   
        if owner == 0 then
            return false, doPlayerSendCancel(cid, 'Sorry, not possible.')
        end
  
        if owner ~= getPlayerGUID(cid) then
            local sub = getHouseAccessList(house, 0x101):explode('\n')
            local guest = getHouseAccessList(house, 0x100):explode('\n')
            local isInvited = false

            if (#sub > 0) and isInArray(sub, getCreatureName(cid)) then
                isInvited = true
            end
          
            if (#guest > 0) and isInArray(guest, getCreatureName(cid)) then
                isInvited = true
            end           
      
            if not isInvited then
                return false, doPlayerSendCancel(cid, 'Sorry its not possible bcus you are not invited.')
            end
        end
    end
    return true
end
 
Hello, I would like to know how do I protect the players' house, well I can protect not to throw items inside, but the backpacks on the door are not being protected. How do I not have access to the backpacks that other players leave at the door? tfs 0.4

I use this house trash script


LUA:
function onMoveItem(moveItem, frompos, position, cid)
    if position.x == CONTAINER_POSITION then
        return true
    end

    local house = getHouseFromPos(position)
    if type(house) == 'number' then
        local owner = getHouseOwner(house)
        if owner == 0 then
            return false, doPlayerSendCancel(cid, 'Sorry, not possible.')
        end

        if owner ~= getPlayerGUID(cid) then
            local sub = getHouseAccessList(house, 0x101):explode('\n')
            local guest = getHouseAccessList(house, 0x100):explode('\n')
            local isInvited = false

            if (#sub > 0) and isInArray(sub, getCreatureName(cid)) then
                isInvited = true
            end
       
            if (#guest > 0) and isInArray(guest, getCreatureName(cid)) then
                isInvited = true
            end        
   
            if not isInvited then
                return false, doPlayerSendCancel(cid, 'Sorry its not possible bcus you are not invited.')
            end
        end
    end
    return true
end
you don't need any scripts or even source edits just open your RME then color the door of the house with house pallette condition field should work like this .
 

Attachments

you don't need any scripts or even source edits just open your RME then color the door of the house with house pallette condition field should work like this .
Well, i've done what you said, but, when players put backpack in the door, players who aren't invited they're still able to open those backpacks
 
Back
Top