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

Teleport System

KylerXX

Active Member
Joined
Jun 24, 2010
Messages
439
Reaction score
30
Explicación:
The player must be on a unique position (in this script you can define multiple unique positions). To find the places, say /tp info, which is given a command to use the system correctly.
Info text:
*If you want to use this service you must remember that you must be a premium, then (below) shows what you have said in the unique position to go to different areas:
/tp hydra -- Cost : 5000
/tp demon -- Cost : 6000
/tp pirate -- Cost : 4000
-------------
When the player is going to say for example /tp hydra and is in a unique position, is premmium account, have the required level and have enough money, he will be teleported to the position you have chosen for each zone in the table (DESTs, it is easy to set up).
Script TalkAction
Lua:
local DESTs = {
[1] = {huntname = "hydra", pos = {x = 95, y = 118, z = 7}, cost = 5000, level = 20},
[2] = {huntname = "demon", pos = {x = 453, y = 1033, z = 7}, cost = 6000, level = 20},
[3] = {huntname = "pirate", pos = {x = 654, y = 1112, z = 7}, cost = 4000, level = 20}
}
local poss = {{x = 160, y = 389, z = 7}, {x = 95, y = 1000, z = 7}, {x = 500, y = 119, z = 7}} -- Posiciones principales(sagradas) desde donde el player sera teletransportado
local parame = "" -- No tocar
function onSay(cid, words, param)
	local posx = getPlayerPosition(cid).x
	local posy = getPlayerPosition(cid).y
	 if param == 'info' then
		local texto = "*If you want to use this service you must remember that you must be a premium, then (below) shows what you have said in the unique position to go to different areas:"
		for i = 1, #DESTs do
			texto = texto .. "\n/tp ".. DESTs[i].huntname .." -- Cost : ".. DESTs[i].cost
		end 
		addEvent(doShowTextDialog, 2000, cid, 7704, texto)
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		return true
        end
	        for x = 1, #DESTs do
		     if DESTs[x].huntname == param then
			    parame = DESTs[x]
			    break
		      end
	        end
		if(param ~= parame.huntname) then
			doPlayerSendCancel(cid, "Invalid destination.")
			return true
		else
		  local k = 0
		  for i = 1, #poss do
			 if posx == poss[i].x and posy == poss[i].y then
				k = 1
			 end
		  end
		  if k < 1 then
			 k = 0
			 doPlayerSendCancel(cid, "Dou you need to go to an unique position!")
			 return true
		  end
		 if getCreatureCondition(cid, CONDITION_INFIGHT) == true then
		     return doPlayerSendCancel(cid, "You can use in PZ condition.")
		  end
		  if not isPremium(cid) then
			 return doPlayerSendCancel(cid, "Do you need premmium account to continue.")
		  end
		  if getPlayerLevel(cid) < parame.level then
			 return doPlayerSendCancel(cid, "Do you need level ".. parame.level .." or higher.")
		  end
		  if doPlayerRemoveMoney(cid, parame.cost) then
			 doTeleportThing(cid, parame.pos)
			 doPlayerSendTextMessage(cid, 22, 'You have arrived!')
			 doSendMagicEffect(parame.pos, CONST_ME_TELEPORT)
		  else
			  doPlayerSendCancel(cid, "You do not have enough money.")
		  end   
		end
   return true
end

talkactions.xml
XML:
<talkaction words="!tp;/tp" event="script" value="tp.lua"/>


Hope you like this code!
PD: I have tested on OTX 2.1 [8.60]
 
Last edited:
Back
Top