Jump to content

Zombies


#Dv^

Recommended Posts

Posted

Hola!

Tengo una duda, tengo el script de zombies de la comunidad, pero quiero editarlo para que los zombies solo salga en cierto horario, es decir de 12am a 18pm

¿Donde debo editarlo?

Posted

Gracias Tomas!

Funciona bien, podrías decirme la linea en donde cambiaste el horario? Así lo voy ajustando

Por que quiero que salga en el chat a la hora que aparecen y a la hora que desaparecen

  • MTA Team
Posted
Gracias Tomas!

Funciona bien, podrías decirme la linea en donde cambiaste el horario? Así lo voy ajustando

Por que quiero que salga en el chat a la hora que aparecen y a la hora que desaparecen

Línea 418, usa la función getTime aunque si necesitas un horario real tendrías que usar getRealTime

Posted

Gracias!

Pero cuando agrego el "outputChatBox("Los zombies empiezan a salir")", me sale infinidad de ese mensaje hasta que los zombies dejan de salir

  
function SpawnZombie () 
    if not ( ({getTime()})[1] >= 0 and ({getTime()})[1] <= 06 ) then return false end 
    outputChatBox("Los zombies empiezan a salir") 
    local pacecount = 0 
    while pacecount < 5 do  --4 ZOMBIES AT A TIME TO PREVENT FPS DROP 
        if (table.getn( everyZombie )+pacecount < newZombieLimit ) and (ZombieStreaming == 1) then  
            local xcoord = 0 
            local ycoord = 0 
            local xdirection = math.random(1,2) 
            if xdirection == 1 then 
                xcoord = math.random(15,40) 
            else 
                xcoord = math.random(-40,-15) 
            end 
            local ydirection = math.random(1,2) 
            if ydirection == 1 then 
                ycoord = math.random(15,40) 
            else 
                ycoord = math.random(-40,-15) 
            end 
            local liveplayers = getAlivePlayers () 
            if (table.getn( liveplayers ) > 0 ) then 
                local lowestcount = 99999 
                local lowestguy = nil 
                for PKey,thePlayer in ipairs(liveplayers) do 
                    if isElement(thePlayer) then 
                        if (getElementData (thePlayer, "dangercount")) and (getElementData(thePlayer, "zombieProof") ~= true) and (getElementData(thePlayer, "alreadyspawned" ) == true) then 
                            if (getElementData (thePlayer, "dangercount") < lowestcount) then 
                                local safezone = 0 
                                local gx, gy, gz = getElementPosition( thePlayer ) 
                                local allradars = getElementsByType("radararea") 
                                for theKey,theradar in ipairs(allradars) do 
                                    if getElementData(theradar, "zombieProof") == true then 
                                        if isInsideRadarArea ( theradar, gx, gy ) then 
                                            safezone = 1 
                                        end 
                                    end 
                                end 
                                if safezone == 0 then 
                                    lowestguy = thePlayer 
                                    lowestcount = getElementData (thePlayer, "dangercount") 
                                end 
                            end 
                        end 
                    end 
                end 
                pacecount = pacecount+1 
                if isElement(lowestguy) then 
                    triggerClientEvent ( "Spawn_Placement", lowestguy, ycoord, xcoord ) 
                else 
                    pacecount = pacecount+1 
                end 
            else 
                pacecount = pacecount+1 
            end 
        else 
            pacecount = pacecount+1 
        end 
    end 
end 

Posted
Gracias!

Pero cuando agrego el "outputChatBox("Los zombies empiezan a salir")", me sale infinidad de ese mensaje hasta que los zombies dejan de salir

Elimina esa línea y agrega este código aparte:

  
setTimer( 
    function () 
        if ( ({getTime()})[1] >= 0 and ({getTime()})[1] <= 06 ) then 
            outputChatBox("Los zombies comenzarán a aparecer!") 
        end 
    end, 300*getMinuteDuration(), 0) 
) 

Posted
Lo agregue a parte, pero los zombies salen constantemente, no en cierto horario

Al código déjalo como estaba en el Pastebin, agrega eso que te puse arriba a parte, en otro o en el mismo al final.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...