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