SHOW DAMAGE PLUS RESET / TIME PROBLEM
Hi friends, there is a combo and hits plugin in this plugin
I want the Combo and Hits to be reset, but I can't
Combo : Will be reset after 2 seconds
but every time we do damage for 2 seconds, it will go back to 2 seconds again
Hits : When we move to the new round, we will clear everyone Hits
PHP Code:
/*
| =============================
| Generated by Berk
| Made in Turkey
| Keep It Ready
| =============================
*/
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Show Damage Plus"
#define VERSION "1.0"
#define AUTHOR "Berk"
new iCombo[33] , iHits[33]
new iTimeout[33]
new g_Maxplayers
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Damage","event_damage","b","2!0","3=0","4!0")
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
}
public client_connected(id, attacker)
{
set_task(1.0, "ComboControl", attacker, _, _, "b")
}
public event_damage(id)
{
new attacker = get_user_attacker(id)
new iDamage = read_data(2)
iTimeout[attacker] = 2
iCombo[attacker]++
iHits[attacker]++
set_hudmessage(0, 255, 255, -1.0, 0.70, 4.0, 1.0, 2.0, _, _, -1)
show_hudmessage(attacker, "%i^n(Combo %dx) (Hit's %d)", iDamage, iCombo[attacker], iHits[attacker])
}
public ComboControl(id, attacker)
{
if(iTimeout[attacker] >= 0)
{
iTimeout[attacker] -= 1
}
if(iTimeout[attacker] == 0)
{
iCombo[attacker] = 0
}
}
public event_new_round()
{
for(new player;player<g_Maxplayers;player++)
iHits[32]= 0;
}
–
note: Please write the reason for the problem, thank you. –