SpawnProtect and MirrorDMG examples for new API?
(I originally posted this in wrong forum, but may leave it there to see what replies I can get)
Would someone mind giving me any good examples on how to CATCH and BLOCK a damage event? Right now I'm just using the normal damage event, getting attacker and victim, and afterwards setting the health back and applying the dmg to the attacker (for team attacking at least) Could someone be kind enough to provide me with an example that uses the NEW engine/fakemeta natives to block the event completely, alter the data, then pass it on? |
why?
Sorry, but I don't really understand what do you wish to do :shock: ? I suppose you do something similar, but if you block the event, I think it will prevent the function to execute a new time if an other player TA while this event won't be finished.
Code:
Excuse me if I don't undestand your question, I am not an expert :( , but I know those subjects about TA, Tk and Spawn protection because I've worked a lot to create DOD FF Manager, which has still bugs remaining I don't manage to solve :evil: http://forums.alliedmods.net/showthread.php?t=5785 Please have a look if you have the time, maybe you will find the errors :wink: It will be very nice! My team is impatient to put the plugin on the server :) |
Blocking the Damage event seems to be a bad idea for me; it only notifies the client of what has happened AFAIK. If you want to block the actual damage, you would have to think of something else. Anyway try the engine module's register_message function.
|
You cannot block damage easily.
With fakemeta_amxx-0.20-20040914 build, I included the ability to hook and abstract TraceLine(), so in theory you could block traces and therefore block damage. Otherwise the only way to do it is to catch the damage message, give the player tons of health, and hope they don't die. |
wow, guess you weren't planning anyone wanting to block damage :?
|
Damage is handled entirely by the mod. There's no true way to actually block it, as Metamod (and thus AMX Mod X) can only hook stuff which is sent between the engine and the mod's game dll.
There are, however, a couple kinda hacky ways to block it. Such as blocking events which trigger damage. Some examples would be hooking traceline, which is used for hitscan weapons, or detecting when a grenade is about to explode and stop it, and handle it on your own. Also there's a method which involves setting the players health to an extremely high amount (such as 1024 + actual health), and monitor it from there. |
Re: why?
Quote:
So basically the SDK hasn't provided a way to hook damage events, and the current way you guys are even handling these things are through your special programming magic...understandable. I was hoping that I could block the event from happening or handle it myself so I could get past this small flaw. |
Re: why?
Quote:
...or you could set up a small line to make sure they are ALIVE before doing anything. Lose a feature, lose a bug I suppose. |
oh god i cant wait dor the day I and T(+)rget..........................*im not saying anything else* :D
|
| All times are GMT -4. The time now is 17:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.