Jump to content

[help]Zombie-Zone


RekZ

Recommended Posts

Zombies cant spawn and de zone have create in the map and radar, but the players no dead when they enter in the zone...

i need this to create a private base for ACL.

safecol = createColCuboid ( 3386.82764, -754.43237, 27.01133, 255, 255, 255 ) 
    -- sintax: posX, posY, posZ, sizeX, sizeY,sizeZ (este genera un cuadro invisible q no deja que los zombien ni lo que no sean de los grupos acl enten) 
    safeZoneRadar = createRadarArea ( 3386.82764, -754.43237, 280, 320, 66, 199, 255 ) 
    -- sintax: posX, posY, sizeX, sizeY, colorR, colorG, colorB, colorAlfa (este forma un cuadro en el radar y en el mapa) 
    setElementData (safeZoneRadar, "zombieProof", true) 
    safecol = createColSphere( -2307.53149, 2224.94287, -0.55000, 255, 255, 255 ) 
      
    function enterZone(hitPlayer,thePlayer) 
    local accountname = getAccountName (getPlayerAccount(hitPlayer,thePlayer)) 
        if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "USS" ) ) then 
        toggleControl (hitPlayer, "fire", true ) 
        toggleControl (hitPlayer, "aim_weapon", true) 
        toggleControl (hitPlayer, "vehicle_fire", true) 
        -- tiene lo derechos de acl al ENTRAR 
        outputChatBox("Bienevnido a La Base [u.S.S].", hitPlayer, 0, 100, 255) 
        else 
        -- no tiene los derechos de acl al ENTRAR 
        outputChatBox("Zona Restringida , Solo Personal Autorizado.", hitPlayer, 255, 0, 0) 
        killPed (hitPlayer) 
    end 
    end 
    addEventHandler( "onColShapeHit", safecol, enterZone ) 
      
    function leaveZone(hitPlayer,thePlayer) 
    local accountname = getAccountName (getPlayerAccount(hitPlayer,thePlayer)) 
        toggleControl (hitPlayer, "fire", true) 
        toggleControl (hitPlayer, "aim_weapon", true) 
        toggleControl (hitPlayer, "vehicle_fire", true) 
        -- tiene los derechos de acl al SALIR 
        outputChatBox("Haz salido de la base.", hitPlayer, 255, 0, 0) 
        if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "USS" ) ) then 
        -- no tiene los derechos de acl al SALIR 
        outputChatBox("Acceso denegado.", hitPlayer, 255, 0, 0) 
      killPed (hitPlayer) 
    end 
    end 
    addEventHandler( "onColShapeLeave", safecol, leaveZone ) 

Link to comment
safecol = createColCuboid ( 3386.82764, -754.43237, 27.01133, 255, 255, 255 ) 
-- sintax: posX, posY, posZ, sizeX, sizeY,sizeZ (este genera un cuadro invisible q no deja que los zombien ni lo que no sean de los grupos acl enten) 
safeZoneRadar = createRadarArea ( 3386.82764, -754.43237, 280, 320, 66, 199, 255 ) 
-- sintax: posX, posY, sizeX, sizeY, colorR, colorG, colorB, colorAlfa (este forma un cuadro en el radar y en el mapa) 
setElementData (safeZoneRadar, "zombieProof", true) 
safecol = createColSphere( -2307.53149, 2224.94287, -0.55000, 255, 255, 255 ) 
      
function enterZone ( hitElement ) 
    if ( getElementType ( hitElement ) == "player" ) then 
        local accountname = getAccountName ( getPlayerAccount ( hitElement ) ) 
        if isObjectInACLGroup ( "user.".. accountname, aclGetGroup ( "USS" ) ) then 
            toggleControl ( hitElement, "fire", true ) 
            toggleControl ( hitElement, "aim_weapon", true ) 
            toggleControl ( hitElement, "vehicle_fire", true ) 
            -- tiene lo derechos de acl al ENTRAR 
            outputChatBox ( "Bienevnido a La Base [u.S.S].", hitElement, 0, 100, 255 ) 
        else 
            -- no tiene los derechos de acl al ENTRAR 
            outputChatBox ( "Zona Restringida , Solo Personal Autorizado.", hitElement, 255, 0, 0 ) 
            killPed ( hitElement ) 
        end 
    elseif ( getElementType ( hitElement ) == "ped" ) then 
        killPed ( hitElement )       
    end 
