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

[Command] Mass teleporting to temple.

Status
Not open for further replies.

Sherlok

Active Member
Joined
Aug 29, 2008
Messages
2,116
Reaction score
44
Location
Poland, Wrocław.
Hiho.
I need command script like /mkick x, x, but it must teleport players from x, x area to his temple position.

It possible to do it?
Thanks :thumbup::wub:
 
Of Course Sherlock It is Possible to do :) Rep++

No problem Bro!

Now seriously. Take this POLAND guy.

LUA:
function onSay(cid, words, param)
	if(param=="") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Param Syntax Error")
		return false;
	end;
	param = string.explode(param,",");
	if(#param < 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This Talkaction requies 2 params.")
		return false;
	end;
	param = string.explode(param,",");
	local fpos, tpos, bol = string.explode(param[1], ";"), string.explode(param[2], ";"), false;
	local player;
	for check=1, 3 do
		fpos[check] = tonumber(fpos[check]);
		if(not fpos[check]) then
			bol=true;
			break;
		end
	end
	if (not bol) then
		for check=1, 3 do
			tpos[check] = tonumber(tpos[check]);
			if(not fpos[check]) then
				bol=true;
				break;
			end
		end
	end
	if (bol) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong Coordinates.")
		return false;
	end
	
	for ax=tonumber(fpos[1]),tonumber(tpos[1]) do
		for ay=tonumber(fpos[2]),tonumber(tpos[2]) do
			for az=tonumber(fpos[3]),tonumber(tpos[3]) do
				player = getTopCreature({x=ax, y=ay, z=az}).uid
				if(isPlayer(player)) then
					doTeleportThing(player, getPlayerMasterPos(player));
				end
			end
		end
	end
	return false;
end

ah, talkaction syntax:
Code:
 /urkeyword 1000;1000;7,1200;1200;7
Tp Players from 1000x1000x7 - 1200x1200x7 to temple.
 
Last edited:
talkactions.xml:
Code:
    <talkaction log="yes" access="5" words="/tempel" event="script" value="tempeltp.lua"/>

tempeltp.lua
LUA:
  function onSay(cid, words, param, channel)
local temple = { x = 1000, y = 1000, z = 7 }  
        for _, cid in ipairs(getPlayersOnline()) do
                if(param == '') then
                        doTeleportThing(cid, temple)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to the temple.")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
                else
                local t = string.explode(param, ",")
                        doTeleportThing(cid, { x = t[1], y = t[2], z = t[3] }  )
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to the coords [X:"..t[1].."], [Y:"..t[2].."], [Z:"..t[3].."]")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
                end
        end
        return TRUE
end
 
Status
Not open for further replies.
Back
Top