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:
Add this line into: Groups.xml:
Add this lines into: Channels.xml:
Now add this into creaturescripts:
Add this into login.lua:
and add this under: function onLogin(cid):
Enjoy, report any bugs.
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.