This is obviously not going to get better any time soon, so I took the liberty of cutting the code for this down by... err... a lot:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define CVAR_NUM 26
new PlayerFrags[33]
new g_Cvars[CVAR_NUM]
public plugin_init()
{
register_plugin("Handicap Mod Modifited", "1.1", "Modifited by Agent_GOD , Orginal by Rolnaaba")
register_event("DeathMsg", "Event_Death", "a")
register_logevent("Event_RoundEnd", 2, "1=Round_End")
new Cvar[24],Value[10]
for(new Count;Count < CVAR_NUM;Count++)
{
format(Cvar,23,"amx_%dhealth")
format(Value,9,"%d",96 - (Count * 4))
g_Cvars[Count] = register_cvar(Cvar,Value)
}
}
public Event_Death()
{
new killer = read_data(1)
if(killer)
PlayerFrags[killer]++
PlayerFrags[read_data(2)] = 0
}
public Event_RoundEnd()
{
new Players[32], playerCount, i
get_players(Players, playerCount, "c")
for(i=0;i<playerCount;i++)
set_task(5.0,"Do_Health",Players[i])
}
public Do_Health(id)
{
new Frags = PlayerFrags[id]
if(!is_user_connected(id) || !Frags)
return
if(Frags < CVAR_NUM * 2)
{
new Float:Calc = (Frags + 0.1) / 2.0,Cvar = floatround(Calc,floatround_ceil),Health = get_pcvar_num(g_Cvars[Cvar])
set_user_health(id,Health)
client_print(id,print_chat,"[AMXX] Your health has been set to %d for having %d consecutive kills",Health,Frags)
}
else
client_print(id,print_chat,"[AMXX] Your health will remain at 100 for having more than %d consecutive kills",CVAR_NUM * 2)
}
Please bear in mind this is untested. Also, the cvar names were changed to just "amx_1health" instead of "amx_1sthealth" to make it easier to loop.