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

Lua House commands

Fiodor

Lua & Maps
Joined
Mar 14, 2009
Messages
400
Reaction score
10
Location
Poland
Hello

In my OTS I can buy a house, but i cant leave it/invite someone

when I write 'aleta sio' there appears white cloud and text 'sorry not possible'

<talkaction words="alana res" filter="word-spaced" event="function" value="houseBuy"/>
<talkaction words="alana grav" filter="word-spaced" event="function" value="houseSell"/>
<talkaction words="alana sio" filter="word-spaced" event="function" value="houseKick"/>
<talkaction words="aleta grav" filter="word-spaced" event="function" value="houseDoorList"/>
<talkaction words="aleta sio" filter="word-spaced" event="function" value="houseGuestList"/>
<talkaction words="aleta som" filter="word-spaced" event="function" value="houseSubOwnerList"/>
<talkaction words="alana som" filter="word-spaced" event="script" value="leavehouse.lua"/>

TFS 0.3.6, earlier 0.3.5, changed to newest version
 
This is how mine looks

Code:
        <talkaction words="/buyhouse" filter="word-spaced" event="function" value="houseBuy"/>
        <talkaction words="/sellhouse" filter="word-spaced" event="function" value="houseSell"/>
        <talkaction words="alana sio" filter="word-spaced" event="function" value="houseKick"/>
        <talkaction words="aleta grav" filter="word-spaced" event="function" value="houseDoorList"/>
        <talkaction words="aleta sio" filter="word-spaced" event="function" value="houseGuestList"/>
        <talkaction words="aleta som" filter="word-spaced" event="function" value="houseSubOwnerList"/>
        <talkaction words="/leavehouse" filter="word-spaced" event="script" value="leavehouse.lua"/>

leavehouse.lua
Code:
function onSay(cid, words, param, channel)
        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
 
those files are ok, problem is in another place

any ideas?

gamemaster/cm can invite people, but players not

leave house is possible, but aleta sio etc. not
 
Last edited:
Back
Top