View Single Post
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-12-2014 , 01:05   Re: Create "Dueling Box"
Reply With Quote #6

Quote:
Originally Posted by thetwistedpanda View Post
Hmm, you could probably piece it together with code from several plugins, but I'd do the following:

Create a Trigger Multiple entity, then hook it for OnTouch or OnStartTouch and use that method for ensuring only your two dueling players are allowed. Hook OnEndTouch to see if your duelers leave the box. Use Temp Ents (the beam, see Timer for some usable code) to create a visible box around the trigger entity. For the repelling, you could go for complicated and create a series of push entities around it, or go the math route and use TeleportEntity with vector funness. As for the weapon discharge, I'm going to assume you mean preventing players from outside the box from injuring the ones inside, in which case you can hook OnTakeDamage or TraceAttack and see if both players are within the box, and if not, nullify the damage.
Maths are the obvious best choice here.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline