Hello everybody,
I try to store the position of a End Button using this Code
Code:
new Float:g_flDist[33][3]
.
.
.
new ent = -1
while((ent = find_ent_by_class(ent, "counter_off")))
pev(ent, pev_origin, g_flDist[id])
while((ent = find_ent_by_class(ent, "clockstopbutton")))
pev(ent, pev_origin, g_flDist[id])
while((ent = find_ent_by_class(ent, "clockstop")))
pev(ent, pev_origin, g_flDist[id])
while((ent = find_ent_by_class(ent, "but_stop")))
pev(ent, pev_origin, g_flDist[id])
while((ent = find_ent_by_class(ent, "counter_stop_button")))
pev(ent, pev_origin, g_flDist[id])
while((ent = find_ent_by_class(ent, "multi_stop")))
pev(ent, pev_origin, g_flDist[id])
while((ent = find_ent_by_class(ent, "stop_counter")))
pev(ent, pev_origin, g_flDist[id])
while((ent = find_ent_by_class(ent, "m_counter_end_emi")))
pev(ent, pev_origin, g_flDist[id])
Then getting the origin of the player
Code:
static Float:origin[3]
pev(id, pev_origin, origin)
and showing the distance in a HUD
Code:
get_distance_f(origin, g_flDist[id])
But I always get wrong results, when I stand next to the button it shows me 3000 Units distance. Can anyone tell me whats wrong?
__________________