Jump to content

[Ayuda/Help] Freeroam resource


JkR

Recommended Posts

Posted

Hi, my intention is to create a marker and to the touch, Freeroam panel is opened, the script works correctly but when you touch the marker, the panel does not open, this is what releases my fr_client:

  
--lineas iniciales: 
  
marker = createMarker( 2043, 855, 5, "cylinder", 2, 151, 146, 0, 255 ) 
  
CONTROL_MARGIN_RIGHT = 5 
LINE_MARGIN = 5 
LINE_HEIGHT = 16 
  
g_Root = getRootElement() 
g_ResRoot = getResourceRootElement(getThisResource()) 
g_Me = getLocalPlayer() 
server = createServerCallInterface() 
guiSetInputMode("no_binds_when_editing") 
  
--lineas finales: 
  
function getPlayers() 
    g_PlayerData = {} 
    table.each(getElementsByType('player'), joinHandler) 
end 
  
    function showgui (hitElement) 
         if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
        createWindow(wndMain) 
        hideAllWindows() 
        guiCheckBoxSetSelected(getControl(wndMain, 'jetpack'), doesPedHaveJetPack(g_Me)) 
        guiCheckBoxSetSelected(getControl(wndMain, 'falloff'), canPedBeKnockedOffBike(g_Me)) 
        setJetpackMaxHeight ( 9001 ) 
         
        triggerServerEvent('onLoadedAtClient', g_ResRoot, g_Me) 
end 
addEventHandler("onClientMarkerHit", marker, showgui) 
  
function joinHandler(player) 
    if (not g_PlayerData) then return end 
    g_PlayerData[player or source] = { name = getPlayerName(player or source), gui = {} } 
end 
addEventHandler('onClientPlayerJoin', g_Root, joinHandler) 

Please, help

Posted
You have a missing 'end' to close the 'if' at 'showgui' function.

Ya lo arreglé, pero el problema sigue

I fix it, but the problem continue

Posted

If you really fixed it the problem would have been gone, the missing end was near line 29, try this. It's not tested but should work.

--lineas iniciales: 
marker = createMarker( 2043, 855, 5, "cylinder", 2, 151, 146, 0, 255 ) 
  
CONTROL_MARGIN_RIGHT = 5 
LINE_MARGIN = 5 
LINE_HEIGHT = 16 
  
g_Root = getRootElement() 
g_ResRoot = getResourceRootElement(getThisResource()) 
g_Me = getLocalPlayer() 
server = createServerCallInterface() 
guiSetInputMode("no_binds_when_editing") 
  
--lineas finales: 
function getPlayers() 
    g_PlayerData = {} 
    table.each(getElementsByType('player'), joinHandler) 
end 
  
function showgui (hitElement) 
    if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
        createWindow(wndMain) 
        hideAllWindows() 
        guiCheckBoxSetSelected(getControl(wndMain, 'jetpack'), doesPedHaveJetPack(g_Me)) 
        guiCheckBoxSetSelected(getControl(wndMain, 'falloff'), canPedBeKnockedOffBike(g_Me)) 
        setJetpackMaxHeight ( 9001 ) 
      
        triggerServerEvent('onLoadedAtClient', g_ResRoot, g_Me) 
    end --[[ HERE'S THE MISSING END ]]-- 
end 
addEventHandler("onClientMarkerHit", marker, showgui) 
  
function joinHandler(player) 
    if (not g_PlayerData) then return end 
    g_PlayerData[player or source] = { name = getPlayerName(player or source), gui = {} } 
end 
addEventHandler('onClientPlayerJoin', g_Root, joinHandler) 

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