end 
addEventHandler ( "onColShapeHit", safecol, enterZone ) 
  
function leaveZone ( leaveElement ) 
    if ( getElementType ( leaveElement ) == "player" ) then 
        local accountname = getAccountName ( getPlayerAccount ( leaveElement ) ) 
        toggleControl ( leaveElement, "fire", true ) 
        toggleControl ( leaveElement, "aim_weapon", true ) 
        toggleControl ( leaveElement, "vehicle_fire", true ) 
        -- tiene los derechos de acl al SALIR 
        outputChatBox("Haz salido de la base.", leaveElement, 255, 0, 0) 
        if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "USS" ) ) then 
            -- no tiene los derechos de acl al SALIR 
            killPed ( leaveElement ) 
            outputChatBox("Acceso denegado.", leaveElement, 255, 0, 0) 
        end 
    elseif ( getElementType ( leaveElement ) == "ped" ) then 
        killPed ( leaveElement ) 
    end 
end 
addEventHandler ( "onColShapeLeave", safecol, leaveZone ) 

Is that what you mean?

Link to comment
--safecol = createColCuboid ( 3386.82764, -754.43237, 27.01133, 255, 255, 255 ) 
-- sintax: posX, posY, posZ, sizeX, sizeY,sizeZ (este genera un cuadro invisible q no deja que los zombien ni lo que no sean de los grupos acl enten) 
safeZoneRadar = createRadarArea ( 3386.82764, -754.43237, 280, 320, 66, 199, 255 ) 
-- sintax: posX, posY, sizeX, sizeY, colorR, colorG, colorB, colorAlfa (este forma un cuadro en el radar y en el mapa) 
setElementData ( safeZoneRadar, "zombieProof", true ) 
safecol = createColSphere ( -2307.53149, 2224.94287, -0.55000, 255, 255, 255 ) 
      
function enterZone ( hitElement ) 
    if ( getElementType ( hitElement ) == "player" ) then 
        local accountname = getAccountName ( getPlayerAccount ( hitElement ) ) 
        if isObjectInACLGroup ( "user.".. accountname, aclGetGroup ( "USS" ) ) then 
            toggleControl ( hitElement, "fire", true ) 
            toggleControl ( hitElement, "aim_weapon", true ) 
            toggleControl ( hitElement, "vehicle_fire", true ) 
            -- tiene lo derechos de acl al ENTRAR 
            outputChatBox ( "Bienevnido a La Base [u.S.S].", hitElement, 0, 100, 255 ) 
        else 
            -- no tiene los derechos de acl al ENTRAR 
            outputChatBox ( "Zona Restringida , Solo Personal Autorizado.", hitElement, 255, 0, 0 ) 
            killPed ( hitElement ) 
        end 
    elseif ( getElementType ( hitElement ) == "ped" ) then 
        killPed ( hitElement )      
    end 
end 
addEventHandler ( "onColShapeHit", safecol, enterZone ) 
  
function leaveZone ( leaveElement ) 
    if ( getElementType ( leaveElement ) == "player" ) then 
        local accountname = getAccountName ( getPlayerAccount ( leaveElement ) ) 
        toggleControl ( leaveElement, "fire", true ) 
        toggleControl ( leaveElement, "aim_weapon", true ) 
        toggleControl ( leaveElement, "vehicle_fire", true ) 
        -- tiene los derechos de acl al SALIR 
        outputChatBox("Haz salido de la base.", leaveElement, 255, 0, 0) 
        if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "USS" ) ) then 
            -- no tiene los derechos de acl al SALIR 
            killPed ( leaveElement ) 
            outputChatBox("Acceso denegado.", leaveElement, 255, 0, 0) 
        end 
    elseif ( getElementType ( leaveElement ) == "ped" ) then 
        killPed ( leaveElement ) 
    end 
end 
addEventHandler ( "onColShapeLeave", safecol, leaveZone ) 

Your problem is that you have 2 colshapes, I've tested with the second one and it killed me.

Link to comment

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...