Raised This Month: $ Target: $400
 0% 

[REQ] Knife double damage - Need edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GraviAnt
Senior Member
Join Date: Oct 2010
Old 12-18-2011 , 08:15   [REQ] Knife double damage - Need edit
Reply With Quote #1

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.

Last edited by GraviAnt; 12-18-2011 at 08:16.
GraviAnt is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-18-2011 , 08:38   Re: [REQ] Knife double damage - Need edit
Reply With Quote #2

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;

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
GraviAnt
Senior Member
Join Date: Oct 2010
Old 12-18-2011 , 09:03   Re: [REQ] Knife double damage - Need edit
Reply With Quote #3

Sorry for bothering, can you make this to work?
I got undefined symbol g_iMaxPlayers...

To write include etc...?
GraviAnt is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-18-2011 , 09:09   Re: [REQ] Knife double damage - Need edit
Reply With Quote #4

Show full code.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
GraviAnt
Senior Member
Join Date: Oct 2010
Old 12-18-2011 , 09:27   Re: [REQ] Knife double damage - Need edit
Reply With Quote #5

That is all I have... Just to double knife damage...
GraviAnt is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-18-2011 , 09:33   Re: [REQ] Knife double damage - Need edit
Reply With Quote #6

Attach your .sma file or post the whole code, or don't ask for help...
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
GraviAnt
Senior Member
Join Date: Oct 2010
Old 12-18-2011 , 09:41   Re: [REQ] Knife double damage - Need edit
Reply With Quote #7

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;


Last edited by GraviAnt; 12-18-2011 at 09:41.
GraviAnt is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-18-2011 , 10:19   Re: [REQ] Knife double damage - Need edit
Reply With Quote #8

Forget it...

Looks like you want to hide something. As if it would be a big plugin...
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
GraviAnt
Senior Member
Join Date: Oct 2010
Old 12-18-2011 , 10:21   Re: [REQ] Knife double damage - Need edit
Reply With Quote #9

I found those in this thread:
http://forums.alliedmods.net/showthread.php?t=82478
GraviAnt is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-18-2011 , 11:09   Re: [REQ] Knife double damage - Need edit
Reply With Quote #10

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;

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
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 20:51.


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