Ir para conteúdo

Featured Replies

Postado

Galera, gostaria que vocês editassem esse script que uso para sistema de team x team, com a finalidade de que cada team fosse para uma determinada posição estabelecida pelo mod>Changemap que uso, atualmente team 1 e team 2 vão para a mesma localização, gostaria que cada um fosse para sua base.

 

 

local config = {

    storageTeamOne = 68473,
    storageTeamTwo = 68474,
    teamOne = { outfitMale =  {lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}, -- 94 representa a cor vermelha.
                outfitFemale =  {lookType = 136, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94},
              },
    teamTwo = { outfitMale =  {lookType = 128, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82}, -- 82 representa a cor verde.
                outfitFemale =  {lookType = 136, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82},
              }
}
 
 
function onLogin(cid)
local vermelho = getGlobalStorageValue(config.teamOne)
local verde = getGlobalStorageValue(config.storageTeamTwo)
if vermelho > verde then
    if getPlayerSex(cid) == 0 then
        doCreatureChangeOutfit(cid, config.teamTwo.outfitFemale)
    else
        doCreatureChangeOutfit(cid, config.teamTwo.outfitMale)
    end  
    setGlobalStorageValue(config.storageTeamTwo, verde+1)
    setPlayerStorageValue(cid, config.storageTeamTwo, 1)
else
    if getPlayerSex(cid) == 0 then
        doCreatureChangeOutfit(cid, config.teamOne.outfitFemale)
    else
        doCreatureChangeOutfit(cid, config.teamOne.outfitMale)
    end  
    setGlobalStorageValue(config.teamOne, vermelho+1)
    setPlayerStorageValue(cid, config.teamOne, 1)
end
registerCreatureEvent(cid, "LogoutTeam")
registerCreatureEvent(cid, "DeathTeam")
return true
end
 
function onDeath(cid, corpse, deathList)
if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then
    setPlayerStorageValue(cid, config.storageTeamTwo, 0)
    setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)
else
    setPlayerStorageValue(cid, config.teamOne, 0)
    setGlobalStorageValue(config.teamOne, getGlobalStorageValue(config.teamOne)-1)
end
return true
end
 
function onLogout(cid)
if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then
    setPlayerStorageValue(cid, config.storageTeamTwo, 0)
    setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)
else
    setPlayerStorageValue(cid, config.teamOne, 0)
    setGlobalStorageValue(config.teamOne, getGlobalStorageValue(config.teamOne)-1)
end
return true
end

 

 

<?xml version="1.0" encoding="UTF-8"?>  

<mod name="ChangeMap" version="1.0" author="Vodkart" contact="tibiaking.com" enabled="yes">  
<config name="map_func"><![CDATA[  
 
                      info = {  
                      [0] = {x=654,y=847,z=7},
                      [1] = {x=517,y=602,z=7},
                      [2] = {x=552,y=226,z=7},
                      [3] = {x=789,y=308,z=7},
                      [4] = {x=250,y=180,z=7},
                      [5] = {x=413,y=804,z=7}
                        }
 
                        storage = 50555  
 
]]></config> 
<event type="login" name="Check Map" event="script"><![CDATA[  
domodlib('map_func')  
        function onLogin(cid) 
        if getGlobalStorageValue(storage) == -1 then 
        setGlobalStorageValue(storage,getGlobalStorageValue(storage)+1)  
        end 
        doTeleportThing(cid,info[getGlobalStorageValue(storage)])   
        return true  
end  
]]></event> 
        <globalevent name="ChangeMap" interval="30" event="script"><![CDATA[  
        domodlib('map_func')  
        function onThink(interval, lastExecution)  
                doBroadcastMessage('O mapa sera mudado novamente em 20 minutos.')
                if getGlobalStorageValue(storage) < 5 then  
                setGlobalStorageValue(storage,getGlobalStorageValue(storage)+1)   
                else  
                setGlobalStorageValue(storage,getGlobalStorageValue(storage)-5)
                end  
                for _, pid in ipairs(getPlayersOnline()) do
                doRemoveConditions(pid, true)   
                doTeleportThing(pid,info[getGlobalStorageValue(storage)])    
                end   
         return TRUE  
end]]></globalevent> 
</mod>

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo