AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   damage multiplier (https://forums.alliedmods.net/showthread.php?t=193842)

Caldeum 08-23-2012 08:09

damage multiplier
 
How to make 3x damage for hegren and knife and for other weapons 5x?

PHP Code:

            switch( get_user_weaponattacker ) )
            {
                case 
CSW_HEGRENADESetHamParamFloat4damage 3.5 );
                case 
CSW_KNIFESetHamParamFloat4damage 3.5 );
            } 


Torge 08-23-2012 08:23

Re: damage multiplier
 
Isn't it ?

PHP Code:

SetHamParamFloat(4damage 5.0); 


Caldeum 08-23-2012 08:59

Re: damage multiplier
 
Quote:

Originally Posted by Torge (Post 1780057)
Isn't it ?

PHP Code:

SetHamParamFloat(4damage 5.0); 



You mean ?

PHP Code:

switch( get_user_weaponattacker ) )
{
    case 
CSW_HEGRENADESetHamParamFloat4damage 3.5 );
    case 
CSW_KNIFESetHamParamFloat4damage 3.5 );
}  
SetHamParamFloat(4damage 5.0); 


Torge 08-23-2012 09:06

Re: damage multiplier
 
No, if you want it for AK47, here's a example:

PHP Code:

switch (get_user_weapon(attacker))
{
           case 
CSW_AK47SetHamParamFloat(4damage 5.0);

           
// And so on ..



Caldeum 08-23-2012 09:31

Re: damage multiplier
 
i need *5 damage for all weapons not only for ak.

YamiKaitou 08-23-2012 09:33

Re: damage multiplier
 
Use default in your switch statement then

Caldeum 08-23-2012 10:28

Re: damage multiplier
 
Is this will work?

PHP Code:

switch( get_user_weaponattacker ) )
{
    case 
CSW_HEGRENADESetHamParamFloat4damage 3.5 );
    case 
CSW_KNIFESetHamParamFloat4damage 3.5 );
    default 
SetHamParamFloat(4damage 5.0);  



YamiKaitou 08-23-2012 10:37

Re: damage multiplier
 
default: SetHamParamFloat(4, damage * 5.0);


That should work

Exolent[jNr] 08-23-2012 10:41

Re: damage multiplier
 
Also make sure that your hook to Ham_TakeDamage is hooked as "pre".

Caldeum 08-23-2012 11:53

Re: damage multiplier
 
ok thanks guys.

I have one more question about damage. When i attack my team mate (friendlyfire is off) i get message that i make more damage for him how to block it?

PHP Code:

public fwHam victiminflictorattackerFloat:damagedmgbits )
{
    if ( !
enable || victim == attacker || cs_get_user_teamvictim ) == cs_get_user_teamattacker ) )
        return 
PLUGIN_HANDLED

doesn't block the message.
PHP Code:

cs_get_user_teamvictim ) == cs_get_user_teamattacker 



All times are GMT -4. The time now is 05:47.

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