Ray Rewind
Doctor
If a player buys a house on my Server he can't sell it with !leavehouse he needs to say "alana som" but when he is inside the house he stuck inside and don't get kicked out!
Also I want to make it work that if you say !leavehouse you can leave the house and not alana som.
Talkactions.xml
leavehouse.lua
Also the items keep stucking inside the house and alana sio doesn't work!
If you say !leavehouse it says A player with this name is not online
Also I want to make it work that if you say !leavehouse you can leave the house and not alana som.
Talkactions.xml
PHP:
<!-- Houses -->
<talkaction words="!buyhouse" filter="word-spaced" event="function" value="houseBuy"/>
<talkaction words="!leavehouse" 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"/>
leavehouse.lua
PHP:
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
Also the items keep stucking inside the house and alana sio doesn't work!
If you say !leavehouse it says A player with this name is not online