Restrict weapons and actions

Sadwaffles

L1: Registered
Dec 27, 2013
3
0
I've tried a few methods but what would be the best.
Some areas I would like to restrict certain weapons from players and some areas Id like people to be invulnerable to other peoples weapons. :confused:
 

Egan

aa
Feb 14, 2010
1,375
1,721
To make people invulnerable to weapons in some areas you can use this set up:

A different way you can achieve an invulnerable area would be to use a filter_damage_type:
6UAyr0K.png


The 'Damage Type' in this instance is set to 1024, or 'Energy Beam', which TF2 has none of (I think). You can then use a trigger_multiple that sets the !activator's DamageFilter to your filter_godmode:
pthl4V3.png

QBv1VOm.png


This way when people spawn inside of it then are given god mode essentially, and when they leave the area their godmode is taken away (of course configurable). Normally without taking the damage filter away this effect will linger through changing to spectator, so I assume it will last through class changes as well.

For restricting weapons to some areas, I don't think that's possible. You can restrict people to use melee only in some areas by encasing the area in a trigger_add_tf_player_condition with condition 41:
'41 : TF_COND_CANNOT_SWITCH_FROM_MELEE'
And then also do this on the trigger:
'OnStartTouch point_clientcommand slot3'
Which requires a point_clientcommand.

You can also just map-wide restrict weapons by finding the associated class name from here, and sending that a Kill input.