Raised This Month: $52 Target: $400
 13% 

Dmgmult only on right click (knife)


Post New Thread Reply   
 
Thread Tools Display Modes
[email protected]
Veteran Member
Join Date: May 2008
Location: France Marne
Old 10-28-2010 , 13:53   Re: Dmgmult only on right click (knife)
Reply With Quote #11

not in this case.
Fr33m@n is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-28-2010 , 14:51   Re: Dmgmult only on right click (knife)
Reply With Quote #12

Quote:
Originally Posted by [email protected] View Post
not in this case.
It tells him how to use the Ham native and forward. What else does he need to know?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 10-28-2010 , 16:26   Re: Dmgmult only on right click (knife)
Reply With Quote #13

made this quickly, but it should at least give you he basic idea
PHP Code:
// Grim Reaper

#include <superheromod>

new gHeroID;
new 
bool:gHasGrim[SH_MAXSLOTS+1];
//-----------------------------------------------------------------------------
public plugin_init()
{
    
register_plugin("SUPERHERO Grim Reaper""0.1""Random1");
    
    new 
pLevel register_cvar("grimreaper_level""8");
    
    
gHeroID sh_create_hero("Grim Reaper"pLevel);
    
sh_set_hero_info(gHeroID"Rawr!""Knife = 1 Hit KO");
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");
}
//-----------------------------------------------------------------------------
public sh_hero_init(idheroIDmode)
    if ( 
gHeroID == heroID )
        
gHasGrim[id] = mode true false;    
//-----------------------------------------------------------------------------
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
    if (
victim != attacker && is_user_connected(attacker) )
        if ( 
gHasGrim[attacker] && pev(attackerpev_button) & IN_ATTACK2 )
            
SetHamParamFloat(4float(get_user_health(victim))); 
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
[email protected]
Veteran Member
Join Date: May 2008
Location: France Marne
Old 10-28-2010 , 16:36   Re: Dmgmult only on right click (knife)
Reply With Quote #14

Ah thanks G-Dog you saved me. xD
i was'nt so motivate to do it today.
Fr33m@n is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 10-29-2010 , 10:04   Re: Dmgmult only on right click (knife)
Reply With Quote #15

Thanks a lot G-Dog! As I think HAM is more or less impossible to figure out without an explanation, this will probably make me look (even more) like a retard, but..

Does that one include extradamage or does it only show how to make it use right click? I'd guess it includes damage but I don't understand HAM one single bit.

Or does it mean when you say that it should only give me the basic idea that it does not include damage? Damn, I'm confused now..
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 10-29-2010 , 14:09   Re: Dmgmult only on right click (knife)
Reply With Quote #16

Quote:
Originally Posted by Exploited View Post
Thanks a lot G-Dog! As I think HAM is more or less impossible to figure out without an explanation, this will probably make me look (even more) like a retard, but..

Does that one include extradamage or does it only show how to make it use right click? I'd guess it includes damage but I don't understand HAM one single bit.

Or does it mean when you say that it should only give me the basic idea that it does not include damage? Damn, I'm confused now..

Code:
/* header: victim = entity which took damage,         inflictor = entity who caused the damage (usually grenade or player (as there are no bullet entities))         attacker = whoever is the owner of the entity which caused the damage         damage = damage caused         damage_type = type of damage (in bits) */ public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)      if (victim != attacker && is_user_connected(attacker) )  // if victim is not attacker and attacker is connected         if ( gHasGrim[attacker] && pev(attacker, pev_button) & IN_ATTACK2 ) // if attacker has grim and has +attack2 held in             SetHamParamFloat(4, float(get_user_health(victim)))// set parameter 4 (damage) to the health of victim

Should probably also filter for knife, you can hold in whichever key you have bound to +attack2 and still do the extra damage.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 10-29-2010 , 14:45   Re: Dmgmult only on right click (knife)
Reply With Quote #17

