1. Hi. How to make addons which will write to print of coordinate of NPC on target? I want to take NPC in target to register command /coord and that to me to print wrote NPC coordinates

    You cannot retrieve the position of any unit outside your party/raid. Sorry.

    The best you can do is to give your own coordinates at the time, since you're close enough to target the thing.

     local x, y = GetPlayerMapPosition("player");
     print string.sub(x*100,1,4)..","..string.sub(y*100,1,4);
    

    would be an example. If your goal is to output it to some sort of chat, you might want to look at "ChatSubs" on Curse. With it, you could do, for example:

    /bg <target>: <targetlevel> <targetclass> incoming at <position>

    Make that a macro, and you can hit it with someone targeted to send their name, level, class, and your coordinates when you spotted them out to your side.