AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] Knife double damage - Need edit (https://forums.alliedmods.net/showthread.php?t=174279)

GraviAnt 12-18-2011 08:15

[REQ] Knife double damage - Need edit
 
Can somebody make this for CT's only? (Humans)

Code:
public Player_TakeDamage(id, inflictor, attacker, Float:damage, damagebits) {     if(    !(1 <= attacker <= g_iMaxPlayers)       ||    attacker != inflictor     ||    get_user_weapon(attacker) != CSW_KNIFE    )         return HAM_IGNORED;       SetHamParamFloat(4, damage * 2); //Here knife does double damage, ofc you can set it to 0.0 or anything.     return HAM_HANDLED; }

I need it for zombie server.

bibu 12-18-2011 08:38

Re: [REQ] Knife double damage - Need edit
 
Don't forget to include cstrike:

PHP Code:

public Player_TakeDamage(idinflictorattackerFloat:damagedamagebits

    if(    !(
<= attacker <= g_iMaxPlayers)  
    ||    
attacker != inflictor 
    
||    get_user_weapon(attacker) != CSW_KNIFE
    
||    cs_get_user_team(attacker) != CS_TEAM_CT    
        return 
HAM_IGNORED
  
    
SetHamParamFloat(4damage 2); //Here knife does double damage, ofc you can set it to 0.0 or anything. 
    
return HAM_HANDLED;



GraviAnt 12-18-2011 09:03

Re: [REQ] Knife double damage - Need edit
 
Sorry for bothering, can you make this to work?
I got undefined symbol g_iMaxPlayers...

To write include etc...? :)

bibu 12-18-2011 09:09

Re: [REQ] Knife double damage - Need edit
 
Show full code.

GraviAnt 12-18-2011 09:27

Re: [REQ] Knife double damage - Need edit
 
That is all I have... Just to double knife damage...

ConnorMcLeod 12-18-2011 09:33

Re: [REQ] Knife double damage - Need edit
 
Attach your .sma file or post the whole code, or don't ask for help...

GraviAnt 12-18-2011 09:41

Re: [REQ] Knife double damage - Need edit
 
Is this ok?

PHP Code:

#include <amxmodx>
#include <hamsandwich>
 
public plugin_init()
{
   
RegisterHam(Ham_TakeDamage"player""Function");
}
 
public 
Player_TakeDamage(idinflictorattackerFloat:damagedamagebits

    if(    !(
<= attacker <= g_iMaxPlayers)  
    ||    
attacker != inflictor 
    
||    get_user_weapon(attacker) != CSW_KNIFE
    
||    cs_get_user_team(attacker) != CS_TEAM_CT    
        return 
HAM_IGNORED
  
    
SetHamParamFloat(4damage 2); //Here knife does double damage, ofc you can set it to 0.0 or anything. 
    
return HAM_HANDLED;



bibu 12-18-2011 10:19

Re: [REQ] Knife double damage - Need edit
 
Forget it...

Looks like you want to hide something. As if it would be a big plugin... :3

GraviAnt 12-18-2011 10:21

Re: [REQ] Knife double damage - Need edit
 
I found those in this thread:
http://forums.alliedmods.net/showthread.php?t=82478

bibu 12-18-2011 11:09

Re: [REQ] Knife double damage - Need edit
 
Try this:

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

new g_iMaxPlayers;
 
public 
plugin_init()
{
   
register_plugin("Double Knife Damage""1.0""AMXX Community")
    
   
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage");
   
   
g_iMaxPlayers get_maxplayers();
}
 
public 
Player_TakeDamage(idinflictorattackerFloat:damagedamagebits)
{
    if(    !(
<= attacker <= g_iMaxPlayers
    ||    
attacker != inflictor
    
||    cs_get_user_team(attacker) != CS_TEAM_CT
    
||    get_user_weapon(attacker) != CSW_KNIFE    )
        return 
HAM_IGNORED;
 
    
SetHamParamFloat(4damage 2); //Here knife does double damage, ofc you can set it to 0.0 or anything.
    
return HAM_HANDLED;




All times are GMT -4. The time now is 20:51.

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