• 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 resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Teleport All to temple :D have fun

issaim

New Member
Joined
Jul 5, 2010
Messages
101
Reaction score
2
Go to Data/talkaction/scripts:tpall.lua

function onSay(cid, words, param, channel)
local temple = { x = 1000, y = 1000, z = 7 }
for _, cid in ipairs(getPlayersOnline()) do
doTeleportThing(cid, temple)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to the temple.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
end
return TRUE
end

no Go to Data/talkaction.xml

<talkaction log="yes" words="/tpall" access="script" event="script" value="tpall.lua"/>

have fun Rep me ++ ty :)
 
Piece of cake for a server with only one town.
But for servers with more town it should be:
Lua:
doTeleportThing(cid, getPlayerTown(cid))
So everyone gets to their temples.
Also I recommend you use tabbing to make the scripts cleaner. Good luck with more scripts ^_^
 
but its ausome :p i used it alot :p

Lol 27 views no comments or rep LOl
 
Last edited by a moderator:
Lua:
function onSay(cid, words, param, channel)
	local temple = getPlayerTown(cid)
	for _, cid in ipairs(getPlayersOnline()) do
		doTeleportThing(cid, temple)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to the temple.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
	end
return TRUE
end

@edit
You updated your main post with my edit, awesome ^.^
 
Last edited:
:D ok

at least i just need comments :D i feel happy when i receive a comment :p
 
Last edited by a moderator:
use the goddam edit button instead of making multiple posts
 
Thought of upgrading your script and I came out with something like this:

Lua:
local function doTeleportThingToCid(cid, thing)
	return isPlayer(thing) and doTeleportThing(thing, getPlayerPosition(cid)) or true
end
	
function onSay(cid, words, param) 
	for k, v in pairs(getPlayersOnline()) do
		time = 0
		for i = 1, 10 do
			addEvent(doPlayerSendTextMessage, time + 1000, v, MESSAGE_STATUS_CONSOLE_BLUE, getPlayerName(cid) .. " has requested everyone to attend the meeting. You have " .. 11 - i .. " seconds left until you're teleported.")
			time = time + 1000
		end
		addEvent(doTeleportThingToCid, 1000 * 10, cid, v)
		addEvent(doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
	end
	doBroadcastMessage(getPlayerName(cid) .. " has requested everyone to attend the meeting for a reason" .. (param and (": " and tostring(param) and ".") or "."), MESSAGE_STATUS_WARNING)
	return true
end

It'll teleport all players to the player who uses this, if he wants to share a reason he can state it in param.
 
Back
Top