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

Solved !sellhouse

Status
Not open for further replies.
Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Hello!

Anybody knows why !sellhouse doesn't work?

When I type "!sellhouse" it says "A player with this name is not online." but then when I type "!sellhouse <name>" and nothing happens. I tried with quote marks and everything :p

thanks
 
Last edited:
Or add this, talkactions.xml
HTML:
	<!-- Houses -->
	<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"/>

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

In lib/functions add or replace this:
Lua:
function getHouseOwner(houseId)
	return getHouseInfo(houseId).owner
end

function getHouseName(houseId)
	return getHouseInfo(houseId).name
end

function getHouseEntry(houseId)
	return getHouseInfo(houseId).entry
end

function getHouseRent(houseId)
	return getHouseInfo(houseId).rent
end

function getHousePrice(houseId)
	return getHouseInfo(houseId).price
end

function getHouseTown(houseId)
	return getHouseInfo(houseId).town
end

function getHouseTilesCount(houseId)
	return getHouseInfo(houseId).tiles
end
 
Status
Not open for further replies.
Back
Top