Jump to content

que se necesita para hacer una zona anti zombis ?


iFoReX

Recommended Posts

Posted
como dice en el titulo quiero hacer una zona anti zombies

se que se ocupa

createRadarArea 
onZombieSpawn 

pero como hago para cancelar el evento si esta dentro del area ?

esto:

Client:

addEventHandler("onClientPlayerDamage",localPlayer, 
    function( ) 
        if getElementData( localPlayer,"damage" ) == "no" then 
            cancelEvent( ) 
        end 
    end 
) 
  

Server:

local savePlaces        = { 
    {249, 1230, 10}, 
    {2785, -2417, 20} 
}           -- more colshapes 
    {-1194.8020019531, -1063.5977783203, 100} 
  
local radarAreaPlaces   = { 
    {249, 1230, 10,10,0,255,0,255}, 
    {2773, -2430, 30,30,0,255,0,255} 
} -- more radar areas 
    {-1194.8020019531, -1063.5977783203, 189.25,148.25,0,0,255,255} 
  
-----------------------  utilizing  ----------------------- 
local resourceName            = getResourceName ( resource ) 
local useGunsInSavePlace      = get(resourceName..".UseGunsInSaveZone") 
local useRadarArea            = get(resourceName..".UseRadarArea") 
local onSavesPlace            , CreateRdarAreas 
  
----------------------- added in Version 1.0.1 Resource ----- 
  
local useRunInSaveZone        = get(resourceName..".UseRunInSaveZone") 
local useJumpInSaveZone       = get(resourceName..".UseJumpInSaveZone") 
local useWeaponHudInSaveZone  = get(resourceName..".UseWeaponHudInSaveZone") 
local useAmmoHudInSaveZone    = get(resourceName..".UseAmmoHudInSaveZone") 
  
----------------------- added in Version 1.0.4 Resource ----- 
  
local useDamageInSaveZone    = get(resourceName..".UseDamageInSaveZone") 
  
  
-----------------------  utilizing  ----------------------- 
  
addEventHandler ( "onResourceStart", resourceRoot,  
    function ( startResource ) 
        for i,w in ipairs( savePlaces ) do 
            onSavesPlace = createColCircle ( w[1], w[2], w[3] ) -- create col shape 
            addEventHandler ( "onColShapeHit", onSavesPlace,  
                function ( hitElement, matchingDimension   ) 
                    if getElementType(hitElement) == "player" then 
                        if not useGunsInSavePlace then 
                            toggleControl (hitElement, "fire", true ) 
                            toggleControl (hitElement, "aim_weapon", true) 
                            toggleControl (hitElement, "vehicle_fire", false) 
                        end 
                        if not useRunInSaveZone then 
                            toggleControl (hitElement, "sprint", true ) 
                        end 
                        if not useJumpInSaveZone then 
                            toggleControl (hitElement, "jump", true ) 
                        end 
                        if not useWeaponHudInSaveZone then 
                            showPlayerHudComponent ( hitElement, "weapon", true )  
                        end 
                        if not useAmmoHudInSaveZone then 
                            showPlayerHudComponent ( hitElement, "ammo", true )  
                        end 
                        if not useDamageInSaveZone then 
                            setElementData( hitElement,"damage","no" ) 
                        end  
                    end     
                    if getElementType(hitElement) == "ped" then -- check if the entered ped kill it 
                        killPed(hitElement) -- kill ped 
                    end  
                end 
            )    
            addEventHandler ( "onColShapeLeave", onSavesPlace,  
                function ( leaveElement, matchingDimension ) 
                    if getElementType(leaveElement) == "player" then 
                        if not useGunsInSavePlace then 
                            toggleControl (leaveElement, "fire", true ) 
                            toggleControl (leaveElement, "aim_weapon", true) 
                            toggleControl (leaveElement, "vehicle_fire", true) 
                        end 
                        if not useRunInSaveZone then 
                            toggleControl (leaveElement, "sprint", true ) 
                        end 
                        if not useJumpInSaveZone then 
                            toggleControl (leaveElement, "jump", true ) 
                        end 
                        if not useWeaponHudInSaveZone then 
                            showPlayerHudComponent ( leaveElement, "weapon", true )  
                        end 
                        if not useAmmoHudInSaveZone then 
                            showPlayerHudComponent ( leaveElement, "ammo", true )  
                        end 
                        if not useDamageInSaveZone then 
                            setElementData( leaveElement,"damage","yes" ) 
                        end  
                    end     
                    if getElementType(leaveElement) == "ped" then -- check if the entered ped kill it 
                        killPed(leaveElement) -- kill ped 
                    end 
                end 
            )       
            if useRadarArea then 
                for i,r in ipairs( radarAreaPlaces ) do 
                    CreateRdarAreas   = createRadarArea ( r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8] ) 
                end 
            end 
        end  
    end     
)  
  
  
  
  

Meta.Xml

        "Volk ( Kenix )" description="Advanced Anti Zombie" version="1.0.4" type="script" /> 
        

Esta en la comunidad.

