AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Advanced Bullet Damage (https://forums.alliedmods.net/showthread.php?t=88577)

Sn!ff3r 03-26-2009 16:40

Advanced Bullet Damage
 
1 Attachment(s)
Advanced Bullet Damage


Description:
Remake of oryginal bullet damage plugin. This addon shows damage done by each bullet to attacker, and optionally shows damage received. Additionally, showing damage took via wall can be disabled, to eliminate wallhack syndrome.

Tested only in Counter Strike, but should work on other mods.
CVAR's
PHP Code:

amx_bulletdamage_recieved "1" // enable or disable showing recieved damage
amx_bulletdamage "1" // 0 - plugin disabled, 1 - show damage done, 2 - show damage done, but not via wall! 


Modules
fakemeta
Changelog
1.0 - First Relase
1.1 - Some mistakes

mando127 03-26-2009 17:39

Re: Advanced Bullet Damage
 
nice works good test on my zombie server.

Nextra 03-26-2009 18:44

Re: Advanced Bullet Damage
 
Well done. I just wanted to point out that fm_is_ent_visible will return false negatives relatively often (at least there are many common situations where it will due to the origin comparison).
Anyway, a cvar for displaying chat messages instead of hud messages would be nice to have I believe.

Arkshine 03-26-2009 19:05

Re: Advanced Bullet Damage
 
Nothing to say more that Nextra has already said. :p

Nextra 03-26-2009 19:13

Re: Advanced Bullet Damage
 
You could come up with a neat measure to get rid of those false positives :)

I believe there is a possibility by catching the shot event and comparing traceline hit origins with fm_is_visible but it's too late for that now ;)

M1R0n,M' 03-27-2009 07:14

Re: Advanced Bullet Damage
 
Good :)

ConnorMcLeod 03-27-2009 07:47

Re: Advanced Bullet Damage
 
I think you should check if attacker is a player + ingame before you send a hudmessage.

Arkshine 03-27-2009 07:57

Re: Advanced Bullet Damage
 
I don't think it needs because there are already a check in the native. So it doesn't matter, it will not generate an error.

AcidoX 03-27-2009 08:41

Re: Advanced Bullet Damage
 
1 Attachment(s)
You can add stocks to your source file, not include all fakemeta_util file.

M1R0n,M' 03-27-2009 09:16

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by AcidoX (Post 790123)
You can add stocks to your source file, not include all fakemeta_util file.

#include <xs> ??

Arkshine 03-27-2009 09:19

Re: Advanced Bullet Damage
 
He says that he can add directly the function he used in its script from fakemeta_util, instead of including fakemeta_util. Xs is not related at all here, M1R0n,M'.

M1R0n,M' 03-27-2009 09:24

Re: Advanced Bullet Damage
 
omg sorry, my bad.

YamiKaitou 03-27-2009 09:38

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by AcidoX (Post 790123)
You can add stocks to your source file, not include all fakemeta_util file.

Why? To me, there is no point in doing that since fakemeta_util is a standard part of the 1.8.x package

Arkshine 03-27-2009 09:48

Re: Advanced Bullet Damage
 
Indeed. It seems the plugin size increases of 1 ko just by including fakemeta_util ( it should not ) but it doesn't matter, it's extremely trivial.

AcidoX 03-27-2009 11:23

Re: Advanced Bullet Damage
 
Well, there are people that dont have fm util, and complaining. Thats the difference.

Arkshine 03-27-2009 11:41

Re: Advanced Bullet Damage
 
Like said Yami' fakemeta_util is already included in amxx 1.8, so I don't see the problem, AcidoX. ( It works with the webcompiler )

stylerro 03-27-2009 11:43

Re: Advanced Bullet Damage
 
i got this error after 5 min :
L 03/27/2009 - 17:40:56: Start of error session.
L 03/27/2009 - 17:40:56: Info (map "fy_snow") (file "addons/amxmodx/logs/error_20090327.log")
L 03/27/2009 - 17:40:56: Invalid player id 141
L 03/27/2009 - 17:40:56: [AMXX] Displaying debug trace (plugin "abd.amxx")
L 03/27/2009 - 17:40:56: [AMXX] Run time error 10: native error (native "ShowSyncHudMsg")
L 03/27/2009 - 17:40:56: [AMXX] [0] 39533.attach::on_damage (line 48)

