PHP Code:
public client_connected(id, attacker)
{
set_task(1.0, "ComboControl", attacker, _, _, "b")
}
->
PHP Code:
public client_putinserver(id)
{
set_task(1.0, "ComboControl", id, _, _, "b")
}
client_connected doesn't even exist, client_connect (would recommend client_putinserver since it makes sure the client is "connected" not "connecting") is the correct function and it only takes one argument, which is the id of the connecting player.
PHP Code:
public ComboControl(id, attacker)
{
if(iTimeout[attacker] >= 0)
{
iTimeout[attacker] -= 1
}
if(iTimeout[attacker] == 0)
{
iCombo[attacker] = 0
}
}
->
PHP Code:
public ComboControl(id)
{
if(iTimeout[id] >= 0)
{
iTimeout[id] -= 1
}
if(iTimeout[id] == 0)
{
iCombo[id] = 0
}
}
When you set the task with the id, the first argument is the one that's used as ID, not the second like you did.
In all cases, that's not what I would do, since it would not guarantee that 2 seconds would pass between combo resets, it could take between 1 and 2 seconds inconsistently. I would do this instead:
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 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 event_damage(id)
{
new attacker = get_user_attacker(id)
new iDamage = read_data(2)
remove_task(attacker) // Remove the task if it already exists to reset after 2 seconds
set_task(2.0, attacker, "reset_damage") //Set a task after 2 seconds to reset
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 reset_damage(id)
{
iCombo[id] = 0
}
public event_new_round()
{
for(new player;player<g_Maxplayers;player++)
iHits[32]= 0;
}