Don't do this. Just look into the Blizzard Interface files and find the function you need to hook.
https://github.com/tomrus88/Blizzard...ard_NamePlates
https://github.com/tomrus88/Blizzard...tUnitFrame.lua
https://github.com/tomrus88/Blizzard...rame.lua#L1752
Lua Code:
--SetupPlayerNamePlate
local function SetupPlayerNamePlate(frame, setupOptions, frameOptions)
if not UnitIsUnit(frame.displayedUnit, "player") then return end
local parent = frame:GetParent()
local nameplate = C_NamePlate.GetNamePlateForUnit("player")
print(parent:GetName(),frame:Getname(),nameplate:GetName())
--apply setpoint to parent
print(parent:GetPoint())
parent:ClearAllPoints()
parent:SetPoint("CENTER")
end
hooksecurefunc("DefaultCompactNamePlateFrameSetupInternal", SetupPlayerNamePlate)