Results 1 to 6 of 6

Thread: Door blockers...

  1. #1

    Default Door blockers...

    Hello,
    Is there a good way to stop people from blocking "doorless" doorways ? I found a mod in Enhancement section but it only forces the door to close while someone is standing on the doorway but that doesn't always work and it doesn't work at all when there is no door(just an empty doorway).Is it possible to run a script that will detect a player in a specific area and kill him automatically if he doesn't move for let's say 10 seconds? We have an anti-underground script for each map and I was wondering if it's possible to modify and add specific user-defined areas and a timer ?

    The following code basically kicks anyone who goes below the map in Village and gives a warning.My goal is to kill the player instead of kicking and to add more areas where the script triggers a kill after 10 seconds.Even if it's possible,would it cause too much lag?

    Code:
    main
    thread _trigSet "trig_touch" 0 "kill" -3592.87 1080.75 -95.88 -1158.57 2214.40 -96    // under the map
    thread _trigSet "trig_touch" 0 "kill" -2130 -716.29 630 -2136.87 -719.08 640        // v shaped wall
    thread _trigSet "trig_touch" 0 "kill" -2175.51 320.17 1000 -2605.76 313.83 500    // side of tank street
    thread _trigSet "trig_touch" 0 "warn" -2175.51 320.17 1000 -2605.76 313.83 500    // v shaped wall
    thread _trigSet "trig_touch" 0 "warn" -2130 -716.29 630 -2136.87 -719.08 640        // side of tank street
    thread _trigSet "trig_touch" 0 "ciact" -3592.87 1080.75 -95.88 -1158.57 2214.40 -96 // under the map
    
    end
    
    _trigSet local.type local.wtime local.action \
        local.x1 local.y1 local.z1 \
        local.x2 local.y2 local.z2 \
    :
        thread level.mam_f_utils::debug 0 "_trigSet |" local.type "|" \
                    local.wtime "|" local.action "|" \
                    local.x1 "," local.y1 "," local.z1 "|" \
                    local.x2 "," local.y2 "," local.z2 "| -------"
    
        switch ( local.type )
        {
          case "trig_touch":
          case "trig_use":
          case "trig_fire":
          case "trig_mg":
            local.trigObj = spawn trigger_multiple
            break
          default:
            end
        }
    
        local.x1 = float( local.x1 ) ; local.x2 = float( local.x2 )
        local.y1 = float( local.y1 ) ; local.y2 = float( local.y2 )
        local.z1 = float( local.z1 ) ; local.z2 = float( local.z2 )
    
        // Make sure coords are in right order
        if ( local.x1 > local.x2 )
        {
            local.x = local.x1 ; local.x1 = local.x2 ; local.x2 = local.x
        }
        if ( local.y1 > local.y2 )
        {
            local.y = local.y1 ; local.y1 = local.y2 ; local.y2 = local.y
        }
        if ( local.z1 > local.z2 )
        {
            local.z = local.z1 ; local.z1 = local.z2 ; local.z2 = local.z
        }
    
        local.trigObj.origin = ( local.x1 local.y1 local.z1 )
        local.trigObj setsize ( 0 0 0 ) ( ( local.x2 local.y2 local.z2 ) - \
                          ( local.x1 local.y1 local.z1 ) )
        local.trigObj delay ( float( local.wtime ) )
        if ( level.mam_debug > 80 )
            local.trigObj message \
                    ( "I'm in brush #" + local.trigObj.entnum )
        local.trigObj setthread "_trigAction"
        local.trigObj.ham_type = local.type
        local.trigObj.ham_action = local.action
        for ( local.i = 1; local.i <= level.mam_sv_maxclients; local.i++ )
        {
            local.trigObj.ham_team[ local.i ] = ""
            local.trigObj.ham_time[ local.i ] = 0
        }
    end
    
    //----------------------------------------------------------------------------
    
    _trigAction:
        local.player = parm.other
    
        if ( ( self.ham_type == "trig_use" ) &&
             ( ! local.player.useheld ) )
            end
        if ( ( self.ham_type == "trig_fire" ) &&
             ( ! local.player.fireheld ) )
            end
    
        local.playerId = local.player.entnum + 1
    
        thread level.mam_f_utils::debug 80 "Trig: Player #" local.playerId \
                            "  brush = " self.entnum \
                            "  action = " self.ham_action
    
        local.team = self.ham_team[ local.playerId ]
        local.time = self.ham_time[ local.playerId ]
    
        if ( ( local.team != "" ) &&
             ( local.team != local.player.dmteam ) &&
             ( ( level.time - local.time ) < 30.0 ) )
        {
            local.tmChange = 1
        }
        else
        {
            local.tmChange = 0
            self.ham_team[ local.playerId ] = local.player.dmteam
            self.ham_time[ local.playerId ] = level.time
        }
    
        if ( self.ham_type == "trig_mg" )
        {
            if ( local.tmChange == 0 )
                end
        }
    
        switch ( self.ham_action )
        {
          case "hurt1":   local.player hurt 1 ; break
          case "hurt5":   local.player hurt 5 ; break
          case "hurt10":  local.player hurt 10 ; break
          case "hurt25":  local.player hurt 25 ; break
          case "hurt50":  local.player hurt 50 ; break
          case "die":      local.player hurt 10000 ; break
          case "kill":    local.player kill ; break
          case "respawn": local.player respawn ; break
          case "weapnext":local.player weapnext ; break
          case "weapdrop":local.player weapdrop ; break
          case "holster": local.player safeholster 1 ; break
          case "stand":      local.player modheight stand ; break
          case "duck":      local.player modheight duck ; break
          case "ciact":      thread outofbounds local.player ; break
          case "warn":      thread sendwarning local.player ; break
          default:      local.player stufftext self.ham_action ; break
        }
    end
    
    //-----------------------------------------------------------------------------
    
    outofbounds local.player:
    
    local.string = (getcvar ciact)
    if(local.string == "X" || local.string == "x")
        local.string = ""
    local.string = (local.string + "k" + local.player.entnum + ";")
    setcvar ciact local.string
    local.player stufftext "say Hello, I Tried Getting to a Place I Shouldn't!"
    
    iprintln "ATTENTION: Out of Bounds Player Detected"
    
    end
    
    //-----------------------------------------------------------------------------
    
    sendwarning local.player:
    
    local.player stufftext "say Hello, I Tried Getting to a Place I Shouldn't!"
    
    iprintln "ATTENTION: Out of Bounds Player Detected"
    
    end
    ty
    Camp another day.
    Barbarossa

  2. #2
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269
    Last edited by Purple Elephant1au; August 3rd, 2013 at 07:52 PM.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  3. #3

    Default

    1st link.

    On the second page I could not find a download link but on third one Armageddon posted a doorblock.zip file.I assume you meant that one.I tested that but it didn't work.Let's say I want to execute the script for Southern France.Should I place the doorblock.pk3 in main folder and in main/maps/dm/mohdm1.scr I type exec global/doorblock/dm_mohdm1.scr ?
    Armageddon's link with description is on post #24
    http://www.x-null.net/forums/showthr...ght=door+block

    I have other mods so I also tried without pk3 file to make sure they don't conflict.I put the doorblock.scr file in global folder and the content of dm_mohdm1.scr was added to my existing maps/dm/mohdm1.scr file, after the "level waittill spawn" line.That didn't work either.


    2nd link.
    I will try that if the doorblock.pk3 file doesn't work.
    Camp another day.
    Barbarossa

  4. #4

    Default

    The file from your 1st link's 3rd page works great !
    I took out the "doorblock" folder from the pk3 file and placed it in the "global" folder and executed each map's script from dmprecache.scr

    Thanks guys.
    Last edited by User45; August 4th, 2013 at 12:54 PM.
    Camp another day.
    Barbarossa

  5. #5
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    You shouldnt exec every doorblock/map.scr from the dmprecache, because that would mean that at all the coords from all the maps are then added to every map , so the doorblock will trigger on random spots on the maps.

    Thats why it was made to add it to the corresponding map/map.scr file, under level waittill spawn. And it will work if done right.My guess it before when you tried it , you exec the doorblock.scr too soon , and not under the level waittill spawn . or even prespawn will do.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  6. #6

    Default

    Quote Originally Posted by Purple Elephant1au View Post
    My guess it before when you tried it , you exec the doorblock.scr too soon , and not under the level waittill spawn
    xD
    For some reason I have two lines of "level waittill spawn" on different parts of the file.I exec-ed the doorblock after the first one and now it works.
    Thanks !
    Camp another day.
    Barbarossa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •