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

TalkAction [Admin] Create teleporter

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,152
Solutions
12
Reaction score
1,107
Location
Germany :O
Hi
Well this script is nothing special, but I think it can be useful.

Description:
Look on the tile where you want to create a teleporter and say /addtp then go and look on the tile where it should lead to and say /addtp again. Now there will be a teleport on the first tile which leads to the second.
This is useful if you want to add a shortcut or found a teleporter which is not working or if you forgot to add a teleporter before the restart and don't want to restart again.
Note: If you made a mistake with the first position just say /addtp clear and then you can choose a new position.
Script:
data/talkactions/talkactions.xml:
Code:
	<talkaction log="yes" words="/addtp" access="5" event="script" value="addtp.lua"/>

data/talkactions/scripts/addtp.lua:
Lua:
function comparePosition(pos1, pos2)
	return (pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z) and true or false
end 

local position = false
function onSay(cid, words, param, channel)
	local pos,c = getCreatureLookPosition(cid),position
	if param == "clear" then
		position = false
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Clear.")
	end
	if not(position) or not(comparePosition(position,pos)) then
		if position == false then
			position = pos
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("The teleporter's position was set. [X: %i, Y: %i, Z: %i]",pos.x, pos.y, pos.z)) and doSendMagicEffect(pos, 14)
		end
		position = false
		return  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("The teleporter was set up. From:[X: %i, Y: %i, Z: %i] To:[X: %i, Y: %i, Z: %i]",c.x, c.y, c.z, pos.x, pos.y, pos.z)) and doSendMagicEffect(pos, 14) and doCreateTeleport(1387, pos, c)
	end
	return	doPlayerSendCancel(cid,"The teleport position can't be the position where the teleporter is.")
end
 
OMFG! all i ever wanted !!!!!!!
REPPPPP++

- first ill se if this work! 0.3.6 !


WORKS AWESOME!

thanks maN!
 
Thanks for the comments :)
 
Yes this is good for events :) with this script you can get more then lots of ideas for game play ideas.
 
hey, i cant seem to get this to work.

I see this error returned in the server log:

Untitled-1.jpg

any thoughts?
 
Back
Top