I got a problem with a vip plugin: when i hurt once health doesn't rengenrate when i hurt second time my health rengenrates what can be the problem ?
Code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
public plugin_init()
{
register_plugin("GunGame Vip", "1.0", "TBagT")
RegisterHam( Ham_TakeDamage, "player", "TakeDamage_player")
}
public health(id, player)
{
if (get_user_flags(player) & ADMIN_LEVEL_H)
{
new hp = get_user_health(id);
if(hp < 100)
{
set_user_health(id, 100);
}
else
{
client_print(id, print_chat, "[GunGame]: No more health for you.", hp)
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
}
public TakeDamage_player(id, player)
{
if(is_user_alive(id))
{
if (get_user_flags(player) & ADMIN_LEVEL_H)
{
new hp = get_user_health(id);
if(hp < 100)
{
set_task(15.0,"health", id);
}
client_print(id, print_chat, "[GunGame]: Health Will Regenerate in 15Seconds!")
}
}
}