Raised This Month: $ Target: $400
 0% 

CS:GO Calculating Statistics For Each Weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pluginewbs
New Member
Join Date: Dec 2014
Old 12-05-2014 , 17:04   CS:GO Calculating Statistics For Each Weapon
Reply With Quote #1

Hey everyone, I just started learning about SourceMod. I was curious though, would it be possible to write a plugin for CS:GO that would detect and keep track of the statistics for each weapon?

For example let's say someone uses the AK-47 often, could this hypothetical plugin keep track of this player's "AK Statistics" such as,

#Kills
#HS's
#Kills with HS
#Damage Given (in health)
#Damage Taken
#Deaths
#HS's Taken (in terms of hits)
#Hits Taken
#Shots Fired
#Shots Hit

I'm going to keep doing research on this but so far I haven't discovered any plugins that function like this. Thanks,

Pluginewbs

Last edited by Pluginewbs; 12-05-2014 at 17:04.
Pluginewbs is offline
turtsmcgurts
SourceMod Donor
Join Date: Jul 2011
Old 12-05-2014 , 17:09   Re: CS:GO Calculating Statistics For Each Weapon
Reply With Quote #2

you want to look into enums and arrays.

it would end up looking something like this

PHP Code:
enum weapons {
    
ak47,
    
m4a1,
    
awp;
}

enum stats {
    
Kills,
    
Headshots,
    
Damage Given,
    
Damage Taken,
    
Deaths
    
Shots Fired,
    
Shots Hit,
    
Accuracy;
}
new 
weapon_stats[MAXPLAYERS+1][weapons][stats];

weapon_stats[client][ak47][Kills] = 4

Last edited by turtsmcgurts; 12-05-2014 at 17:10.
turtsmcgurts 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 18:26.


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