Create "Dueling Box"
A while ago I saw a plugin (on Pink Taco I believe) that created a box that would allow certain players in and repel the other players.
Is there any plugin (with public sourcecode) that does this? (I've looked :|) If not, what would be the steps to create such a plugin? And also, would it be possible to prevent weapons discharge entering the box? |
Re: Create "Dueling Box"
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. |
Re: Create "Dueling Box"
I think I understood most of what you said (and I know from experience how to do a few of those), but the one that goes straight past me is
Quote:
Would a quick explanation or a link to something explaining what that is be possible? :) Also, I meant stopping the weapon projectiles from entering the box (hooking the collision then destroying them?) |
Re: Create "Dueling Box"
I did something like this recently. Not sure what of it you'd be able to utilize. Also here's hoping you have at least basic sourcepawn knowledge.
also i've REALLY cleaned up my stock brush-creating code since I released that plugin |
Re: Create "Dueling Box"
|
Re: Create "Dueling Box"
Quote:
|
Re: Create "Dueling Box"
Thanks for the replies guys!
I tried putting something together using your code (really dodgy) and it just crashes the server. Code:
#pragma semicolon 1 |
Re: Create "Dueling Box"
Look into timer-mapzones.sp: https://forums.alliedmods.net/showth...99#post2074699
There is a zonetype called ZtArena you could use this source to create your plugin. |
Re: Create "Dueling Box"
Or this :P
Set 'no shoot' punishment and edit it within OnTouch callback, set booleans for both players that 'InZone[activator] = true' and set InZone[activator] = false appropriately when players enters/leaves zone and check those booleans in TraceAttack/OnTakeDamage like this Code:
|
Re: Create "Dueling Box"
Thanks for all the responses!
In the end I went with root's plugin. However I had a small problem :( I tried to compile it (to see if I could add some changes) and I got a tonne of errors: Mostly:sm_zones.sp(184) error 017: undefined symbol "Engine_CSS" And so on. All the undefined symbols :| |
All times are GMT -4. The time now is 08:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.