Thanks smallg for you help.
I ended getting my first script working...
You wouldn't want to be paying me buy the hour for scripting.
But it done now.
-- LUA Script -- Shows players co-ordinates on map from a marker point. By perelect 15.04.2015
-- Assign this script to the Marker Point. Set any entity (The Marker Point) to - Static No, Physics No, AllwaysActive Yes.
-- Place Marker Point in bottom left corner of the map. Use a small flat item like a can.
-- My first script. A big learning curve.
function codisplay_init(e)
end
function codisplay_main(e)
-- Detects the player distance from the marker at 0,0,0 (Bottom left of Map) Taken from ai_soldier.lua
PlayerDX = g_Entity[e]['x'] - g_PlayerPosX;-- Gets x position of player from the marker.
PlayerDY = g_Entity[e]['y'] - g_PlayerPosY;-- Gets y position of player from the marker.
PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ;-- Gets z position of player from the marker.
PlayerDist = math.sqrt(math.abs(PlayerDX*PlayerDX)+math.abs(PlayerDY*PlayerDY)+math.abs(PlayerDZ*PlayerDZ)); -- Calculates position.
if PlayerDist > 100 then -- Runs the below code, while the player is more than 100 units away from Marker Point.
TextColor(1,3,2,"X = "..math.ceil(g_PlayerPosX),255,255,255) -- TextColor(x,y,size,txt,r,g,b) left to right. Taken from global.lua
TextColor(5,3,2," West to East",255,255,255) -- prints the text " West to East".
TextColor(1,5,2,"Z = "..math.ceil(g_PlayerPosZ),255,255,255) -- TextColor(x,y,size,txt,r,g,b) bottom to top. Taken from global.lua
TextColor(5,5,2," South to North",255,255,255) -- prints the text " South to North".
TextColor(1,7,2,"Y = "..math.ceil(g_PlayerPosY-545),255,255,255) -- TextColor(x,y,size,txt,r,g,b) sea to ceiling. Taken from global.lua
-- The -545 in the above line "(g_PlayerPosY-545)" is the distance from ground level to sea level, adjust to suit your ground level if needed.
TextColor(5,7,2," Above Sea level",255,255,255) -- prints the text " Above Sea level".
Panel(0,0,12,10) -- Panel(x,y,x2,y2). Taken from global.lua
end -- end if
end -- end function
I may be old, but at least my memory still ....hmmm
Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 4 GB Ram, Radeon (TM) HD 6490M, 2789 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000.