Raised This Month: $ Target: $400
 0% 

Get CS:GO weapon Kill Award amount


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 12-02-2012 , 03:16   Get CS:GO weapon Kill Award amount
Reply With Quote #1

Hi there,

I'm trying to find the amount of cash given to a player in CS:GO when that player kills someone (for my Kill Assist plugin).

I know about the "KillAward" value present in the csgo/scripts/weapon_* files, but it isn't present for all weapons (i.e. the key/value pair "KillAward" isn't present for glock and heavies). Therefore I'm trying to find an alternate way to get all the real kill award given.

I did try "find x" where x = "kill", "glock", "award", "killaward" or "pistol", but it seems that no ConVar exist for what I was looking for.

Also, it needs to be the actual amount. When I host my server I get 450% the amount (1050$) for kill award when using heavy weapons, but when I'm on other servers I get 300% (900). The method I'm looking for need to adapt to those cases.

Thank you,

Red
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-02-2012 , 10:53   Re: Get CS:GO weapon Kill Award amount
Reply With Quote #2

There doesn't seem to be any weapon-specific checks in CCSPlayer::AddAccountAward (although the weaponinfo ptr does get passed through so that it can lookup the script amount).

It does, however, read the values of the cvars cash_player_killed_enemy_default (int) and cash_player_killed_enemy_factor (float).

Last edited by psychonic; 12-02-2012 at 10:53.
psychonic is offline
Sheepdude
SourceMod Donor
Join Date: Aug 2012
Location: Chicago
Old 12-02-2012 , 17:44   Re: Get CS:GO weapon Kill Award amount
Reply With Quote #3

Yep that's probably the best way to do it. Get the default enemy kill award and factor, and multiply it by the gun-specific ratio. You'll have to hard-code the ratios and compare it to the gun name though.

http://clan-psycho.com/mage/download/csgoctweapon.jpg
__________________
Sheepdude is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 12-02-2012 , 18:23   Re: Get CS:GO weapon Kill Award amount
Reply With Quote #4

Quote:
Originally Posted by Sheepdude View Post
Yep that's probably the best way to do it. Get the default enemy kill award and factor, and multiply it by the gun-specific ratio. You'll have to hard-code the ratios and compare it to the gun name though.

http://clan-psycho.com/mage/download/csgoctweapon.jpg
Lol ! Thanks for the image; but a bit late (would have been useful like 2 hours before :$); I think I should be fine; I did QQ around too much thinking the KillAward's values in weapon_ didn't match the non-default value in the menu, which is not the case.

Thank you both (and Drifter).

and btw Sheep, I'm parsing the values in csgo/scripts/weapon_*.txt files. They are just not always present, where the QQ of this thread. (I mean by this that it is not really "hard-coded")
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work

Last edited by RedSword; 12-02-2012 at 18:26.
RedSword 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 15:25.


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