Raised This Month: $ Target: $400
 0% 

top2 or 3 damagers in array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-07-2009 , 17:23   top2 or 3 damagers in array
Reply With Quote #1

I don't really know how to explain this but I'm trying to get from an array the top 3 (minus the killer, that's 2 to calculate) players who made the most damage to a player... also check if the players did at least 25% damage to that player.

I managed to this:

Code:
new g_iDamage[33][33]
 
public event_damage(id)
{
  static hitzone, weapon, attacker
  attacker = get_user_attacker(id, weapon, hitzone)
  g_iDamage[attacker][id] += read_data(2)
}
 
public event_death()
{
  static id, weapon, hitplace, mindamage, killer, killer2, damage, damage2, i
  id = read_data(2)
  killer = get_user_attacker(id, weapon, hitplace)
 
  damage = g_iDamage[killer][id]
  killer2 = 0
  damage2 = 0
  mindamage = 25
 
  for(i = 1; i <= 32; i++) /* but this is not pretty good... */
  {
    if(g_iDamage[i][id] >= mindamage && g_iDamage[i][id] >= damage2)
    {
       damage2 = g_iDamage[i][id]
       killer2 = i
    }
  }
}
This is made for two killers... but I need 3... also I cannot seem to make even for two corectly, can any1 help ?
__________________
Hunter-Digital is offline
 


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 08:59.


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