Black2 Posted July 2, 2015 Share Posted July 2, 2015 why this don't work ? I need to open when the map is opened local localPlayer = getLocalPlayer() local screenWidth, screenHeight = guiGetScreenSize() local position_lbl = guiCreateLabel( 10, screenHeight-24, screenWidth, 22, " ", false ) function renderPosition() local _x, _y, _z = getElementPosition( localPlayer ) local _rot = getPlayerRotation( localPlayer ) if not isPlayerMapVisible( ) then return end guiSetText( position_lbl, "X: " .. tostring( _x ) .. "; Y: " .. tostring( _y ) .. "; Z: " .. tostring( _z ) .. "; RotZ: " .. tostring(_rot) ) end addEventHandler( "onClientRender", getResourceRootElement( getThisResource( ) ), renderPosition ) Link to comment
Death Posted July 3, 2015 Share Posted July 3, 2015 try this local localPlayer = getLocalPlayer() local screenWidth, screenHeight = guiGetScreenSize() local position_lbl = guiCreateLabel( 10, screenHeight-24, screenWidth, 22, " ", false ) function renderPosition() local _x, _y, _z = getElementPosition( localPlayer ) local _rot = getPlayerRotation( localPlayer ) if not isPlayerMapVisible( ) then return end guiSetText( position_lbl, "X: " .. tostring( _x ) .. "; Y: " .. tostring( _y ) .. "; Z: " .. tostring( _z ) .. "; RotZ: " .. tostring(_rot) ) end addEventHandler( "onClientRender", getRootElement(), renderPosition ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now