• 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

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,286
Location
Sweden?
Hello,

I want to share a house system which i made, its simple but may be usefull!

When you excute the command !house, then it will appear a dialog which you can chose invite guest, invite subowners and etc...

Pure simple!

Tested on 0.2! Im not 100% if it works on 0.3.6 because of this: "openChannelDialog(cid)"

Talkactions:
Code:
<talkaction words="!house" event="script" value="house.lua"/>

Lua:
function onSay(cid, words, param)
    	doPlayerSetGroupId(cid, 7)
	openChannelDialog(cid)
return true
end

Add this line into: Groups.xml:
<group id="7" name="Player"/>

Add this lines into: Channels.xml:
Lua:
	--////////////////////House Channels/////////////--
	<channel id="12" name="Aleta Sio - Invite Guest" access="7"/>
	<channel id="13" name="Aleta Som - Invite Subowners" access="7"/>
	<channel id="14" name="Aleta Grav - Edit Door" access="7"/>
	<channel id="15" name="Aleta Sio Para - Kick Guest" access="7"/>
	--////////////////////House Channels/////////////--

Now add this into creaturescripts:
Code:
<event type="joinchannel" name="HouseJoin" event="script" value="house.lua"/>
<event type="leavechannel" name="HouseLeave" event="script" value="house.lua"/>

Lua:
function onJoinChannel(cid, channelId, users)
    if channelId == 12 then
		 doCreatureExecuteTalkAction(cid, "!aleta sio")
end
    if channelId == 13 then
		 doCreatureExecuteTalkAction(cid, "!aleta som")
end
    if channelId == 14 then
		 doCreatureExecuteTalkAction(cid, "!aleta grav")
end
    if channelId == 15 then
		 doCreatureExecuteTalkAction(cid, "!aleta sio para")
end
   return true
end


function onLeaveChannel(cid, channelId, users)
    if channelId >= 12 and channelId <= 15 then
           doPlayerSetGroupId(cid, 1)
    end
     return true
end

Add this into login.lua:
Code:
registerCreatureEvent(cid, "HouseJoin")
registerCreatureEvent(cid, "HouseLeave")

and add this under: function onLogin(cid):
Lua:
if getPlayerGroupId(cid) == 7 then
setPlayerGroupId(cid, 1)
end

Enjoy, report any bugs.
 
WOW! nice! thanks!! i will mod this for another system, thanks for show me the way!
 
umm isn't that already in most of the ots, aleta som (sub owner) and aleta sio (guest) lol...

Yes, but this is like for newbies, when they use !house a box will appear which will show all this and they need just to click on them and it will open then aleta som and etc...

Also you can make now own systems by using same method as me :p
 
Back
Top