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

need special teleport script

lego

New Member
Joined
Mar 11, 2013
Messages
86
Reaction score
2
Location
Stockholm
hi there! :D

i need a special teleportation script that makes:

if a gm wants to go to the owner of the ot (god) with command /goto , the god has to grant access to the gm like "yes" or "no". when answering yes, the gm teleports to him right away. when answering no, the gm doesnt teleport at all and gets a text "Admin is busy right now".

the reason why i need this is because i need privacy on my ot.

thanks in advance! ^_^
 
Nice idea :p I found it very funny :p I got a little idea on how to make it.. Just I am not sure how I am going to make the Yes/No part :p... I will try to make it but don't keep your hopes up :p
 
An idea on how it could be done

you could have a storage value on the god that is for privacy.. then when you try teleporting check that storage value.. if its for example 1 the god is busy.. if its 0 they aren't busy and they teleport

and make another command similar to ghost.. except it will toggle the privacy for the god
 
Add at the top of 'talkactions.lua' (or wherever you want) the following:
XML:
<talkaction log="yes" access="5" words="/ownerStatus" event="script" value="ownerStatus.lua"/>

Then create a new file inside talkactions, called 'ownerStatus.lua' and pase there, the following code:
Lua:
ownerStatus = 1
function onSay(cid, words, param, channel)

	if (param == 'busy') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your status has been set as 'Busy'.")
		ownerStatus = 0
		return true
	elseif (param == 'free') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your status has been set as 'Free'.")
		ownerStatus = 1
		return true
	elseif (param == '') then
		if ownerStatus == 0 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Status: Busy")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Status: Free")
		end
		return true
	end

return true
end
...
Then inside talkactions find and open 'teleportto.lua' replace the inside with:
Lua:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local creature = getCreatureByName(param)
	local player = getPlayerByNameWildcard(param)
	local waypoint = getWaypointPosition(param)
	local tile = string.explode(param, ",")
	local pos = {x = 0, y = 0, z = 0}

	if(player ~= nil and (not isPlayerGhost(player) or getPlayerGhostAccess(player) <= getPlayerGhostAccess(cid))) then
		if getPlayerAccess(player) >= 5 and ownerStatus == 1 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The owner is free, teleporting...")
			pos = getCreaturePosition(player)
		elseif getPlayerAccess(player) >= 5 and ownerStatus == 0 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The owner is busy")
		
		else
			pos = getCreaturePosition(player)
		end
	elseif(creature ~= nil and (not isPlayer(creature) or (not isPlayerGhost(creature) or getPlayerGhostAccess(creature) <= getPlayerGhostAccess(cid)))) then
		pos = getCreaturePosition(creature)
	elseif(isInArray({'back', 'last'}, param:lower())) then
		pos = getCreatureLastPosition(cid)
	elseif(type(waypoint) == 'table' and waypoint.x ~= 0 and waypoint.y ~= 0) then
		pos = waypoint
	elseif(tile[2] and tile[3]) then
		pos = {x = tile[1], y = tile[2], z = tile[3]}
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
		return true
	end

	if(not pos or isInArray({pos.x, pos.y}, 0)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
		return true
	end

	pos = getClosestFreeTile(cid, pos, true, false)
	if(not pos or isInArray({pos.x, pos.y}, 0)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.")
		return true
	end

	local tmp = getCreaturePosition(cid)
	if(doTeleportThing(cid, pos, true) and not isPlayerGhost(cid)) then
		doSendMagicEffect(tmp, CONST_ME_POFF)
		doSendMagicEffect(pos, CONST_ME_TELEPORT)
	end

	return true
end


:) Reply if it works or if it doesn't so I can help you. It might not be the best script, but it works with me.
 
Back
Top