Quote:
Originally Posted by Exolent[jNr]
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], pnum, stats[8],bodyhits[8]
get_players( players , pnum)
new damage = 0, hits = 0, who = 0
for(new i = 0; i < pnum; ++i)
{
get_user_rstats( players[i],stats, bodyhits )
if ( stats[6] > damage )
{
who = players[i]
hits = stats[5]
damage = stats[6]
}
}
if ( is_user_connected(who) )
{
new name[32]
get_user_name( who, name, charsmax(name))
format(msg, charsmax(msg) ,"Most damages in this round: %s^n%d Hits/%d Damades", name , hits , damage)
}