function GetPlayerDistance(e)
tPlayerDX = (g_Entity[e]['x'] - g_PlayerPosX)
tPlayerDY = (g_Entity[e]['y'] - g_PlayerPosY)
tPlayerDZ = (g_Entity[e]['z'] - g_PlayerPosZ)
if math.abs(tPlayerDY) > 100 then
tPlayerDY = tPlayerDY * 4
end
return math.sqrt(math.abs(tPlayerDX*tPlayerDX)+math.abs(tPlayerDY*tPlayerDY)+math.abs(tPlayerDZ*tPlayerDZ));
end
I am just trying to work out why this function does the check on the tPlayerDY?
if math.abs(tPlayerDY) > 100 then
tPlayerDY = tPlayerDY * 4
end
ie: If the height difference between the player and the entity is greater than 100 then times the result by 4...?
Any idea why this is done or needed..?
Cheers
I may be old, but at least my memory still ....hmmm
DT:Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528, AutoCAD, 3DsMax, Paint.Net, Solidworks.