Jump to content

Ayuda Poner Solo para El Staff


Recommended Posts

Hola mi problema es que quiero poner que este panel solo lo pueda abrir los del Staff

--------------------------- 
---Main window 
--------------------------- 
  
function updateGUI(updateVehicle) 
    -- update position 
    local x, y, z = getElementPosition(g_Me) 
    setControlNumbers(wndMain, {xpos=math.ceil(x), ypos=math.ceil(y), zpos=math.ceil(z)}) 
     
end 
  
  
  
wndMain = { 
    'wnd', 
    text = 'Panel', 
    x = 10, 
    y = 150, 
    width = 280, 
    controls = { 
        {'lbl', text='Local player'}, 
        {'br'}, 
        {'btn', id='playergrav', text='grav', window=wndGravity}, 
        {'btn', id='setpos', text='map', window=wndSetPos}, 
    }, 
    oncreate = mainWndShow, 
    onclose = mainWndClose 
} 
  
function errMsg(msg) 
    outputChatBox(msg, 255, 0, 0) 
end 
  
  
addEventHandler('onClientResourceStart', g_ResRoot, 
    function() 
        fadeCamera(true) 
        setTimer(getPlayers, 1000, 1) 
         
        bindKey('f1', 'down', toggleFRWindow) 
        createWindow(wndMain) 
        hideAllWindows() 
        setJetpackMaxHeight ( 9001 ) 
         
        triggerServerEvent('onLoadedAtClient', g_ResRoot, g_Me) 
    end 
) 
  
function showWelcomeMap() 
    createWindow(wndSpawnMap) 
    showCursor(true) 
end 
  
function showMap() 
    createWindow(wndSetPos) 
    showCursor(true) 
end 
  
function toggleFRWindow() 
    playerAcc = getPlayerAccount(source) 
    if isObjectInACLGroup("user."..getAccountName(playerAcc), aclGetGroup("Admin", "Moderator", "SuperModerator") then  
  
    if isWindowOpen(wndMain) then 
        showCursor(false) 
        hideAllWindows() 
        colorPicker.closeSelect() 
    else 
        showCursor(true) 
        showAllWindows() 
    end 
    end 
end 
  
  
addCommandHandler('fr', toggleFRWindow) 

Lo necesito urgente! porfavor :cry:

Link to comment

aqui tienes :D

--------------------------- 
---Main window 
--------------------------- 
  
function updateGUI(updateVehicle) 
    -- update position 
    local x, y, z = getElementPosition(g_Me) 
    setControlNumbers(wndMain, {xpos=math.ceil(x), ypos=math.ceil(y), zpos=math.ceil(z)}) 
     
end 
  
  
  
wndMain = { 
    'wnd', 
    text = 'Panel', 
    x = 10, 
    y = 150, 
    width = 280, 
    controls = { 
        {'lbl', text='Local player'}, 
        {'br'}, 
        {'btn', id='playergrav', text='grav', window=wndGravity}, 
        {'btn', id='setpos', text='map', window=wndSetPos}, 
    }, 
    oncreate = mainWndShow, 
    onclose = mainWndClose 
} 
  
function errMsg(msg) 
    outputChatBox(msg, 255, 0, 0) 
end 
  
  
addEventHandler('onClientResourceStart', g_ResRoot, 
    function() 
        fadeCamera(true) 
        setTimer(getPlayers, 1000, 1) 
         
        bindKey('f1', 'down', toggleFRWindow) 
        createWindow(wndMain) 
        hideAllWindows() 
        setJetpackMaxHeight ( 9001 ) 
         
        triggerServerEvent('onLoadedAtClient', g_ResRoot, g_Me) 
    end 
) 
  
function showWelcomeMap() 
    createWindow(wndSpawnMap) 
    showCursor(true) 
end 
  
function showMap() 
    createWindow(wndSetPos) 
    showCursor(true) 
end 
  
function toggleFRWindow() 
     local accountName = getAccountName ( player ) 
    if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
  
    if isWindowOpen(wndMain) then 
        showCursor(false) 
        hideAllWindows() 
        colorPicker.closeSelect() 
    else 
        showCursor(true) 
        showAllWindows() 
    end 
    end 
end 
  
  
addCommandHandler('fr', toggleFRWindow) 

Link to comment
aqui tienes :D
--------------------------- 
---Main window 
--------------------------- 
  
function updateGUI(updateVehicle) 
    -- update position 
    local x, y, z = getElementPosition(g_Me) 
    setControlNumbers(wndMain, {xpos=math.ceil(x), ypos=math.ceil(y), zpos=math.ceil(z)}) 
     
end 
  
  
  
wndMain = { 
    'wnd', 
    text = 'Panel', 
    x = 10, 
    y = 150, 
    width = 280, 
    controls = { 
        {'lbl', text='Local player'}, 
        {'br'}, 
        {'btn', id='playergrav', text='grav', window=wndGravity}, 
        {'btn', id='setpos', text='map', window=wndSetPos}, 
    }, 
    oncreate = mainWndShow, 
    onclose = mainWndClose 
} 
  
function errMsg(msg) 
    outputChatBox(msg, 255, 0, 0) 
end 
  
  
addEventHandler('onClientResourceStart', g_ResRoot, 
    function() 
        fadeCamera(true) 
        setTimer(getPlayers, 1000, 1) 
         
        bindKey('f1', 'down', toggleFRWindow) 
        createWindow(wndMain) 
        hideAllWindows() 
        setJetpackMaxHeight ( 9001 ) 
         
        triggerServerEvent('onLoadedAtClient', g_ResRoot, g_Me) 
    end 
) 
  
function showWelcomeMap() 
    createWindow(wndSpawnMap) 
    showCursor(true) 
end 
  
function showMap() 
    createWindow(wndSetPos) 
    showCursor(true) 
end 
  
function toggleFRWindow() 
     local accountName = getAccountName ( player ) 
    if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
  
    if isWindowOpen(wndMain) then 
        showCursor(false) 
        hideAllWindows() 
        colorPicker.closeSelect() 
    else 
        showCursor(true) 
        showAllWindows() 
    end 
    end 
end 
  
  
addCommandHandler('fr', toggleFRWindow) 

No Funciona y necesito que puedan abrirlo todos los del staff Admin, Moderator, SuperModerator Ayuda Porfa!

Link to comment
  • Recently Browsing   0 members

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