function calcScreenCoors(fX,fY,fZ)
local dwM = 0xB6FA2C
local m_11 = memory.getfloat(dwM + 0*4)
local m_12 = memory.getfloat(dwM + 1*4)
local m_13 = memory.getfloat(dwM + 2*4)
local m_21 = memory.getfloat(dwM + 4*4)
local m_22 = memory.getfloat(dwM + 5*4)
local m_23 = memory.getfloat(dwM + 6*4)
local m_31 = memory.getfloat(dwM + 8*4)
local m_32 = memory.getfloat(dwM + 9*4)
local m_33 = memory.getfloat(dwM + 10*4)
local m_41 = memory.getfloat(dwM + 12*4)
local m_42 = memory.getfloat(dwM + 13*4)
local m_43 = memory.getfloat(dwM + 14*4)
local dwLenX = memory.read(0xC17044, 4)
local dwLenY = memory.read(0xC17048, 4)
frX = fZ * m_31 + fY * m_21 + fX * m_11 + m_41
frY = fZ * m_32 + fY * m_22 + fX * m_12 + m_42
frZ = fZ * m_33 + fY * m_23 + fX * m_13 + m_43
fRecip = 1.0/frZ
frX = frX * (fRecip * dwLenX)
frY = frY * (fRecip * dwLenY)
if(frX<=dwLenX and frY<=dwLenY and frZ>1)then
return frX, frY, frZ
else
return -1, -1, -1
end
end