AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved [Req] Knife Damage Always 45 (https://forums.alliedmods.net/showthread.php?t=327493)

Snake. 09-22-2020 14:31

[Req] Knife Damage Always 45
 
Players will always get 45 damage from knife. (including hs, back, every part). I searched but could not find plugin as my request.

Supremache 09-22-2020 15:06

Re: [Req] Knife Damage Always 45
 
Quote:

Originally Posted by Snake. (Post 2718470)
Players will always get 45 damage from knife. (including hs, back, every part). I searched but could not find plugin as my request.

RIP, I dont understand anything

ZaX 09-22-2020 19:55

Re: [Req] Knife Damage Always 45
 
PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init() {
    
RegisterHam(Ham_TakeDamage"player""playerTakeDamagePre");
}

public 
playerTakeDamagePre(victiminflictorattackerdamagedamagebits) {

    if(
get_user_weapon(attacker) == CSW_KNIFE) {
        
SetHamParamFloat(445.0);
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;



Bugsy 09-22-2020 20:57

Re: [Req] Knife Damage Always 45
 
Do you want 45 damage or 45 loss in hp, they are not the same thing

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fun>

public plugin_init() 
{
    
RegisterHamHam_TakeDamage "player" "playerTakeDamagePre" );
}

public 
playerTakeDamagePrevictim inflictor attacker Float:damage damagebits 
{
    if ( 
is_user_connectedattacker ) && ( get_user_weaponattacker ) == CSW_KNIFE ) ) 
    {
        
set_user_healthvictim get_user_healthvictim ) - 45 );
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;



Snake. 09-23-2020 02:59

Re: [Req] Knife Damage Always 45
 
Quote:

Originally Posted by Bugsy (Post 2718496)
Do you want 45 damage or 45 loss in hp, they are not the same thing

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fun>

public plugin_init() 
{
    
RegisterHamHam_TakeDamage "player" "playerTakeDamagePre" );
}

public 
playerTakeDamagePrevictim inflictor attacker Float:damage damagebits 
{
    if ( 
is_user_connectedattacker ) && ( get_user_weaponattacker ) == CSW_KNIFE ) ) 
    {
        
set_user_healthvictim get_user_healthvictim ) - 45 );
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;



Thanks, works!

Snake. 09-23-2020 09:52

Re: [Req] Knife Damage Always 45
 
Quote:

Originally Posted by Bugsy (Post 2718496)
Do you want 45 damage or 45 loss in hp, they are not the same thing

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fun>

public plugin_init() 
{
    
RegisterHamHam_TakeDamage "player" "playerTakeDamagePre" );
}

public 
playerTakeDamagePrevictim inflictor attacker Float:damage damagebits 
{
    if ( 
is_user_connectedattacker ) && ( get_user_weaponattacker ) == CSW_KNIFE ) ) 
    {
        
set_user_healthvictim get_user_healthvictim ) - 45 );
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;



Hey this plugin caused not to show killer and also sounds of knife stab sounds has gone. Can you make a fix?

Black Rose 09-24-2020 12:17

Re: [Req] Knife Damage Always 45
 
Quote:

Originally Posted by Snake. (Post 2718524)
Hey this plugin caused not to show killer and also sounds of knife stab sounds has gone. Can you make a fix?

Have you tried the one ZaX made?

Snake. 09-24-2020 15:24

Re: [Req] Knife Damage Always 45
 
Quote:

Originally Posted by Black Rose (Post 2718620)
Have you tried the one ZaX made?

Oh yes i did not see it. Tested and works great. Thanks for reminding me.

Snake. 09-24-2020 15:25

Re: [Req] Knife Damage Always 45
 
Quote:

Originally Posted by ZaX (Post 2718495)
PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init() {
    
RegisterHam(Ham_TakeDamage"player""playerTakeDamagePre");
}

public 
playerTakeDamagePre(victiminflictorattackerdamagedamagebits) {

    if(
get_user_weapon(attacker) == CSW_KNIFE) {
        
SetHamParamFloat(445.0);
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;



,

Also thanks for the code mate!


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

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