Ir para conteúdo

Featured Replies

Postado

Eu queria saber se tem como vocês modificarem esse script team vs team abaixo para quando um player de um time mata o outro aparecer na tela o jogar X foi morto pelo time jogador Y do time azul

 

redTeamSpawn             = { x = 1000, y = 1000, z = 7} -- red team spawn position
blueTeamSpawn             
= { x = 1000, y = 1000, z = 7} -- blue team spawn position

redTeamParticipants     
= {}

blueTeamParticipants     = {}

function teamLength(team) -- return the number of players in team
local count
= 0
for _ in pairs(team) do count = count + 1 end
return count
end


function playerJoin(cid) -- try to join player in event
    
if ableToJoin(cid) then
        redTeamParticipantsLength     
= teamLength(redTeamParticipants)
        blueTeamParticipantsLength     = teamLength(blueTeamParticipants)
        if redTeamParticipantsLength <= blueTeamParticipantsLength then
            redTeamParticipants
[cid]     = true
            doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time vermelho.")
            doTeleportThing(cid, redTeamSpawn)
        else
            blueTeamParticipants[cid]    = true
            doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time azul.")
            doTeleportThing(cid, blueTeamSpawn)
        end
        
return TRUE
    
else
        return FALSE
    end
end


function playerRemove(cid) -- remove player from event (if its participating)
    if isParticipating(cid) then
        
if redTeamParticipants[cid] == true then
            redTeamParticipants
[cid]     = nil
        
else
            blueTeamParticipants[cid]     = nil
        end
        
return TRUE
    
else
        return FALSE
    end
end


function isParticipating (cid) -- verify if player is participating of the event
    
if blueTeamParticipants[cid] == true or redTeamParticipants[cid] == true then
        
return TRUE
    
else
        return FALSE
    end
end


function ableToJoin (cid) -- checks if players are able to join
    
if isPlayer(cid) and not isParticipating(cid) then
        
return TRUE
    
else
        return FALSE
    end
end


function arePlayersOfSameTeam (cid1, cid2) -- checks if the players are of the same team
    
if ((blueTeamParticipants[cid1] == true and blueTeamParticipants[cid2] == true) or (redTeamParticipants[cid1] and redTeamParticipants[cid2])) then
        
return TRUE
    
else
        return FALSE
    end
end


function onLogin(cid)
    -- checks if it's really a player and if it's only
    
if isPlayer(cid) then
        
if isParticipating(cid) == true then
            
return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong
        
else
            if playerJoin(cid) == true then
                
return TRUE -- everything gone as expected
            
else
                return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong
            end
        end
    
else
        return TRUE
    end
end


function onLogout(cid) -- this function is essential to not unbalance the teams
    
if isParticipating (cid) then
        
return playerRemove(cid)
    end
    
return TRUE
end


function onAttack(cid, attacker)
    -- verify if both are players
    
if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end
    
    
-- are those players participating of the event?
    if not isParticipating(cid) or not isParticipating (attacker) then return TRUE end
    
    
if arePlayersOfSameTeam(cid, attacker) then
        
-- a player of the same team cannot attack the other!!
        return FALSE
    
else
        return TRUE
    end
end


function onStatsChange(cid, attacker, t, combat, value)
    -- verify if both are players
    
if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end
    
    
-- verify if both are participating of PVP
    
if isParticipating(cid) and isParticipating(attacker) then
        
-- both are participating of event
        
        
-- verify if both are of the same team
        
if arePlayersOfSameTeam(cid, attacker) then
            
-- they're of the same team. Only heals are acceptable
            
if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then
                
return TRUE
            
else
                return FALSE
            end
        
else
            -- they're not of the same team. Only damages are acceptable
            
if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then
                
return FALSE
            
else
                return TRUE
            end
        end
    
else
        -- one or both are not participating of event
        
return TRUE
    end
    
    
-- getting
    local player1Team
= monstersTeam[getCreatureName(cid)]
    -- return if it has no team
    
if player1Team == nil then return TRUE end
    
    
-- getting monster that is attacking team
    local monster2Team
= monstersTeam[getCreatureName(attacker)]
    -- return if it has no team
    
if monster2Team == nil then return TRUE end
    
    
-- check if they're of the same team
    
if monster1Team == monster2Team then
        
-- if they're of the same team, returning false will not allow the damage to be done to its partner
        
return FALSE
    
else
        return TRUE
    end
        
    
return TRUE
end

 

Queria um script tambem que quando o player logar aparecer uma plaquinha escrito X coisa

Editado por kaio Santos (veja o histórico de edições)

Mais vale a lagrima da derrota doque a Covardia de não ter lutado , Prefiro morrer de Pé do que sempre viver ajoelhado.

Kaio santos "soldier killed"

Postado
  • Autor

@up

Mais vale a lagrima da derrota doque a Covardia de não ter lutado , Prefiro morrer de Pé do que sempre viver ajoelhado.

Kaio santos "soldier killed"

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