• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Change Kick for Move

xLosT

Member
Joined
Jan 11, 2010
Messages
1,021
Reaction score
13
Location
Brasil, Rio Grande do Sul
I have a script team x team, exchange server map to war
my script kick the player in time to exchange map, i need change to move player to next temple.

Code:
                                            --[[
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 = {{0,94,94,94},{114,87,87,87}}  -- 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] = {{31,31},{32,32}},
}
------------------------ 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
 
Back
Top