static Snapshot:snaps, Float:pos_spawn[3], Float:pos_heal[3], empty, i, Float:head_health_max, Float:base_health_max
engfunc(EngFunc_GetBonePosition, ent, 6, pos_spawn, empty)
snaps = TrieSnapshotCreate(get_sentry_list())
/*Пушки Ultimate Sentry Guns*/
/*START*/
for (i = 0; i < TrieGetSize(get_sentry_list()); i++) {
static target_string[32], target, data[class_sentry]
TrieSnapshotGetKey(snaps, i, target_string, charsmax(target_string))
target = str_to_num(target_string)
if (!pev_valided(target))
continue
if (pev(target, pev_team) != pev(ent, pev_team))
continue
data_get(get_sentry_list(), target, data, sizeof data)
if (!data[_sentry_spawn_end])
continue
pev(target, pev_origin, pos_target)
if (get_distance_f(pos_spawn, pos_target) > tesla_set[_tesla_set_distance])
continue
head_health_max = get_sentry_health(target, _sentry_health_head_multi)
base_health_max = get_sentry_health(target, _sentry_health_base_multi)
if (data[_sentry_health][_sentry_health_head] == head_health_max && data[_sentry_health][_sentry_health_base] == base_health_max)
continue
data_tesla[_tesla_energy] -= tesla_set[_tesla_set_repair_tip]
data[_sentry_health][_sentry_health_head] = floatclamp(data[_sentry_health][_sentry_health_head] + tesla_set[_tesla_set_health_tip], 0.0, head_health_max)
data[_sentry_health][_sentry_health_base] = floatclamp(data[_sentry_health][_sentry_health_base] + tesla_set[_tesla_set_health_tip], 0.0, base_health_max)
data_set(get_sentry_list(), target, data, sizeof data)
engfunc(EngFunc_GetBonePosition, target, get_sentry_setting(_sentry_bone_head), pos_heal, empty)
sentry_barrel_effect_hook(pos_spawn, pos_heal, data_tesla[_tesla_color], tesla_set[_tesla_set_sprite_id], 50, 50, 1)
}
TrieSnapshotDestroy(snaps)
/*Пушки Ultimate Sentry Guns*/
/*END*/