Raised This Month: $51 Target: $400
 12% 

Advanced Bullet Damage


Post New Thread Reply   
 
Thread Tools Display Modes
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-28-2009 , 04:48   Re: Advanced Bullet Damage
Reply With Quote #31

Quote:
Originally Posted by Sn!ff3r View Post
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
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 03-28-2009 at 05:05.
ot_207 is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 03-28-2009 , 05:19   Re: Advanced Bullet Damage
Reply With Quote #32

Quote:
Originally Posted by Sn!ff3r View Post
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).
__________________
In Flames we trust!
Nextra is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-28-2009 , 06:04   Re: Advanced Bullet Damage
Reply With Quote #33

Quote:
Originally Posted by Nextra View Post
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 .
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-28-2009 , 06:52   Re: Advanced Bullet Damage
Reply With Quote #34

Quote:
Originally Posted by ot_207 View Post
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 View Post
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.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-28-2009 at 06:56.
ConnorMcLeod is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 03-28-2009 , 07:32   Re: Advanced Bullet Damage
Reply With Quote #35

Quote:
Originally Posted by ConnorMcLeod View Post
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.
__________________
In Flames we trust!
Nextra is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-28-2009 , 08:21   Re: Advanced Bullet Damage
Reply With Quote #36

Quote:
Originally Posted by ConnorMcLeod View Post
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 ...
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
edga85
BANNED
Join Date: Jan 2009
Old 03-28-2009 , 16:57   Re: Advanced Bullet Damage
Reply With Quote #37

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???
Attached Files
File Type: sma Get Plugin or Get Source (fragmatch.sma - 672 views - 2.4 KB)
edga85 is offline
Send a message via Skype™ to edga85
edga85
BANNED
Join Date: Jan 2009
Old 03-30-2009 , 05:40   Re: Advanced Bullet Damage
Reply With Quote #38

So can somebody help???
edga85 is offline
Send a message via Skype™ to edga85
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 04-04-2009 , 05:48   Re: Advanced Bullet Damage
Reply With Quote #39

Quote:
Originally Posted by edga85 View Post
So can somebody help???
Ask in the scripting help section. Your question is offtopic.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
deejay87
Senior Member
Join Date: Apr 2004
Location: Pays du Glaude - France
Old 06-10-2009 , 06:55   Re: Advanced Bullet Damage
Reply With Quote #40

abd.sma :
Code:
 
#define VERSION "1.0"
1.0 ? 1.1 ? ;)
__________________
deejay87 is offline
Send a message via MSN to deejay87 Send a message via Skype™ to deejay87
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:35.


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