Jump to content

[HELP]Erro In Script


Black2

Recommended Posts

I have erro here it opens when the map opens but then does not close how i fix ? Thx

local localPlayer = getLocalPlayer() 
local screenWidth, screenHeight = guiGetScreenSize() 
local position_lbl = guiCreateLabel( 10, screenHeight-24, screenWidth, 22, " ", false ) 
  
function renderPosition() 
    if not isPlayerMapVisible( ) then 
    return 
    end 
    local _x, _y, _z = getElementPosition( localPlayer ) 
    local _rot = getPlayerRotation( localPlayer ) 
    guiSetText( position_lbl, "X: " .. tostring( _x ) .. ";   Y: " .. tostring( _y ) .. ";   Z: " .. tostring( _z ) .. "; RotZ: " .. tostring(_rot) ) 
    end 
addEventHandler( "onClientRender", getRootElement(), renderPosition ) 

Link to comment
local localPlayer = getLocalPlayer() 
local screenWidth, screenHeight = guiGetScreenSize() 
local position_lbl = guiCreateLabel( 10, screenHeight-24, screenWidth, 22, " ", false ) 
  
function renderPosition() 
    if not isPlayerMapVisible( ) then 
    return guiSetText(position_lbl, "") 
    end 
    local _x, _y, _z = getElementPosition( localPlayer ) 
    local _rot = getPlayerRotation( localPlayer ) 
    guiSetText( position_lbl, "X: " .. tostring( _x ) .. ";   Y: " .. tostring( _y ) .. ";   Z: " .. tostring( _z ) .. "; RotZ: " .. tostring(_rot) ) 
    end 
addEventHandler( "onClientRender", getRootElement(), renderPosition ) 

Should work

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...