if you havent figured it out, the you doesnt point to anything.

if this function is going to be called by an enemy, you can do this:

//put up top
entity* player

//put in player action
player = me; //this defines the player entity

//change vec_dist to:
vec_dist(my.x, player.x);

if you dont want you to be the player, you could scan for it

scan will return the entities it hits

look up c_scan perhaps you could do:
scan_var = scan(.....);
if(scan_var > 0) { attack();} //if there is an entity near, attack
else
{
//walk
}

scan also saves the YOU pointer. so, it returns the distance of the entity AND saves the you pointer.

this is all theoretical, but it should work. hope it helps!