Hi! What benefits we have in creating an entity instead of a task?
Code:
{
public plugin_init() {
new iEnt = create_entity("info_target")
if(iEnt) {
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 0.1)
entity_set_string(iEnt, EV_SZ_classname, "_hud_spec")
register_think("_hud_spec", "UpdateSpecHud")
} else {
set_task(0.1, "UpdateSpecHud", .flags="b")
}
}
public UpdateSpecHud(iEnt) {
if(iEnt)
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 0.1)
}
__________________