Chciałbym dodać regeneracje HP na każdej broni PARU klasą
Kod Vertricusa znaleziony na forum.
plugin_init
register_think("HealBot", "HealBotThink");
CreateHealBot();
koniec sma
CreateHealBot()
{
new Bot = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
if (Bot)
{
set_pev(Bot, pev_classname, "HealBot");
dllfunc(DLLFunc_Spawn, Bot);
set_pev(Bot, pev_nextthink, get_gametime() + 5.0);
}
}
public HealBotThink(Bot)
{
new iPlayers[32], iNum, id;
get_players(iPlayers, iNum);
for(new i; i<iNum; i++)
{
id = iPlayers[i];
if (!is_user_alive(id)) continue;
if (player_class[id] != Twoja_Klasa) continue;
change_health(id,30,0,"");
}
set_pev(Bot, pev_nextthink, get_gametime() + 5.0);
}
Sprawa wydaje się banalnie prosta ale za cholerę nie mogę sobie poradzić.
Mianowicie.
Jak zrobić żeby ładowało przykładowo
klasa1 10hp co 5 sekund
klasa2 5 hp co 10 sekund
klasa3 30hp co 10 sekund
?
Pozdrawiam.