Developer @ MYVAL

Posted
o.O lo se pero yo quiero hacer uno simplecito pero gracias a ese resource ya se con que creando colshapes :)

si, pero usalo, es mas facil, y puedes poner si quieres permitir el uso de armas o de saltar y todo eso, tambien puedes usar el coleditor

Developer @ MYVAL

Posted

usa la funcion incorporada del script de slothman. la cancelacion del spawn en zonas definidas

con un setElementData. y la funcion es zombieProof

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted
usa la funcion incorporada del script de slothman. la cancelacion del spawn en zonas definidas

con un setElementData. y la funcion es zombieProof

el script es mas simple xD

Developer @ MYVAL

Posted

algo mas simple ke esto?

safecol = createColCuboid ( -411, 1483, 40, 220, 200, 60 ) 
safeZoneRadar = createRadarArea ( -411, 1483, 220, 200, 0, 255, 0, 100 ) 
setElementData (safeZoneRadar, "zombieProof", true) 

este es un ejemplo de mi zona, cambiale las dimenciones y las cordenadas

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

ok yakusa solo 1 pregunta... las coordenadas del cuboid son las mismas que la de la zona radar

#OFFTopic : ademas.. Yakusa me pase por tu server y los de los clanes estan fuera de la zona anti zombies y pasan matando a las personas comunes y corrientes :P

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

si man, o nomas si kieres aplicas radararea nomas.

y en cuanto al off topic, el server es deathmatch.

pero ideare godmode para los civiles y que tampoco agan daño, nomas los clanes puedan matarse entre si

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

nope

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

yakusa no me sirvio D: se crea el area en el radar pero los zombis igual entran y matan

safecol = createColCuboid ( 661.65600585938, -2784.9812011719, 8.5092506408691, 220, 200, 60 ) 
safeZoneRadar = createRadarArea ( 661.65600585938, -2784.9812011719, 220, 200, 0, 255, 0, 100 ) 
setElementData (safeZoneRadar, "zombieProof", true) 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted
safecol = createColCuboid ( 661.65600585938, -2784.9812011719, 8.5092506408691, 220, 200, 60 ) 
safeZoneRadar = createRadarArea ( 661.65600585938, -2784.9812011719, 220, 200, 0, 255, 0, 100 ) 
setElementData (safecol, "zombieProof", true) 

Posted

eso solo cancela el spawn de zombies. los zombies podran entrar igual.

agrega esta linea

function enterZone( hitElement, matchingDimension) 
if getElementType(hitElement) == "ped" then 
killPed(hitElement)  
end 
end 
addEventHandler( "onColShapeHit", safecol, enterZone ) 

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

dale menos Z a la cordenada del safecol. en vez de 8.509... ponele 0

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

  • 1 month later...
Posted

disculpen miren soy nuevo en esto digamos un noob pero mis players de mi server kieren tener area anti zombie en las bases de sus clanes entendi todo lo ke dijieron pero no entendi como sacaran las posiciones no se si es Z, X o Y le sagredeceria si me lo aclaran. :D

Posted

Para ser mas explicito juako, las cordenadas x,y,z son las de posision del map de san andreas

Te explicare

safecol = createColCuboid ( 661, -2784, 8, 220, 200, 60 )

Aqui tienes la creacion de la zona antizombie

el 661 sera la cordenada X, -2784 cordenada Y, 8 cordenada Z

Estas cordenadas seran las del punto de creacion de la zona antizombie

Las puedes sakar del panel de administrador. vas al lugar donde quieres la zona antizombie y te paras sobre ese lugar, y pones el panel de admin y te seleccionas entre los jugadores y abajo, salen tus cordenadas, X: xxxxx Y: xxxxx Z: xxxxx

No tienes que ser tan especifico al momnento de agregar los decimales, puedes agregar solo el numero entero.

Despues de eso, iingresas tus cordenadas

(atentos a cuales son negativas y cuales no)

safecol = createColCuboid ( X, Y, Z, 220, 200, 60 )

Despues de eso 220, 200 y 60 es el limite de expancion

Osea cuanto quieres que se expanda el limite.

Obiamente ingresando las cordenadas X,Y,Z nomas se creara el punto inicial, y para que cubra toda la base, o lugar antizombie debes ir subiendole el 220,200 y 60

Debes jugar con los primeros 2, 220 y 200, 60 es la altura.

Si no es suficiente zona o demaciado, bajale y asi vas reiniciando el recurso asta ke veas los cambios :)

espero averte ayudado

suerte

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

y ke hago con el ¿' lo otro lo entendi gracias :D

safeZoneRadar = createRadarArea ( 661.65600585938, -2784.9812011719, 220, 200, 0, 255, 0, 100 ) 
setElementData (safecol, "zombieProof", true) 
  

Posted

zombieProof es para radar-areas no Colshapes:

addEvent( "onZombieSpawn", true ) 
function RanSpawn_Z ( gx, gy, gz, rot) 
    local safezone = 0 
    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 

Developer @ MYVAL

  • Recently Browsing   0 members

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