Jump to content

Problem with zombie greenzones.


Recommended Posts

Posted

Hi, I downloaded and installed in my server a resource from Kenix, of the community. it doesn't works properly. it kills the zombies, but they spawn in the greenzone and they get killed there. what i want is, that they can't even spawn and come to the greenzone. Because it's ugly to see some zombies diyng when i am in the greenzone, and then they're dead in the floor for 5 seconds or so.

CLIENT

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

SERVER

-- Advanced Anti Zombie by Kenix version 1.0.6 
  
--[[ 
It's example how use it. 
  
Change this 
]] 
  
  
local aSavePlaces =  
{ 
    Rectangle = 
    { 
        -- X, Y, Width, Height 
        { x,y, 2000, 2000}; 
        { x,y, 2000, 2000}; 
    } 
} 
  
local aRadarAreaPlaces =  
{ 
    -- x,  y ,size 1, size 2, color: red, green, blue, alpha. 
    { x,y, 2000, 2000, 0, 255, 0, 255 } ; 
    {x,y, 2000, 2000, 0, 255, 0, 255 } ; 
} 
  
local sResourceName             = getResourceName ( resource ) 
local bUseGunsInSavePlace       = get( sResourceName .. '.UseGunsInSaveZone' ) 
local bUseRadarArea             = get( sResourceName .. '.UseRadarArea' ) 
local pColshape, pRadarArea 
  
local bUseRunInSaveZone         = get( sResourceName .. '.UseRunInSaveZone' ) 
local bUseJumpInSaveZone        = get( sResourceName .. '.UseJumpInSaveZone' ) 
local bUseWeaponHudInSaveZone   = get( sResourceName .. '.UseWeaponHudInSaveZone' ) 
local bUseAmmoHudInSaveZone     = get( sResourceName .. '.UseAmmoHudInSaveZone' ) 
  
local bUseDamageInSaveZone      = get( sResourceName .. '.UseDamageInSaveZone' ) 
  
addEventHandler ( 'onResourceStart', resourceRoot,  
    function ( ) 
        for s, _ in pairs( aSavePlaces ) do 
            for _, a in pairs( aSavePlaces[ s ] ) do 
                pColshape = _G[ 'createCol' .. s ]( unpack( a ) ) 
                setElementData( pColshape, 'zombieProof', true ) 
                addEventHandler ( 'onColShapeHit', pColshape,  
                    function ( pHitElement ) 
                        if getElementType( pHitElement ) == 'player' then 
                            if not bUseGunsInSavePlace then 
                                toggleControl ( pHitElement, 'fire', false ) 
                                toggleControl ( pHitElement, 'aim_weapon', false ) 
                                toggleControl ( pHitElement, 'vehicle_fire', false ) 
                            end 
                            if not bUseRunInSaveZone then 
                                toggleControl ( pHitElement, 'sprint', false ) 
                            end 
                            if not bUseJumpInSaveZone then 
                                toggleControl ( pHitElement, 'jump', false ) 
                            end 
                            if not bUseWeaponHudInSaveZone then 
                                showPlayerHudComponent ( pHitElement, 'weapon', false )  
                            end 
                            if not bUseAmmoHudInSaveZone then 
                                showPlayerHudComponent ( pHitElement, 'ammo', false )  
                            end 
                            if not bUseDamageInSaveZone then 
                                setElementData( pHitElement, 'damage', 'no' ) 
                            end  
                        elseif getElementType( pHitElement ) == 'ped' then -- check if the entered ped kill it   
                            killPed( pHitElement ) -- kill ped 
                        end  
                    end 
                )    
                addEventHandler ( 'onColShapeLeave', pColshape,  
                    function ( pLeaveElement ) 
                        if getElementType( pLeaveElement ) == 'player' then 
                            if not bUseGunsInSavePlace then 
                                toggleControl ( pLeaveElement, 'fire', true ) 
                                toggleControl ( pLeaveElement, 'aim_weapon', true ) 
                                toggleControl ( pLeaveElement, 'vehicle_fire', true ) 
                            end 
                            if not bUseRunInSaveZone then 
                                toggleControl ( pLeaveElement, 'sprint', true ) 
                            end 
                            if not bUseJumpInSaveZone then 
                                toggleControl ( pLeaveElement, 'jump', true ) 
                            end 
                            if not bUseWeaponHudInSaveZone then 
                                showPlayerHudComponent ( pLeaveElement, 'weapon', true )  
                            end 
                            if not bUseAmmoHudInSaveZone then 
                                showPlayerHudComponent ( pLeaveElement, 'ammo', true )  
                            end 
                            if not bUseDamageInSaveZone then 
                                setElementData( pLeaveElement, 'damage', 'yes' ) 
                            end   
                        elseif getElementType( pLeaveElement ) == 'ped' then -- check if the entered ped kill it 
                            killPed( pLeaveElement ) -- kill ped 
                        end 
                    end 
                ) 
            end 
        end 
        if bUseRadarArea then 
            for _, a in ipairs( aRadarAreaPlaces ) do 
                pRadarArea = createRadarArea ( unpack( a ) ) 
            end 
        end 
    end     
)  
  
  
  
  

META

    "Kenix" description="Advanced Anti Zombie" version="1.0.6" type="script" /> 
    

Help me please

Posted

no one?= what i mean is how to forbid the zombies in LS. I think I can do it with activating only spawn zombies by spawnpoint and placing spawns in LV and SF, but that will take a while. isn't there any way to do it easier? like an area like which I had posted above, but it works? because see, what happens now, they get killed but...:

xu4W4TE.png

Posted

Just create a big radararea + colshape around LS and when they enter, kill them, and set the "zombieProof" element data to the radar area, so they don't spawn inside it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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