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
<talkaction log="yes" words="/tpall" access="script" event="script" value="teleportall.lua"/>
Goto Talkations/scripts and create a filename called "teleportall.lua"
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
Lua:<talkaction log="yes" words="/tpall" access="script" event="script" value="teleportall.lua"/>
This
ReplaceLua:local temple = getPlayerTown(cid)
Lua:local temple = getTownTemplePosition(getPlayerTown(cid))
doRemoveCondition(cid, CONDITION_INFIGHT)
that should be a problem with the map, did you set those temples as different citys?
if you did, then you have to set town to those players.
if you give me some details about how do they get into a team (how do they choose)
i can give you some code to set the town.
glad i could help
then you should do this,
in /data/creatuscript/scripts/login.lua
just below the function on login ()
local asd = getAccountNumberByPlayerName(getPlayerName(cid))
if asd = 1 then
doPlayerSetTown(cid, 1)
elseif asd = 2 then
doPlayerSetTown(cid, 2)
end
i think thats all
local asd = getAccountNumberByPlayerName(getPlayerName(cid))
if asd == 1 then
doPlayerSetTown(cid, 1)
elseif asd == 2 then
doPlayerSetTown(cid, 2)
end
like this not in the first one!!!
weird, all that should be working,
the script send players to their temples.
the one i gave you sets the town id to each band.
so there may be 2 thing that are wrong
first: check if in the map editor the temples are set as different towns with the right coordinates.
second: check if the script i gave you its working, that can be made like this:
add this line to login.lua
local twn = getPlayerTown(cid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,twn)
log in into a player of band 1 and see what the msg is
then
log in into a player of band 2 and see what the msg is
if the band 1 gets a msg 1 then its ok
if the band 2 gets a msg 2 then its ok
if not!
then by some reason they have no town set yet! and thats what you should work on!
well i checked the map, and there was just one town...and then i created the other one with the other temple, but the problem is still hapenning...i use /tpall and players from acc 1/1 and 2/2 are sended to the same temple, in case temple of acc 2/2...
they get into a team using acc 1/1 or 2/2...it is players choice!