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

New Cool Idea

ChiSka

Avera.Sytes.Net
Joined
Jul 15, 2009
Messages
865
Reaction score
17
My Idea

i need script to players when they say
/t thais
they goto thais temple
/t ankrahmun
they goto ankrahmun temple

But They shouldn't have pz
 
"new" lol!?!!??! that script already comes in some distributions, /town TOWNAME.
although it's only made for GM's+, just add something that checks PZ and change the access.
 
Town teleport command not edited. Only gms can use it but im sure you can edit it to what oyu want.


Lua:
	<talkaction log="no" words="/town" access="1" event="script" value="TownTeleporter.lua"/>

Lua:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return TRUE
end
local tid = cid
local t = string.explode(param, ",")
if(t[2]) then
tid = getPlayerByNameWildcard(t[2])
if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
return TRUE
end
end
local tmp = t[1]
if(not tonumber(tmp)) then
tmp = getTownId(tmp)
if(not tmp) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Town " .. t[1] .. " does not exists.")
return TRUE
end
end
local pos = getTownTemplePosition(tmp, false)
if(not pos or isInArray({pos.x, pos.y}, 0)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Town " .. t[1] .. " does not exists or has invalid temple position.")
return TRUE
end
pos = getClosestFreeTile(tid, pos)
if(not pos or isInArray({pos.x, pos.y}, 0)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
return TRUE
end
tmp = getCreaturePosition(tid)
if(doTeleportThing(tid, pos, TRUE) and not isPlayerGhost(tid)) then
doSendMagicEffect(tmp, CONST_ME_POFF)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
end
return TRUE
end
 
Back
Top