So G-Dogs one did do damage? Also, how do I filter for knife in a HAM forward, or does if (get_user_weapon(id) == CSW_M4A1) work?
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 10-29-2010 , 15:00   Re: Dmgmult only on right click (knife)
Reply With Quote #18

Quote:
Originally Posted by Exploited View Post
So G-Dogs one did do damage?
Yes, it does damage by simply altering the damage done to the victims health instead (thus making it always be lethal damage).


Quote:
Originally Posted by Exploited View Post
Also, how do I filter for knife in a HAM forward, or does if (get_user_weapon(id) == CSW_M4A1) work?
That should work, yes. However, it won't work for HE grenades (obviously).
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 10-29-2010 , 15:16   Re: Dmgmult only on right click (knife)
Reply With Quote #19

So this would be a fully functionable Grim Reaper, minus the invisiblity part?

PHP Code:
// Grim Reaper

#include <superheromod>

new gHeroID;
new 
bool:gHasGrim[SH_MAXSLOTS+1];
//-----------------------------------------------------------------------------
public plugin_init()
{
    
register_plugin("SUPERHERO Grim Reaper""0.1""Random1");
    
    new 
pLevel register_cvar("grimreaper_level""8");
    new 
pcvarGrav register_cvar("grimreaper_grav""0.25");
    
    
gHeroID sh_create_hero("Grim Reaper"pLevel);
    
sh_set_hero_info(gHeroID"Rawr!""Knife = 1 Hit KO");
    
sh_set_hero_grav(gHeroIDpcvarGrav);
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");
}
//-----------------------------------------------------------------------------
public sh_hero_init(idheroIDmode)
    if ( 
gHeroID == heroID )
        
gHasGrim[id] = mode true false;    
//-----------------------------------------------------------------------------
public fw_TakeDamage(idvictiminflictorattackerFloat:damagedamage_type)
    if (
victim != attacker && is_user_connected(attacker) && (get_user_weapon(id) == CSW_KNIFE) )
        if ( 
gHasGrim[attacker] && pev(attackerpev_button) & IN_ATTACK2 )
            
SetHamParamFloat(4float(get_user_health(victim))); 
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts

Last edited by Exploited; 10-30-2010 at 13:54.
Exploited is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 10-30-2010 , 14:24   Re: Dmgmult only on right click (knife)
Reply With Quote #20

That didn't compile, so I worked a bit on it to make it compile but it still wont work (the damage).
Heres the results, that compiles:

PHP Code:
// Grim Reaper

#include <superheromod>

new gHeroID;
new 
bool:gHasGrim[SH_MAXSLOTS+1];
//-----------------------------------------------------------------------------
public plugin_init()
{
    
register_plugin("SUPERHERO Grim Reaper""0.1""Random1");
    
    new 
pLevel register_cvar("grimreaper_level""8");
    new 
pcvarGrav register_cvar("grimreaper_grav""0.25");
    
    
gHeroID sh_create_hero("Grim Reaper"pLevel);
    
sh_set_hero_info(gHeroID"Rawr!""Knife = 1 Hit KO");
    
sh_set_hero_grav(gHeroIDpcvarGrav);
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");
}
//-----------------------------------------------------------------------------
public sh_hero_init(idheroIDmode)
    if ( 
gHeroID == heroID )
        
gHasGrim[id] = mode true false;    
//-----------------------------------------------------------------------------
public fw_TakeDamage(idvictiminflictorattackerFloat:damagedamage_type)
    if (
victim != attacker && is_user_connected(attacker) && (get_user_weapon(id) == CSW_KNIFE) )
        if ( 
gHasGrim[attacker] && pev(attackerpev_button) & IN_ATTACK2 )
            
SetHamParamFloat(4float(get_user_health(victim))); 
A question about that HAM thing, is it a instantkill or does it add damage? Maybe the damage isn't high enough? The maxhp on my server is 400.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
Reply


Thread Tools
Display Modes

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 23:53.


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