Raised This Month: $ Target: $400
 0% 

statistics: most damages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-03-2010 , 16:22   Re: statistics: most damages
Reply With Quote #1

Use a global player array that is a float.
Hook Ham_TakeDamage as post and get damage done from the victim's pev_dmg_take value, and add that value to the attacker's array value.
Hook round end and iterate through the array til you find the most damage, then display that player.
Also in the round end hook, reset the global array to 0.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 12-03-2010 , 20:39   Re: statistics: most damages
Reply With Quote #2

Quote:
Originally Posted by Exolent[jNr] View Post
Use a global player array that is a float.
Hook Ham_TakeDamage as post and get damage done from the victim's pev_dmg_take value, and add that value to the attacker's array value.
Hook round end and iterate through the array til you find the most damage, then display that player.
Also in the round end hook, reset the global array to 0.
it's hard for me to understand very well.is it the same method as bellow?
PHP Code:
  new players[32], pnumstats[8],bodyhits[8]
  
get_playersplayers pnum
  new 
damage 0hits 0who 0
  
  
for(new 0pnum; ++i)
  {
   
get_user_rstatsplayers[i],statsbodyhits )
   if ( 
stats[6] > damage )
   {
    
who players[i]
    
hits stats[5]
    
damage stats[6]
   }  
  }
  if ( 
is_user_connected(who) )
  {
   new 
name[32]
   
get_user_namewhonamecharsmax(name))
   
format(msgcharsmax(msg) ,"Most damages in this round: %s^n%d Hits/%d Damades"name hits damage)
  } 
Jacob is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-03-2010 , 22:17   Re: statistics: most damages
Reply With Quote #3

Yea that works too.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 11:19.


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