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

House system

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,768
Solutions
5
Reaction score
769
Hello,
I want a system that when u press on X item u own a house. for ex.
I have 8 big houses, no one can buy them only who got the X item, when u got the X item, u right click it and u get one of the 8houses and it says, Congratulation, Now you own Big House #1. the the rune dissapers. if another one got this item and right click it he get house #2 cuz 1 is no more there. and when all houses r gone, and someone got the X item and press it, it says: Sorry, There are no more big houses PLEASE CONTACT THE ADMIN.

rep++
 
17:58 Congratulations! You've won big house 3 which is located in 9

wtf?

doPlayerSendTextMessage(cid, 21, "Congratulations! You've won "..getHouseName(house).." which is located in X Town.")

that would work right?
 
well try
Lua:
		doPlayerSendTextMessage(cid, 21, "Congratulations! You've won "..getHouseName(house).." which is located in "..getTownName(getHouseTown(house)).." town.")
 
LOL
i tried it with 2 chars and both won the same house?
it should be like, firts win house 1, sec house 2 etc

i tried with my char
18:02 Congratulations! You've won Donation house 3 which is located in Donation Town.
and other acc other char
18:02 Congratulations! You've won Donation house 3 which is located in Donation Town.
 
a = {
[-1] = {x="682", y="1356", z="4"},
[0] = {x="682", y="1371", z="4"},
[1] = {x="666", y="1358", z="4"},
[2] = {x="666", y="1371", z="4"},
[3] = {x="698", y="1358", z="4"},
[4] = {x="698", y="1371", z="4"},
[5] = {x="714", y="1359", z="4"},
[6] = {x="714", y="1371", z="4"}
},
s = 1002
}
? all diff
 
i know but maybe one of these tiles is in the same house
Lua:
 local t = {
	a = {
		[-1] = {x="x", y="y", z="z"},
		[0] = {x="x", y="y", z="z"},
		[1] = {x="x", y="y", z="z"},
		[2] = {x="x", y="y", z="z"},
		[3] = {x="x", y="y", z="z"},
		[4] = {x="x", y="y", z="z"},
		[5] = {x="x", y="y", z="z"},
		[6] = {x="x", y="y", z="z"}
	},
	s = 1002
}
function onUse(cid, item, fromPositio, itemEx, toPosition)

	if getStorage(t.s) >= #t.a then
		doPlayerSendTextMessage(cid, 21, "Sorry, There are no more big houses PLEASE CONTACT THE ADMIN.")
	else
		local house = getHouseFromPos(t.a[getStorage(t.s)])
		doPlayerSendTextMessage(cid, 21, "Congratulations! You've won "..getHouseName(house).." which is located in "..getTownName(getHouseTown(house)).." town.")
		setHouseOwner(house, getPlayerGUIDByName(getCreatureName(cid)))
		doSetStorage(t.s, getStorage(t.s)+1)
	end
	
return true
end
 
Cool

18:17 Congratulations! Now you own Donation house 3 which is located in Donation Castles town.
18:17 Congratulations! Now you own Donation house 6 which is located in Donation Castles town.
but
the same account can buy more than 1, can u make it so 1 for an account?
+ if someone leaves his house, then i press the X item, it says no more house, can u make it so when someone leavehouse and u press he get the empty house?

Lua:
local t = {
	a = {
		[-1] = {x="682", y="1356", z="4"},
		[0] = {x="682", y="1371", z="4"},
		[1] = {x="666", y="1358", z="4"},
		[2] = {x="666", y="1371", z="4"},
		[3] = {x="698", y="1358", z="4"},
		[4] = {x="698", y="1371", z="4"},
		[5] = {x="714", y="1359", z="4"},
		[6] = {x="714", y="1371", z="4"}
	},
	s = 1002
}
function onUse(cid, item, fromPositio, itemEx, toPosition)

	if getStorage(t.s) >= #t.a then

		doPlayerSendTextMessage(cid, 21, "Sorry, There are no more Donation houses PLEASE CONTACT THE ADMIN.")
 	doRemoveItem(item.uid, 0)
	else
		local house = getHouseFromPos(t.a[getStorage(t.s)])
		doPlayerSendTextMessage(cid, 21, "Congratulations! Now you own "..getHouseName(house).." which is located in "..getTownName(getHouseTown(house)).." town.")
 	doRemoveItem(item.uid, 1)
		setHouseOwner(house, getPlayerGUIDByName(getCreatureName(cid)))
		doSetStorage(t.s, getStorage(t.s)+1)
	end
 
return true
end
 
Last edited:
Look
if i own a house, i cant win this house, it says, You already own a house. After i Leave my house, I can win it
Then if i have another char in the same account, i cant win another house or the same character, he cant win another house.
and if all houses are rented it says NO more houses contact the ADMIN.
if someone leaved his house and someone pressed the item he get that empty house
 
Look
if i own a house, i cant win this house, it says, You already own a house. After i Leave my house, I can win it
Then if i have another char in the same account, i cant win another house or the same character, he cant win another house.
and if all houses are rented it says NO more houses contact the ADMIN.
if someone leaved his house and someone pressed the item he get that empty house

So, you want players to be able to win the house, if a donator leaves it? I don't understand.
 
Its not a win system, it should be, where you can own a house not win one...
and no one can buy this house if he say !buyhouse infront of the door. only who have the X items get that house!
 
I HIGHLY doubt this script will work, but meh.
Lua:
local t = {
	a = {
		[0] = {x="x", y="y", z="z"},
		[1] = {x="x", y="y", z="z"},
		[2] = {x="x", y="y", z="z"},
		[3] = {x="x", y="y", z="z"},
		[4] = {x="x", y="y", z="z"},
		[5] = {x="x", y="y", z="z"},
		[6] = {x="x", y="y", z="z"},
		[7] = {x="x", y="y", z="z"}
	},
	i = 0,
	m = 7 --max houses
}
function getEmptyHouses()
if getHouseOwner(t.a[t.i]) ~= 'nobody' then
	t.i = t.i+1
end
end
function doPlayerGiveEmptyHouse(cid)
	doPlayerSendTextMessage(cid, 21, "Congratulations! You've won "..getHouseName(getHouseFromPos(t.a[t.i])).." which is located in "..getTownName(getHouseTown(getHouseFromPos(t.a[t.i]))))
	setHouseOwner(getHouseFromPos(t.a[t.i]), getPlayerGUIDByName(getCreatureName(cid)))
t.i = 0
end
function onUse(cid, item, fromPositio, itemEx, toPosition)
repeat
	getEmptyHouses()
until getHouseOwner(t.a[t.i]) == 'nobody' or t.i > t.m
if getHouseOwner(t.a[t.i]) == 'nobody' then
	addEvent(doPlayerGiveEmptyHouse, 0)
	elseif t.i > t.m then
		doPlayerSendTextMessage(cid, 21, "Sorry, There are no more big houses PLEASE CONTACT THE ADMIN.")
end
return TRUE
end
 
Last edited:
[Error - Action Interface]
data/actions/scripts/AOD/donhouse.lua:eek:nUse
Description:
data/lib/function.lua:373: attempt to index a boolean value
stack traceback:
data/lib/function.lua:373: in function 'getHouseOwner'
data/actions/scripts/AOD/donhouse.lua:16: in function 'getEmptyHouses'
data/actions/scripts/AOD/donhouse.lua:27: in function <data/actions/scripts/AOD/donhouse.lua:25>
 
Back
Top