new g_aktualnydiabloclon = 0
Jest to oznaczenie gracza który zostaje w rundzie "Diablo", np.
if (g_aktualnydiabloclon)
{
set_user_cos tam
[...]
}
teraz chciałbym pobrać HP tego gracza, co muszę tu dodać żeby pokazywało tylko jego HP?
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Health", "Health", "be")
hud = CreateHudSyncObj()
}
public Health(id)
{
static hp
hp = read_data(1)
if(hp >= 255)
{
remove_task(id)
set_hudmessage(255, 170, 0, 0.01, 0.89, 0, 6.0, 12.0)
ShowSyncHudMsg(id, hud, "Twoje hp: %d", hp)
set_task(10.0, "show_health", id)
} else {
remove_task(id)
}
}
public show_health(id)
{
static hp
hp = get_user_health(id)
if(hp >= 255)
{
set_hudmessage(255, 170, 0, 0.01, 0.89, 0, 6.0, 12.0)
ShowSyncHudMsg(id, hud, "Twoje hp: %d", hp)
set_task(10.0, "show_health", id)
}
}