Raised This Month: $ Target: $400
 0% 

Gun Stats Counting...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 03-19-2011 , 15:34   Gun Stats Counting...
Reply With Quote #1

Well , i have a code and i want on each kill / death to Count for 2 players gun stats. For the killer and the victim...
ex:

PHP Code:
new PlayerID[32];
new 
g_weap_names[32][32] = {"""p228""""scout""hegrenade",
"xm1014""c4""mac10""aug""smokegrenade""elite",
"fiveseven""ump45""sg550""galil""famas""usp""glock18",
"awp""mp5navy""m249""m3""m4a1""tmp",
"g3sg1""flashbang""deagle""sg552""ak47",
"knife""p90"""}
public 
client_death(killervictimwpnindexhitplaceTK)
{
    new 
headshot = ( hitplace == HIT_HEAD ) : "yes" "no"
    
new const HitPlaceStrings[][] = 
    {
        
"Generic",
        
"Head",
        
"Chest",
        
"Stomach",
        
"LeftArm",
        
"RightArm",
        
"LeftLeg",
        
"RightLeg"
    
};
    new 
killername[32], victimname[32], actuallkillerid[33], actuallvictimid[33]
    
get_user_name(killer,killername,31)
    
get_user_name(victim,victimname,31)
    
format(actualkillerid,PlayerID[killername],32);
    
format(actualvictimid,PlayerID[victimname],32);
    
msg("Kill Status: Killer: %s (%d) / Victim: %s (%d) / Weapon: %d / Hitplace: %s / TK: %d / HeadShot: %s ",killernamekillervictimnamevictimwpnindexHitPlaceStringshitplace ] , TKheadshot );

Well First of all in the array
PlayerID[32]
i store virtual ids for each player. Base on theese ids i want to store in a database for each player gunstats. Kills and deaths from each gun for each player.

now i want to make an array and put the stats in it
example:

weaponstats[32 -PlayerID][32 - WeaponID][1 - Kill - Deaths]
example for killing:
weaponstats[killer][wpnindex][0] - 0 for kills
weaponstats[victim][wpnindex][1] - 1 for deaths

But i am not sure how to make it
can anyone help me ?
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Old 03-21-2011, 11:16
ProIcons
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Old 03-31-2011, 17:34
ProIcons
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 04-22-2011 , 11:39   Re: Gun Stats Counting...
Reply With Quote #2

bump
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-22-2011 , 12:30   Re: Gun Stats Counting...
Reply With Quote #3

Untested
PHP Code:
const MAX_PLAYERS 32;

enum Score
{
     
Kills,
     
Deaths
}

new 
PlayerDataMAX_PLAYERS ][ 32 ][ Score ];

PlayerDataKillerID ][ WeaponID ][ Kills ]++;
PlayerDataVictimID ][ WeaponID ][ Deaths ]++; 
__________________
Bugsy is offline
Reply


Thread Tools
Display Modes

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:30.


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