Ir para conteúdo
  • 0

mudar mapa sem tomar mass kick


tiuguedor

Pergunta

tenho ese script aki que ponha os time em x position nao sei se e aki que arruma isto que to querendo por favor ve ai e me falem ou arrumem um otro script plz vlw

/spoiler --[[

Storages:

global:

15000 = ID do mapa

15001 = tempo do mapa para !online

18888 = placar do time vermelho

18889 = placar do time verde

17778 = bandeira roubada pelo time verde

17779 = bandeira roubada pelo time vermelho

 

-----------------------------------------------------------

 

player:

12000 = Marca o time do player

17778 = bandeira roubada pelo time verde

17779 = bandeira roubada pelo time vermelho

]]--

------------------------ CONFIG ---------------------------

local numero_de_mapas = 7 -- colocar a quantidade de mapas existentes

local WAR_COLORS = {{95,114,114,86},{79,94,94,94}} -- cores das roupas time vermelho e azul

local mapas = {

[1] = {{2,2},{3,3}}, -- [numero do mapa {maximo é o numero_de_mapas}] = {(townid de um spawn, townid de outro spawn),(townid de um spawn,town id de otro spawn)}, -- respectivamente verde e vermelho

[2] = {{5,5},{6,6}},

[3] = {{8,8},{9,9}},

[4] = {{11,11},{12,12}},

[5] = {{25,25},{26,26}},

[6] = {{28,28},{29,29}},

[7] = {{34,34},{35,35}},

}

------------------------ FIM CONFIG -----------------------

function mudarMapa(id)

setGlobalStorageValue(15000,id) -- seta a ID do novo mapa

setGlobalStorageValue(15001,os.time() + 60*40) -- seta o tempo do mapa para o !online

for i, pid in ipairs(getPlayersOnline()) do -- verifica os players online

doRemoveCreature(pid)

end

 

end -- fim da funçao mudarMapa()

 

 

function nextMap()

if getGlobalStorageValue(15000) == numero_de_mapas then

return 1

else

return (getGlobalStorageValue(15000) + 1)

end

end -- fim da funcao nextMap

 

 

function mudarRopa(cid)

local colors = WAR_COLORS[getPlayerStorageValue(cid, 12000)] -- verifica qual time é.

local outfit = getCreatureOutfit(cid)

outfit.lookHead = colors[1]

outfit.lookBody = colors[2]

outfit.lookLegs = colors[3]

outfit.lookFeet = colors[4]

doCreatureChangeOutfit(cid, outfit)

end -- fim do mudar roupas

 

 

function getTeamSpawn(cid)

return getTownTemplePosition(mapas[getGlobalStorageValue(15000)][getPlayerStorageValue(cid,12000)][math.random(1,2)])

end

 

function getTeamMembers(id)

local players = getPlayersOnline()

local team = {}

if #players == 1 then

return team

end

for i, cid in ipairs(players) do

if getPlayerStorageValue(cid, 12000) == id and getPlayerGroupId(cid) == 1 then

table.insert(team, cid)

end

end

return team

end

 

function setTeam(cid)

local team1 = getTeamMembers(1)

local team2 = getTeamMembers(2)

if #team1 >= #team2 then

setPlayerStorageValue(cid, 12000, 2)

else

setPlayerStorageValue(cid, 12000, 1)

end

mudarRopa(cid)

doTeleportThing(cid,getTeamSpawn(cid),false)

end

Link para o comentário
https://xtibia.com/forum/topic/213827-mudar-mapa-sem-tomar-mass-kick/
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

×
×
  • Criar Novo...