I cant get this to work for the life of me, the entity doesnt follow the player. It only spawns at the players origin and sits there...
Code:
public view(id, target){
new Float:origin[3]
new entFollow = create_entity("info_target")
entity_set_string(entFollow, EV_SZ_classname, "follow_entity")
entity_set_int(entFollow, EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_int(entFollow, EV_INT_solid, SOLID_NOT)
entity_set_edict(entFollow, EV_ENT_aiment, target)
entity_get_vector(id, EV_VEC_origin, origin);
entity_set_origin(entFollow, origin)
attach_view(id, entFollow)
viewing[id]=true
return PLUGIN_HANDLED
}
Heres the function to go back to the players own view which doesnt work either...
Code:
public client_command(id){
if(viewing[id]){
new button = get_user_button(id)
if(button & IN_USE ||button & IN_ATTACK){
attach_view(id, id)
viewing[id]=false
}
}
}