Hello. Once again I was bored and I wrote a nob script. With this script you can specify map marks and gamemasters can teleport there by specifying the mark's name.
First add this file on talkactions/scripts folder:
marks.lua
Then in talkactions.xml add this:
talkactions.xml
Do not forget to edit these:
In case you wish to add more marks then simply do this:
Add a comma (,) at the end of this line:
and after it add:
If you have any further question do not hesitate to post.
First add this file on talkactions/scripts folder:
marks.lua
Lua:
-- KuGaSh1rA's Mark Teleportation Script --
local marks =
{
{ "temple", {x = 1000, y = 1000, z = 7}, "City Temple" },
{ "depot", {x = 1000, y = 1000, z = 7}, "City Depot" }
}
local accessToUse = 3
function onSay(cid, words, param, channel)
if param == "" then
warnPlayer(cid, "Command requires a parameter.")
return TRUE
end
if getPlayerAccess(cid) >= accessToUse then
param = param:lower()
tmp = getPlayerPosition(cid)
for _, m in ipairs(marks) do
if(m[1] == param) then
doSendMagicEffect(tmp, CONST_ME_POFF)
doTeleportThing(cid, m[2])
doSendMagicEffect(m[2], CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, 25, "You have been teleporter to the " ..m[3]..".")
else
warnPlayer(cid, "Teleportation mark does not exist.")
end
end
else
warnPlayer(cid, "You cannot execute this command.")
end
return TRUE
end
function warnPlayer(cid, message)
doPlayerSendCancel(cid, message)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
talkactions.xml
HTML:
<talkaction log="yes" access="3" words="/marktp" event="script" value="marks.lua"/>
Do not forget to edit these:
Lua:
local marks =
{
{ "temple", {x = 1000, y = 1000, z = 7}, "City Temple" },
{ "depot", {x = 1000, y = 1000, z = 7}, "City Depot" }
}
In case you wish to add more marks then simply do this:
Add a comma (,) at the end of this line:
Lua:
{ "depot", {x = 1000, y = 1000, z = 7}, "City Depot" }
and after it add:
Lua:
{ "markname", {x = 1000, y = 1000, z = 7}, "fullplacenamehere" }
If you have any further question do not hesitate to post.
Last edited: