Just in case anybody stumbles upon the same problem, this is the solution:
Code:
void align_sprite_to_screen(ENTITY* sprite)
{
	VECTOR v;
	v.x = v.y = 0;
	v.z = 512;
	rel_for_screen(&v,camera);
	BMAP* bmp = ent_getskin(sprite,0);
	sprite->scale_x = 2 * v.y / bmap_width(bmp);
	sprite->scale_y = 2 * v.z / bmap_height(bmp);
	sprite->x = v.x - 1;
}




Always learn from history, to be sure you make the same mistakes again...