#Dv^ Posted June 10, 2016 Posted June 10, 2016 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?
#Dv^ Posted June 10, 2016 Author Posted June 10, 2016 Son el Zombie_client y Zombie_server los que subí
#Dv^ Posted June 10, 2016 Author Posted June 10, 2016 http://pastebin.com/5PsDnR6s Zombie_client http://pastebin.com/xZsdZcM9 Zombie_server
Tomas Posted June 11, 2016 Posted June 11, 2016 http://pastebin.com/5PsDnR6s Zombie_clienthttp://pastebin.com/xZsdZcM9 Zombie_server Zombie_server http://pastebin.com/65v2RfMq
#Dv^ Posted June 11, 2016 Author Posted June 11, 2016 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 0xCiBeR Posted June 11, 2016 MTA Team Posted June 11, 2016 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
#Dv^ Posted June 11, 2016 Author Posted June 11, 2016 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
Tomas Posted June 11, 2016 Posted June 11, 2016 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) )
#Dv^ Posted June 11, 2016 Author Posted June 11, 2016 Lo agregue a parte, pero los zombies salen constantemente, no en cierto horario
Tomas Posted June 11, 2016 Posted June 11, 2016 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.
Recommended Posts