Arkshine 03-27-2009 12:00

Re: Advanced Bullet Damage
 
Attacker is not filtered to be between 1 and max_clients, since entity from get_user_attacker() can be a non-player.

crazyeffect 03-27-2009 12:13

Re: Advanced Bullet Damage
 
Looks cool :D

Sn!ff3r 03-27-2009 12:45

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by arkshine (Post 790273)
Attacker is not filtered to be between 1 and max_clients, since entity from get_user_attacker() can be a non-player.

Oops :o

Fixed ;)

ConnorMcLeod 03-27-2009 12:46

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by arkshine (Post 790273)
Attacker is not filtered to be between 1 and max_clients, since entity from get_user_attacker() can be a non-player.

That's what i said :)

Arkshine 03-27-2009 12:58

Re: Advanced Bullet Damage
 
I was talking about 'ingame'. For that no need. I was read 'player is ingame' and not 'player + ingame'. But whatever.

hleV 03-27-2009 13:14

Re: Advanced Bullet Damage
 
Code:
  static attacker; attacker = get_user_attacker(id)   static damage; damage = read_data(2)
Wouldn't it be better to make it like this?
Code:
static attacker, damage; attacker = get_user_attacker(id) damage = read_data(2)

Sn!ff3r 03-27-2009 13:58

Re: Advanced Bullet Damage
 
No matter.

anakin_cstrike 03-27-2009 15:33

Re: Advanced Bullet Damage
 
Shit, i thought of making a new bullet damage. Nvm, i'll make a new one anyway :P

joaquimandrade 03-27-2009 16:05

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by anakin_cstrike (Post 790436)
Shit, i thought of making a new bullet damage. Nvm, i'll make a new one anyway :P

Anakin is alive.

ConnorMcLeod 03-27-2009 16:05

Re: Advanced Bullet Damage
 
Sn!ff3r, you could implement the "circle" effect i made in this version :
http://forums.alliedmods.net/showthr...921#post719921

ot_207 03-27-2009 19:13

Re: Advanced Bullet Damage
 
Suggestion:
Use Ham_TraceAttack

Sn!ff3r 03-27-2009 20:40

Re: Advanced Bullet Damage
 
No. Hamsandwich here is useless. In traceattack I must filter damagetype etc, in Damage event this is already done.

Quote:

Originally Posted by ConnorMcLeod (Post 790467)
Sn!ff3r, you could implement the "circle" effect i made in this version :
http://forums.alliedmods.net/showthr...921#post719921

I would do this.

anakin_cstrike 03-28-2009 04:09

Re: Advanced Bullet Damage
 
I've done a simplistic bullet damge a while ago, in wich i'm using Take_Damage from HAM and it works very well.

ot_207 03-28-2009 04:48

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by Sn!ff3r (Post 790664)
No. Hamsandwich here is useless. In traceattack I must filter damagetype etc, in Damage event this is already done.

I would do this.

I will be right back with the code example :).

PHP Code:

#define MAXPLAYERS 32
new Float:client_hit_origin[MAXPLAYERS 1][3]
public 
plugin_init()
{
    
RegisterHam(Ham_TraceAttack,"player","fw_traceattack_post",1)
    
register_event("Damage""on_damage""b""2!0""3=0""4!0")
}

public 
fw_traceattack_post(victim,attacker,Float:damage,Float:direction[3],tracehandle,dmgbits)
{
    
get_tr2(tracehandle,TR_vecEndPos,client_hit_origin[victim])
    return 
HAM_IGNORED
}

