Raised This Month: $32 Target: $400
 8% 

Knife API v2.2


Post New Thread Reply   
 
Thread Tools Display Modes
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-13-2014 , 04:48   Re: Knife API
Reply With Quote #11

Nice and useful API! I'm sure lots of people will find this useful too.
Just one suggestion, I feel it will be better like this.
PHP Code:
.primarydamage 15.0,
.
secondarydamage 55.0
How about making these 2 parameters be multipliers actually? So the default will be 1.0. The way you have it now, backstabs and headshots will deal always the same damage. Make them multipliers, or maybe you could set the damage in Ham_TraceAttack(FM_TraceLine) pre-forward and it should take in account all multiplying CS Engine does, although I am not sure about this one.

Last edited by klippy; 05-13-2014 at 04:49.
klippy is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 05-13-2014 , 06:07   Re: Knife API
Reply With Quote #12

Interesting plugin.
I am currently working on a shop system that features knives and player skins, I will definitely be using this for the skins knives.
But I dislike the knives switching feature, I guess I'll remove it myself.
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]

Last edited by tonykaram1993; 05-13-2014 at 06:10.
tonykaram1993 is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-13-2014 , 06:22   Re: Knife API
Reply With Quote #13

Quote:
Originally Posted by KliPPy View Post
Nice and useful API! I'm sure lots of people will find this useful too.
Just one suggestion, I feel it will be better like this.
PHP Code:
.primarydamage 15.0,
.
secondarydamage 55.0
How about making these 2 parameters be multipliers actually? So the default will be 1.0. The way you have it now, backstabs and headshots will deal always the same damage. Make them multipliers, or maybe you could set the damage in Ham_TraceAttack(FM_TraceLine) pre-forward and it should take in account all multiplying CS Engine does, although I am not sure about this one.
It won't be always the same, this is the base damage before application. You modify this and THEN it will take hitbox into account, so backstabs and headshots will still deal more damage, the engine calculation is unaffected. You're just changing the parameters it uses for those calculations.

Quote:
Originally Posted by tonykaram1993 View Post
But I dislike the knives switching feature, I guess I'll remove it myself.
I'll think about adding a cvar, though it's nice for the players to be able to switch to the default weapon (hands) for duels and such, so it's more fair. Maybe a native to return the amount of knives the player has would be enough? So you can check and if they have 1, you just prevent them from buying the weapon. That way they will only be allowed to have one knife but still switch between hands.
__________________
Currently busy working on a very large scale anime database project.

Last edited by Backstabnoob; 05-13-2014 at 06:27.
Backstabnoob is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-13-2014 , 10:27   Re: Knife API
Reply With Quote #14

Test it please if you haven't yet. TraceAttack is called before all calculations, and TakeDamage is called from TraceAttack, after all calculations are done.

Last edited by klippy; 05-13-2014 at 10:27.
klippy is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-13-2014 , 11:10   Re: Knife API
Reply With Quote #15

Quote:
Originally Posted by KliPPy View Post
Test it please if you haven't yet. TraceAttack is called before all calculations, and TakeDamage is called from TraceAttack, after all calculations are done.
I did test it and it works as I said. I'm not sure how the two events work but I think TraceAttack just determines the hitzones and initial damage, then passes the data to TakeDamage in this format. If you modify the damage in TakeDamage, it will still deal damage based on hitboxes.

Feel free to download the plugin and go try it out.

Edit: You're right, sorry. I take that back, I'll fix it in the next version (gonna hook TraceAttack instead).
__________________
Currently busy working on a very large scale anime database project.

Last edited by Backstabnoob; 05-13-2014 at 11:45.
Backstabnoob is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-13-2014 , 13:28   Re: Knife API
Reply With Quote #16

Version 1.1 has been released.


Quote:
Originally Posted by KliPPy
Test it please if you haven't yet. TraceAttack is called before all calculations, and TakeDamage is called from TraceAttack, after all calculations are done.
Thanks for pointing it out, fixed.

Quote:
Originally Posted by tonykaram1993
But I dislike the knives switching feature, I guess I'll remove it myself.
You can now use the lock_knife native for this.

Full changelog:

Quote:
Originally Posted by Backstabnoob View Post
1.1
  • Fixed a bug where undroppable knives were also dropped on death
  • Fixed a bug where picking a knife up with a different weapon drawn, the weapon's submodel was changed only so you were shooting with knife
  • Fixed a bug where damage wasn't taking hitzones into account, thanks KliPPy
  • Changed KnifeAction_TakeDamage to KnifeAction_TraceAttack
  • Added new natives: lock_knife( ), get_user_knife_status( ), remove_knives( )
  • Changed default hands damage from 13.0 and 25.0 to 5.0 and 15.0 to make it more slow in duels
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Old 05-13-2014, 13:55
Spawner30
This message has been deleted by Spawner30. Reason: my bad !
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-13-2014 , 14:05   Re: Knife API v1.1
Reply With Quote #17

This is an API, so do it yourself.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Spawner30
BANNED
Join Date: Dec 2013
Location: I Don't Know Yet
Old 05-13-2014 , 14:12   Re: Knife API v1.1
Reply With Quote #18

didn't know that . ! so if you read my signature you'll understand [ Im New ] So don't give me this answer like that ^^' just explain . -_- ! and i just give my opinion ! never mind !!!!!
Spawner30 is offline
Send a message via Skype™ to Spawner30
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-13-2014 , 14:42   Re: Knife API v1.1
Reply With Quote #19

Quote:
Originally Posted by Spawner30 View Post
didn't know that . ! so if you read my signature you'll understand [ Im New ] So don't give me this answer like that ^^' just explain . -_- ! and i just give my opinion ! never mind !!!!!
This is a tool for you to add knives by yourself. If you want to change the damage, you can in the function AddDefaultKnife( ) on line 118.

I'll think about making this a cvar, though.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Sun Aloe
Member
Join Date: Jul 2013
Location: Porto, Portugal
Old 05-13-2014 , 14:51   Re: Knife API v1.1
Reply With Quote #20

Very useful and well worked! Thank you !
Sun Aloe 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 02:34.


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