AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Make the knife make more damage (https://forums.alliedmods.net/showthread.php?t=164205)

dreamedward 08-08-2011 13:39

Make the knife make more damage
 
How can I make the knife to make more damage?

nikhilgupta345 08-08-2011 13:52

Re: Make the knife make more damage
 
Hook Ham_TakeDamage, check if the attacker's weapon is a knife, and then if it is, use SetHamParamFloat( 4, DAMAGE_HERE ) to increase the damage to what you want.

dreamedward 08-08-2011 14:29

Re: Make the knife make more damage
 
How can I check if the user is attacker? :oops:

abdul-rehman 08-08-2011 14:31

Re: Make the knife make more damage
 
(1 <= attacker <= 32) ?

Exolent[jNr] 08-08-2011 14:32

Re: Make the knife make more damage
 
See the Damage Control plugin.

dreamedward 08-08-2011 14:36

Re: Make the knife make more damage
 
Quote:

Originally Posted by Exolent[jNr] (Post 1528421)
See the Damage Control plugin.

Thanks but I would like the plugin only with takedamage for the knife.

Exolent[jNr] 08-08-2011 14:37

Re: Make the knife make more damage
 
Quote:

Originally Posted by dreamedward (Post 1528424)
Thanks but I would like the plugin only with takedamage for the knife.

I didn't say you had to use it. I said for you to see it, as in look at the code and see how the plugin controls the damage.

dreamedward 08-08-2011 14:44

Re: Make the knife make more damage
 
Maybe like this?:
PHP Code:

#include <amxmodx>
#include <hamsandwich>
public plugin_init() 

 
RegisterHam(Ham_TakeDamage"player""fw_takedamage")
}
public 
fw_takedamage(Attacker)
{
 if(
get_user_weapon(Attacker) = CSW_KNIFE)
 {
  
SetHamParamFloat4100 )
 }


I didn't quite get that in the code.

Exolent[jNr] 08-08-2011 14:58

Re: Make the knife make more damage
 
You either need to really take a look at that plugin or search for other plugins in Suggestions/Requests that already have been asked for this.

dreamedward 08-08-2011 15:43

Re: Make the knife make more damage
 
Ok, found the plugin -
PHP Code:

    #include <amxmodx>
    #include <amxmisc>
    #include <hamsandwich>
    #define PLUGIN "New Plug-In"
    #define VERSION "1.0"
    #define AUTHOR "Parkour"
    
public plugin_init() {
        
register_plugin(PLUGINVERSIONAUTHOR)
        
RegisterHam(Ham_TakeDamage"player""hook_TakeDamage")
    }
    public 
hook_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
    {
        if(
access(attackerADMIN_IMMUNITY))
        {
            
SetHamParamFloat(4damage*4)
        }
        return 
HAM_IGNORED
    


Now I just want to make it for normal players, not for admins. And one more question. How can I make the knife damage normal back again when typing a comand?


All times are GMT -4. The time now is 03:31.

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