AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Death Controling. (https://forums.alliedmods.net/showthread.php?t=54045)

Styles 04-15-2007 21:51

Death Controling.
 
Hey how would you make it so you can detect if more than one death happened within a 1 second period? Then stop the second and kill them a second later?
I have no idea how to..

Thanks.

stupok 04-15-2007 23:24

Re: Death Controling.
 
Try this:
Code:
#include <amxmodx> #include <amxmisc> #define TIME_PASSED 2 new Float:timer public plugin_init() {     register_plugin("Death Thing", "1.0", "stupok69")     register_event("DeathMsg", "event_DeathMsg", "a") // i forgot if this should be "a" or "b" } public event_DeathMsg() {     new Float:current_time = get_gametime()         if(timer > current_time - TIME_PASSED)     {         //if there is more than one         //death within TIME_PASSED,         //this will be called     }         timer = current_time         return PLUGIN_HANDLED }

Styles 04-16-2007 02:35

Re: Death Controling.
 
I could have gotten that far but where I get lost is how to STOP the damage and reapply it in the next second.

pRED* 04-16-2007 03:13

Re: Death Controling.
 
Really not that easy..

Stopping damage is almost impossible. Look at some of avalanches plugins for info on how to hook tracelines and stop damage that way. But this only can stop damage from guns. Knives and nades are unaffected.

As for applying damage you can use fakemeta's fakedamage, and user_kill etc etc..
Or you can have a look at sawce's ham samwich module which has functions to both stop and create proper damage (not sure how it works.. havn't tried it.)

Styles 04-16-2007 03:27

Re: Death Controling.
 
what about Slowing damage?

VEN 04-16-2007 06:38

Re: Death Controling.
 
You can stop and "emit" actual damage with a Ham Sandwich module (see Modules / Coding section).

Styles 04-16-2007 10:38

Re: Death Controling.
 
Thanks VEN. lol thats a great name! It should be part of the core 100% of the way!


All times are GMT -4. The time now is 06:40.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.