public 
on_damage(id)
{    
    static 
attackerattacker get_user_attacker(id)
    static 
damagedamage read_data(2)        
    if(
g_showrecieved)
    {            
        
set_hudmessage(255000.450.5020.14.00.10.1, -1)
        
ShowSyncHudMsg(idg_hudmsg2"%i^n"damage)        
    }
    if(
is_user_connected(attacker))
    {
        switch(
g_enabled)
        {
        case 
1: {
                
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
                
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage)                
            }
        case 
2: {
                if(
fm_is_point_visible(attacker,client_hit_origin[id]))
                {
                
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
                
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage)                
                }
            }
        }
    }
}
stock bool:fm_is_point_visible(indexFloat:dest[3], ignoremonsters 0) {
    new 
Float:start[3];
    
pev(indexpev_originstart);
    
pev(indexpev_view_ofsdest);
    
xs_vec_add(startdeststart);

    
engfunc(EngFunc_TraceLinestartdestignoremonstersindex0);

    new 
Float:fraction;
    
get_tr2(0TR_flFractionfraction);
    if (
fraction == 1.0 || get_tr2(0TR_pHit) == entity)
        return 
true;

    return 
false;


Hope it works, I wrote it a little bit fast

Nextra 03-28-2009 05:19

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by Sn!ff3r (Post 790664)
No. Hamsandwich here is useless. In traceattack I must filter damagetype etc, in Damage event this is already done.

TraceAttack is nice because, if you do it the way ot_207 did it, you will not have false positives from is_ent_visible due to exact hitplace origin comparison. This is infinitely more accurate (assuming his code example is in working state).

ot_207 03-28-2009 06:04

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by Nextra (Post 791026)
TraceAttack is nice because, if you do it the way ot_207 did it, you will not have false positives from is_ent_visible due to exact hitplace origin comparison. This is infinitely more accurate (assuming his code example is in working state).

Thanks :). I haven't tested it yet, I am busy with my nanosuit plugin. Sniffer, it is your job to test it, if you have questions feel free to ask :).

ConnorMcLeod 03-28-2009 06:52

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by ot_207 (Post 791011)
I will be right back with the code example :).

If you want to know the hitplace, you can just check the player offset m_LastHitGroup (75 in cs1.6/cz) in the Damage event, then you don't need to hook traceattack.
-edit-
You won't get the origin though
-edit-


Quote:

Originally Posted by Nextra (Post 791026)
TraceAttack is nice because, if you do it the way ot_207 did it, you will not have false positives from is_ent_visible due to exact hitplace origin comparison. This is infinitely more accurate (assuming his code example is in working state).

Hmm, you can shot at someone's leg but only see his head.

Nextra 03-28-2009 07:32

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by ConnorMcLeod (Post 791080)
Hmm, you can shot at someone's leg but only see his head.

As we all know a 100% accurate fm_is_ent_visible is not possible. But if you want to find out whether you made a hit through a wall or not fm_is_visible (+ hit origin) will be close or even equal to 100% accuracy in that respect. Certainly a lot better than fm_is_ent_visible which will fail in many more common situations.

ot_207 03-28-2009 08:21

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by ConnorMcLeod (Post 791080)
If you want to know the hitplace, you can just check the player offset m_LastHitGroup (75 in cs1.6/cz) in the Damage

Oh lol. I forgot about that offset. It simplifies the code a lot.
And btw. it is better that simple fm_is_ent_visible, that function would have a better name like fm_is_point_visible rather than ent_visible. If you want to check all the bones of the player to see wether the player is visible, that would do it but is uses a lot of cpu power ...

edga85 03-28-2009 16:57

Re: Advanced Bullet Damage
 
1 Attachment(s)
Look i have this plugin
And with it this plugin bugs i think that two hudmessages can you fix this that will not bugs with fragmatch.amxx???

edga85 03-30-2009 05:40

Re: Advanced Bullet Damage
 
So can somebody help??? :(

ot_207 04-04-2009 05:48

Re: Advanced Bullet Damage
 
Quote:

Originally Posted by edga85 (Post 793023)
So can somebody help??? :(

Ask in the scripting help section. Your question is offtopic.

deejay87 06-10-2009 06:55

Re: Advanced Bullet Damage
 
abd.sma :
Code:


#define VERSION "1.0"

1.0 ? 1.1 ? ;)


All times are GMT -4. The time now is 15:41.

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