View Single Post
Author Message
Berkio
New Member
Join Date: Dec 2021
Old 10-06-2022 , 03:22   Show Damage Plus
Reply With Quote #1

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(PLUGINVERSIONAUTHOR)
    
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(idattacker)
{
    
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(0255255, -1.00.704.01.02.0__, -1)
    
show_hudmessage(attacker"%i^n(Combo %dx) (Hit's %d)"iDamageiCombo[attacker], iHits[attacker])
    
}

public 
ComboControl(idattacker)
{
    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.

Last edited by Berkio; 10-06-2022 at 03:33.
Berkio is offline