nie, bo w 1 ustala ilość max hp
siedziałem nad tym chwilke i wymysliłem takie coś
#include <amxmodx>
#include <cstrike>
#include <fun>
#define PLUGIN "Terro_HP"
#define VERSION "1.1"
#define AUTHOR "speedkill & Nakupenda."
new gracze_w_ct = 0
new maks[2], add_hp[33], max_hp[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("Start", 2, "1=Round_Start")
register_logevent("Koniec", 2, "1=Round_End")
}
public Start()
{
for(new i=1;i<33;i++)
{
if(is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_CT)
{
gracze_w_ct++
}
else if(cs_get_user_team(i) == CS_TEAM_T)
{
set_task(2.0,"daj_hp",i)
}
}
}
}
public Koniec()
{
gracze_w_ct = 0
}
public daj_hp(id)
{
maks[0] = id
switch(gracze_w_ct)
{
case 1..3:
maks[1] = 300
case 4..6:
maks[1] = 400
case 7..8:
maks[1] = 500
case 9..10:
maks[1] = 600
}
recovery(maks)
set_task(5.0, "recovery", 6, maks, 2, "b")
}
public recovery(maks[])
{
new id = maks[0]
max_hp[id] = maks[1]
add_hp[id] = maks[1] - get_user_health(id)
if(cs_get_user_team(id) == CS_TEAM_CT)
{
add_hp[id] = 0
max_hp[id] = 100
}
set_user_health(id, get_user_health(id) + add_hp[id])
}