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

Lua House Commands Not Working

XxShallowxX

ಠ_ಠ
Joined
Dec 3, 2010
Messages
607
Reaction score
27
Location
USA
Why are my house commands not working?
I try and say "Aleta Sio" or "!buyhouse" or any house command and nothing happens :(
 
Script them in lua..? <,<
for example..

leavehouse.lua
LUA:
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
 
Script them in lua..? <,<
for example..

leavehouse.lua
LUA:
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

Can someone do this? o.0
 
fix

try this
Code:
local config = {
	teleportAccess = 3
}

function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local teleport = false
	local t = string.explode(param, ",")
	if(t[2]) then
		teleport = getBooleanFromString(t[2])
		param = t[1]
	end

	local house = getHouseByPlayerGUID(getPlayerGUIDByName(param))
	if(not house) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " does not own house or doesn't exists.")
		return true
	end

	local houseInfo = getHouseInfo(house)
	if(teleport and getPlayerAccess(cid) >= config.teleportAccess) then
		doTeleportThing(cid, houseInfo.entry)
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " owns house: " .. houseInfo.name .. ".")
	return true
end
 
try this
Code:
local config = {
	teleportAccess = 3
}

function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local teleport = false
	local t = string.explode(param, ",")
	if(t[2]) then
		teleport = getBooleanFromString(t[2])
		param = t[1]
	end

	local house = getHouseByPlayerGUID(getPlayerGUIDByName(param))
	if(not house) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " does not own house or doesn't exists.")
		return true
	end

	local houseInfo = getHouseInfo(house)
	if(teleport and getPlayerAccess(cid) >= config.teleportAccess) then
		doTeleportThing(cid, houseInfo.entry)
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " owns house: " .. houseInfo.name .. ".")
	return true
end

That's the command to get said player's house information.. the !gethouse command.. read the script. <,<
 
Code:
[14/12/2010 22:15:20] >> Checking software version... failed - could not parse remote file (are you connected to the internet?)
Code:
[14/12/2010 22:15:34] Warning: [CallBack::loadCallBack] Event onGetFormulaValues not found
.
Code:
[14/12/2010 22:15:34] [Warning - InstantSpell::loadFunction] Function "editHouseGuest" does not exist.
[14/12/2010 22:15:34] [Warning - InstantSpell::loadFunction] Function "editHouseSubOwner" does not exist.
[14/12/2010 22:15:34] [Warning - InstantSpell::loadFunction] Function "editHouseDoor" does not exist.
[14/12/2010 22:15:34] [Warning - InstantSpell::loadFunction] Function "houseKick" does not exist.
 

Similar threads

Back
Top