Teleport all players to temple (or pos x y z)

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Best answers
0
Reaction score
0
I need a talkaction to teleport all players in my ot to the temple, ou a pos x y z...

thx


ps:
I also need some help.
I wanna make an enforced with teams, but not with done chars
Like this, you create a char, and when loged in ot go to X team. With auto-balance (if Y team have 12 players and X 11, go to X, you understand :p )
 
Last edited:

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,876
Best answers
0
Reaction score
19
Location
Canada
Lua:
function onSay(cid, words, param, channel) 
local temple = { x = 993, y = 996, 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
 
OP
S

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Best answers
0
Reaction score
0
THx Very much

but now i need another something to this action

Make all players lost pz or if it is impossible, kick them after teleported
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,329
Best answers
33
Reaction score
832
Location
Arica - Chile
Lua:
function onSay(cid, words, param, channel)
local temple = { x = 993, y = 996, 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
 
OP
S

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Best answers
0
Reaction score
0
thanks a lot StreamSide
works perfectly

now i need more one thing, its possible to make players of group 6 (GODS) dont be teleported?
 

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
Lua:
  function onSay(cid, words, param, channel)
local temple = { x = 993, y = 996, z = 7 }  
        for _, cid in ipairs(getPlayersOnline()) do
		if getPlayerGroupID(cid) < 6 then	
                	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
        end
        return TRUE
end
 
OP
S

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Best answers
0
Reaction score
0
Mmm this last is not working :(
the following error happen:

[24/12/2009 21:51:52] Lua Script Error: [TalkAction Interface]
[24/12/2009 21:51:52] data/talkactions/scripts/alltemple.lua:eek:nSay

[24/12/2009 21:51:52] data/talkactions/scripts/alltemple.lua:4: attempt to call global 'getPlayerGroupID' (a nil value)
[24/12/2009 21:51:52] stack traceback:
[24/12/2009 21:51:52] data/talkactions/scripts/alltemple.lua:4: in function <data/talkactions/scripts/alltemple.lua:1>
 

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
852
Location
Caribbean Sea
well it hasnt happened 2 in a tile in my ots
 

Morineau

pig benis
Joined
Jul 19, 2009
Messages
15
Best answers
0
Reaction score
0
Can this script be done just for 3 players?
Example. /send Elf, John, Wally (townid)
 

anotapreta

New Member
Joined
Mar 12, 2010
Messages
104
Best answers
0
Reaction score
0
- Add talkactions/scripts/tpall.lua
Lua:
function onSay(cid, words, param, channel)
local config = {
          groupID = 6, -- Protect GroupID 1,2,3,4,5,6 = GOD
          carlin = { x = 32360, y = 31782, z = 7 },
          venore = { x = 32957, y = 32076, z = 7 },
          edron = { x = 33217, y = 31814, z = 8 }
          };
 
        for _, cid in ipairs(getPlayersOnline()) do 

if  (getPlayerGroupId(cid) == config.groupID) then
        if(param == '') then
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "HELP: Use !tpall x,y,z or !tpall carlin or !tpall venore or !tpall edron.")
        return TRUE
end

for _, cid in ipairs(getPlayersOnline()) do
if  (getPlayerGroupId(cid) < config.groupID) then
                    if(param == 'carlin') then
                        doTeleportThing(cid, config.carlin)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to carlin.")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)

                elseif(param == 'venore') then
                        doTeleportThing(cid, config.venore)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to venore.")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)

                elseif(param == 'edron') then
                        doTeleportThing(cid, config.edron)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to edron.")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)


                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_FIREWORK_YELLOW)
end
end
end
end
end
        return TRUE
end
- Add talkactions/talkactions.xml
Lua:
<talkaction log="yes" words="!tpall" access="5" event="script" value="tpall.lua"/>
:peace:
 
Last edited:

cykor119

New Member
Joined
Aug 8, 2010
Messages
149
Best answers
0
Reaction score
3
Code:
 Description:
attempt to index a nil value
stack traceback:
[C]: in function 'doTeleportThing'
data/talkactions/scripts/alltemple.lua:21: in function <data/talkactions/scripts/alltemple.lua:1>
We know what i can do?

@edit
OK forgot :D
Code:
doTeleportThing(cid, config.thais)
I don't change "cid, config.carlin" when i have save teleport to Thais... all working on dev 0.4 xd Thanks!
 
Last edited:
Top