Jump to content

[HELP]Erro In Script


Black2

Recommended Posts

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

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

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...