SI
pedido

Teleportar Todos Para Posição Do God Que Der O Comando

Por sickk, 01 de set. de 2012 em Scripts

script
8
1.4k
sickkS
01 de setembro de 2012 às 23:59

Olá,

Gostaria de um script que teleporte todos os players online para a localização de onde o GOD que digitou o comando estiver.

SkymagnumS
02 de setembro de 2012 às 00:18

function onSay(cid, words, param)

  for _, pid in ipairs(getPlayersOnline()) do
       doTeleportThing(pid, getPlayerPosition(cid)) 
          end 
 return true
end

 

 

teleportar para posiçao desejada

 

function onSay(cid, words, param)
local t = string.explode(param, ",")
      local pos = {x = tonumber(t[1]), y = tonumber(t[2]), z = tonumber(t[3])}
              if not tonumber(t[1]) or not tonumber(t[2]) or not tonumber(t[3]) then
  doPlayerSendTextMessage(cid, 28, "usase assim, !comando posição x, posição y, posição z.") return true
          end
                for _, pid in ipairs(getPlayersOnline()) do
           doTeleportThing(pid, pos)
                 end
      return true
end

 

usase assim

 

!comando posição x, posição y, posição z

 

@EDIT!

 

colocar identação

Editado Setembro 2 por Skymagnum

notle2012N
02 de setembro de 2012 às 00:23

teleportar para para templo

data\talkactions\scripts\nomedoarquivo.lua

function onSay(cid, words, param)
local players = getPlayersOnline()
local pos = {x=160, y=54, z=7} -- posição do templo
for i=1, #players do
	doTeleportThing(players[i], pos)
end
return true
end

data\talkactions\talkactions.xml

adiciona isso

<talkaction log="yes" words="/cmd" access="5" event="script" value="nomedoarquivo.lua"/>

 

Todos Para Posição Do God

 

function onSay(cid, words, param)
local players = getPlayersOnline()
for i=1, #players do
doTeleportThing(players[i], getPlayerPosition(cid))
end
return true
end

Editado Setembro 2 por notle2012

sickkS
02 de setembro de 2012 às 00:56

Skymagnum e notle2012 muito obrigado a vocês dois !! :)

Testei aqui e notei que está teleportando o account manager também... Não teria como teleportar todos menos o account manager?

Grato.

SkymagnumS
02 de setembro de 2012 às 01:01
function onSay(cid, words, param)
local t = string.explode(param, ",")
      local pos = {x = tonumber(t[1]), y = tonumber(t[2]), z = tonumber(t[3])}
              if not tonumber(t[1]) or not tonumber(t[2]) or not tonumber(t[3]) then
  doPlayerSendTextMessage(cid, 28, "usase assim, !comando posição x, posição y, posição z.") return true
          end
               if getCreatureName(pid) == "Account Manager" then return false end
                for _, pid in ipairs(getPlayersOnline()) do
           doTeleportThing(pid, pos)
                 end
      return true
end

sickkS
02 de setembro de 2012 às 01:12

Skymagnum, testei aqui e ta teleportando o Account Manager ainda wacko.png

SkymagnumS
02 de setembro de 2012 às 01:15

function onSay(cid, words, param)
local t = string.explode(param, ",")
      local pos = {x = tonumber(t[1]), y = tonumber(t[2]), z = tonumber(t[3])}
              if not tonumber(t[1]) or not tonumber(t[2]) or not tonumber(t[3]) then
  doPlayerSendTextMessage(cid, 28, "usase assim, !comando posição x, posição y, posição z.") return true
          end
                for _, pid in ipairs(getPlayersOnline()) do
                 if getCreatureName(pid) ~= "Account Manager" then
           doTeleportThing(pid, pos)
                   end
                 end
      return true
end

 

hm testa ai

sickkS
02 de setembro de 2012 às 01:26

function onSay(cid, words, param)
local t = string.explode(param, ",")
   local pos = {x = tonumber(t[1]), y = tonumber(t[2]), z = tonumber(t[3])}
		   if not tonumber(t[1]) or not tonumber(t[2]) or not tonumber(t[3]) then
  doPlayerSendTextMessage(cid, 28, "usase assim, !comando posição x, posição y, posição z.") return true
	   end
			 for _, pid in ipairs(getPlayersOnline()) do
			  if getCreatureName(pid) ~= "Account Manager" then
		doTeleportThing(pid, pos)
				end
			  end
   return true
end

 

hm testa ai

Aee, esse funcionou certinho :)

Valeu cara! Reputado.