Requested By Exedion
First go to movements/movements.xml and add this line:
Now goto movements/scripts and create new lua and name it "checkpoint" and paste this code below:
Now goto movements/movements.xml and paste this line below:
Now goto movements/scripts and create new lua and name it "opencheckpointdialog" and paste this code below:
Now goto xml/channels.xml and post this lines below:
Also on all other channels paste access 1, so we dont need to see them when we view the checkpoint dialog, Ex:
Now go to xml/groups.xml. We have to add access so Example trade wont appear or other channels. But we cant prevent when its back group 1, those channels comming up. But they cant use them, since they need the storage.
Now change your player at xml/groups.xml and make sure it has access 1
Now go to creaturescripts/creaturescripts.xml
Now goto creaturescripts/scripts and create new lua and name it "checkpointsystem" and paste the script below:
Now goto creaturescripts/scripts/login.lua and paste this code below
Enjoy, ive already tested the channels and they work. Im not sure about the tiles, but try them out and report any bugs.
Maybe its not easy to configure the channels, thats why i made two caves so you get the idea how everything works to add more.
The problem is those channels will come, so make sure every channels has higher id than the normal channels to atleast prevent other channels when we enter the checkpoint dialog.
First go to movements/movements.xml and add this line:
Code:
<movevent type="StepIn" actionid="100" event="script" value="checkpoint.lua"/>
Now goto movements/scripts and create new lua and name it "checkpoint" and paste this code below:
Lua:
local otswe = {
storage_on_enter_tile = 1000,
first_time_enter_tile = "CHECKPOINT!",
already_enter_the_tile = "Sorry, but you already entered this checkpoint tile."
}
function onStepIn(cid, item, position, fromPosition)
if not(isPlayer(cid)) then return true end
if getPlayerStorageValue(cid, otswe.storage_on_enter_tile) == -1 then
setPlayerStorageValue(cid, otswe.storage_on_enter_tile, 1)
doCreatureSay(cid, otswe.first_time_enter_tile, TALKTYPE_MONSTER)
else
doPlayerSendTextMessage(cid,20, otswe.already_enter_the_tile)
end
end
Now goto movements/movements.xml and paste this line below:
Code:
<movevent type="StepIn" actionid="1001" event="script" value="opencheckpointsdialog.lua"/>
<movevent type="StepOut" actionid="1001" event="script" value="opencheckpointsdialog.lua"/>
Now goto movements/scripts and create new lua and name it "opencheckpointdialog" and paste this code below:
Lua:
local message = "Here can you chose your latest check points"
local open_storage = 5555 -- make sure use a empty storage
function dialog(cid)
if isPlayer(cid) then
openChannelDialog(cid)
end
end
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) then
doPlayerPopupFYI(cid, message)
addEvent(dialog, 1*1, cid)
setPlayerGroupId(cid, 7)
setPlayerStorageValue(cid, open_storage, 1)
end
end
function onStepOut(cid, item, position, fromPosition)
if isPlayer(cid) then
setPlayerGroupId(cid, 1)
setPlayerStorageValue(cid, open_storage, -1)
end
end
Now goto xml/channels.xml and post this lines below:
Code:
--////////////////////Dungeons Channels/////////////--
<channel id="20" name="Dark Dungeon" access="0"/>
<channel id="21" name="Spooky House" access="0"/>
--////////////////////Dungeons Channels/////////////--
Also on all other channels paste access 1, so we dont need to see them when we view the checkpoint dialog, Ex:
Code:
<channel id="6" name="Trade" level="8" muted="120" access="1" conditionId="2" conditionMessage="You may only place one offer in two minutes."/>
Now go to xml/groups.xml. We have to add access so Example trade wont appear or other channels. But we cant prevent when its back group 1, those channels comming up. But they cant use them, since they need the storage.
Code:
<group id="7" access="0" name="Player"/>
Now change your player at xml/groups.xml and make sure it has access 1
Code:
<group id="1" access="1" name="Player"/>
Now go to creaturescripts/creaturescripts.xml
Code:
<event type="joinchannel" name="CheckJoin" event="script" value="checkpointsystem.lua"/>
<event type="leavechannel" name="CheckLeave" event="script" value="checkpointsystem.lua"/>
Now goto creaturescripts/scripts and create new lua and name it "checkpointsystem" and paste the script below:
Lua:
local otswe = {
cave1 = {
[1000] = {pos1 = { x = 1000, y = 1000, z = 7 , stackpos = 1 }}, --The first box is the storage to get teleported to the first check point.
[1001] = {pos2 = { x = 1000, y = 1000, z = 6 , stackpos = 1 }}, --Higher the storage is, then you will get teleported to that checkpoint.
},
cave2 = {
[1002] = {pos1 = { x = 1005, y = 1005, z = 7 , stackpos = 1 }},
[1003] = {pos2 = { x = 1000, y = 1000, z = 6 , stackpos = 1 }}
}
}
function onJoinChannel(cid, channelId, users)
if getPlayerStorageValue(cid, 5555) == -1 then
doPlayerSendTextMessage(cid,20, "Sorry, but you are at the wrong place to use any of these check points.")
return false
end
if channelId == 20 then
if getPlayerStorageValue(cid, otswe.cave1[1000]) == 1 then
doTeleportThing(cid, otswe.cave1[1000].pos1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
if getPlayerStorageValue(cid, otswe.cave1[1001]) == 1 then
doTeleportThing(cid, otswe.cave1[1001].pos2)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
else
doPlayerSendTextMessage(cid,20, "You dont have any check points in this place.")
openChannelDialog(cid)
end
return false
end
if channelId == 21 then
if getPlayerStorageValue(cid, otswe.cave2[1002]) == 1 then
doTeleportThing(cid, otswe.cave2[1002].pos1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
if getPlayerStorageValue(cid, otswe.cave2[1003]) == 1 then
doTeleportThing(cid, otswe.cave2[1003].pos2)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
else
doPlayerSendTextMessage(cid,20, "You dont have any check points in this place.")
openChannelDialog(cid)
end
return false
end
end
function onLeaveChannel(cid, channelId, users)
if channelId >= 20 and channelId <= 21 then
doPlayerSetGroupId(cid, 1)
end
return true
end
Now goto creaturescripts/scripts/login.lua and paste this code below
function onLogin(cid):
Lua:
if getPlayerGroupId(cid) == 7 then
setPlayerGroupId(cid, 1)
end
if getPlayerStorageValue(cid, 5555) == 1 then
setPlayerStorageValue(cid, 5555) == -1
end
Enjoy, ive already tested the channels and they work. Im not sure about the tiles, but try them out and report any bugs.
Maybe its not easy to configure the channels, thats why i made two caves so you get the idea how everything works to add more.
The problem is those channels will come, so make sure every channels has higher id than the normal channels to atleast prevent other channels when we enter the checkpoint dialog.
Last edited: