Jump to content
GIGN Forum

Most Dm


Recommended Posts

Nu shitads tevi apmierina?

Neesmu testeejis bet butu jaaiet ideaali XD

#include <amxmodx>

#include <amxmisc>

#define PLUGIN "Most Damage"

#define VERSION "1.0"

#define AUTHOR "Sh!nE*"

new most_damage

new most_deaths

new att_damage[33], att_deaths[33]

new current_dmg, current_deaths

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)

register_logevent("round_end", 2, "1=Round_End")

register_event("DeathMsg", "deatha", "a")

register_event("Damage", "damage2", "be", "2!0","3=0","4!0")

register_logevent("round_start", 2, "1=Round_Start")

}

public deatha()

{

new killer = read_data(1)

att_deaths[killer]++

}

public damage2(id)

{

new damage = read_data(2)

new attacker = get_user_attacker(id)

att_damage[attacker] = att_damage[attacker] + damage

}

public round_start()

{

new players[32],num

get_players(players,num)

most_damage = 0

most_deaths = 0

current_deaths = 0

current_dmg = 0

for(new i = 0; i < num; i++) {

att_damage[players] = 0

att_deaths[players] = 0

}

}

public client_disconnect(id)

{

att_damage[id] = 0

att_deaths[id] = 0

}

public round_end()

{

new players[32],num

get_players(players,num)

for(new i = 0; i < num; i++)

{

if(att_damage[players] > current_dmg) {

current_dmg = att_damage[players]

most_damage = players

}

if(att_deaths[players] > current_deaths) {

current_deaths = att_deaths[players]

most_deaths = players

}

}

new name_dmg[32], name_deaths[32]

get_user_name(most_damage,name_dmg, 31)

get_user_name(most_deaths,name_deaths,31)

set_hudmessage(85, 170, 255, 0.01, 0.67, 0, 6.0, 3.0)

show_hudmessage(0, "Most Damage: %s (%d)",name_dmg,current_dmg)

set_hudmessage(85, 170, 255, 0.01, 0.71, 0, 6.0, 3.0)

show_hudmessage(0, "Most Deaths: %s (%d)",name_deaths,current_deaths)

return PLUGIN_CONTINUE

}

Edited by shine
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...