Top damagers sorting
Hello!
I already have plugin, which calculates damage of player. But I want to make HUD-message to show top 3 players by damage. I use sort by descending and retrieves from new sorted massive [0],[1] and [2] players. Code:
const MAX_PLAYERS = 32;Code:
|
Re: Top damagers sorting
TopDamagers[i] = kdPlayerData[i][CurrentDamage]
or TopDamagers[i] = kdPlayerData[i][TotalDamage] depending on your needs. |
Re: Top damagers sorting
ye I tried this before.
It is compiling without problems but plugin don't work. This is console: Code:
L 11/09/2011 - 17:22:43: [AMXX] Displaying debug trace (plugin "crazzard_TotalDamage.amxx")Code:
kdPlayerData[ iAttacker ][ TotalDamage ] += ( kdPlayerData[ iAttacker ][ CurrentDamage ] = pev( iVictim , pev_dmg_take ) ); |
Re: Top damagers sorting
Do you know that csx module stores the same datas as your plugin is trying to do ?
Use get_user_*stats native and retrieve damage done or damage taken. |
Re: Top damagers sorting
I understood your recommendation, but if I want to set to zero if round ended, and next round this value will begin from 0. stats.dat keeps damage of all gametime which player played. I think this method doesn't suit me
|
Re: Top damagers sorting
I tried this:
Code:
for (new i=1;i<sizeof(kdPlayerData);i++){If I try to modify it to arrayset(TopDamagers[i],kdPlayerData[i][TotalDamage],sizeof(kdPlayerData[])) - it's error which I described in my second message |
| All times are GMT -4. The time now is 14:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.