AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Damage Event (https://forums.alliedmods.net/showthread.php?t=253346)

BhK 12-20-2014 11:54

[Help] Damage Event
 
I want to get the hit place on damage,
Using these:-
PHP Code:

register_event("Damage""On_Damage""b""2>0"

i don't want to use CSX Module !
:)

YamiKaitou 12-20-2014 11:55

Re: [Help] Damage Event
 
Quote:

Originally Posted by BhK (Post 2237609)
i don't want to use CSX Module !

Why?

BhK 12-20-2014 11:59

Re: [Help] Damage Event
 
I know it is done with CSX Module, but i want to know if it is possible to do it without CSX !

Bugsy 12-20-2014 12:17

Re: [Help] Damage Event
 
Yes, with Ham Sandwich :lol:

HamletEagle 12-20-2014 12:29

Re: [Help] Damage Event
 
Quote:

Originally Posted by Bugsy (Post 2237621)
Yes, with Ham Sandwich :lol:

Bugsy is back :fox:

Ham_TakeDamage is an alternative.

BhK 12-20-2014 13:20

Re: [Help] Damage Event
 
Quote:

Originally Posted by Bugsy (Post 2237621)
Yes, with Ham Sandwich :lol:

Thanks,
After searching i have made these, tell if something going wrong !
Its working

PHP Code:

#define OFFSET_LAST_HIT_GROUP      75 
#define EXTRAOFFSET_PL_LINUX        5 

public fw_takedamage(victiminflictorattackerFloat:damagebits
{
    if(!
is_user_connectedattacker ) || inflictor != attacker)
        return 
HAM_IGNORED;
    
    new  
hitgroup get_pdata_int(victimOFFSET_LAST_HIT_GROUPEXTRAOFFSET_PL_LINUX
    
    switch( 
hitgroup )
    {
        case 
HIT_HEAD
        {
            
client_print(attackerprint_center"Head")
        }
        case 
HIT_CHEST
        {
            
client_print(attackerprint_center"Chest")
        }
        case 
HIT_STOMACH
        {
            
client_print(attackerprint_center"Stomach")
        }
        
// etc
    
}
    return 
HAM_IGNORED;


:)

Kuma77 12-20-2014 13:33

Re: [Help] Damage Event
 
Make sure you write :)

PHP Code:

#include <hamsandwich>
public plugin_init()
{
     
RegisterHam("Ham_TakeDamage""player""fw_takedamage")



Bugsy 12-20-2014 13:35

Re: [Help] Damage Event
 
What are your intentions with this?
PHP Code:

if( !is_user_connectedattacker ) || inflictor != attacker )
        return 
HAM_IGNORED


BhK 12-20-2014 13:52

Re: [Help] Damage Event
 
Quote:

Originally Posted by Bugsy (Post 2237650)
What are your intentions with this?
PHP Code:

if( !is_user_connectedattacker ) || inflictor != attacker )
        return 
HAM_IGNORED


Checking if attacker is connected and the damage is done by the attacker !
is something wrong ?
Or should I only write ?
PHP Code:

if( inflictor != attacker )
        return 
HAM_IGNORED


Bugsy 12-20-2014 14:13

Re: [Help] Damage Event
 
Quote:

Originally Posted by BhK (Post 2237664)
Checking if attacker is connected and the damage is done by the attacker !
is something wrong ?
Or should I only write ?
PHP Code:

if( inflictor != attacker )
        return 
HAM_IGNORED


Why are you using inflictor? inflictor is the same as attacker except for when it's grenade damage. I'm guessing you want to check that the victim was hurt by another player? Better to compare victim to attacker.
PHP Code:

if ( !is_user_connectedattacker ) || ( victim == attacker ) )
        return 
HAM_IGNORED



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

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