Raised This Month: $12 Target: $400
 3% 

Modify Weapon Damage


Post New Thread Reply   
 
Thread Tools Display Modes
atom0s
Senior Member
Join Date: Jul 2009
Old 08-17-2010 , 08:29   Re: Modify Weapon Damage
Reply With Quote #11

If you alter the data, use Plugin_Changed.

As for the weapon used, you can do the following: (taken from SDKHooks main post)

PHP Code:
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    
decl String:sWeapon[32];
    
GetEdictClassname(inflictorsWeaponsizeof(sWeapon));
    
    if(
StrEqual(sWeapon"tf_weapon_flamethrower"))
    {
        
damage *= 2.0;
        return 
Plugin_Changed;
    }
    
    return 
Plugin_Continue;

atom0s is offline
HeZ
Junior Member
Join Date: Aug 2010
Old 08-17-2010 , 10:59   Re: Modify Weapon Damage
Reply With Quote #12

Ahh beautiful atm0s you are a legend, plugin_continue thats the one lol ive been trying to remember that all day today at uni haha havent had access to the net but i knew i saw it somewhere :p

Is there anywhere i can find a list of classnames for weapons and objects? i have found the classname for the knife is weapon_knife and lots of other classnames for other weapons, but is there a certain library of all class names used in sourcemod anywhere? i cant seem to find one?
like for example specifically knife slash?
Or is that part of the damagetype parameter?
HeZ is offline
atom0s
Senior Member
Join Date: Jul 2009
Old 08-17-2010 , 11:01   Re: Modify Weapon Damage
Reply With Quote #13

Yeah there are lists on the Valve wiki:
http://developer.valvesoftware.com/w...st_of_entities

Scroll to the bottom to view game-specific lists too.
atom0s is offline
sim242
AlliedModders Donor
Join Date: Dec 2012
Location: England
Old 10-06-2014 , 09:12   Re: Modify Weapon Damage
Reply With Quote #14

Sorry for reviving a dead thread, was there never an answer as to how you can check whether it's a left or right click knife?
__________________
Steam - Sim
Request a private plugin
Not accepting requests at this time
sim242 is offline
Send a message via Skype™ to sim242
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 10-06-2014 , 10:15   Re: Modify Weapon Damage
Reply With Quote #15

Quote:
Originally Posted by sim242 View Post
Sorry for reviving a dead thread, was there never an answer as to how you can check whether it's a left or right click knife?
I believe you can't. Your best bet is to check the damage.
15 - left click
55 - right click
75 - left click backstab
155 - right click backstab
These number just for an example, they are probably different. Also i think in CS:S there is no difference between front and back left click attack.

Last edited by xf117; 10-06-2014 at 10:15.
xf117 is offline
Send a message via ICQ to xf117
sim242
AlliedModders Donor
Join Date: Dec 2012
Location: England
Old 10-06-2014 , 11:38   Re: Modify Weapon Damage
Reply With Quote #16

Okay thanks anyway, I'll find out what the values are and do it that way
__________________
Steam - Sim
Request a private plugin
Not accepting requests at this time
sim242 is offline
Send a message via Skype™ to sim242
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 14:50.


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