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

Searching anti house trash system :P

Status
Not open for further replies.

N e r o n Z

Banned User
Joined
Jul 12, 2016
Messages
308
Reaction score
81
Yo guys as the title says, im searching a anti house trash system... I cant find it somehow XD would be nice if someone can me link it or post it here ^^ im using tfs 0.4 / 8.60
 
@cbrm here: http://speedy*****malware.localhost/w6cUP/creatureevent.cpp

EDIT: DestinationSer: no with normal char ^^ I want it like if someone is trying to put stuff in ur house it says "Sorry its not possible bcus you are not invited" or something like that you know? :p
 
login.lua
Lua:
registerCreatureEvent(cid, "houseTrash")

creaturescripts.xml
XML:
<event type="moveitem" name="houseTrash" event="script" value="houseTrash.lua"/>

creaturescript houseTrash.lua
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
 
Ofc it does
GPpyij6.png
 
Status
Not open for further replies.
Back
Top