sossa0108 Posted March 6, 2014 Share Posted March 6, 2014 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 Link to comment
Jacobob14 Posted March 6, 2014 Share Posted March 6, 2014 aqui tienes --------------------------- ---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
sossa0108 Posted March 6, 2014 Author Share Posted March 6, 2014 aqui tienes --------------------------- ---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
BorderLine Posted March 6, 2014 Share Posted March 6, 2014 Estas usando funciones de un Serverside isObjectInACLGroup("user."..getAccountName(playerAcc), aclGetGroup("Admin") que no puedes aplicarlas a un clientside usa un trigger Link to comment
sossa0108 Posted March 6, 2014 Author Share Posted March 6, 2014 Estas usando funciones de un Serverside isObjectInACLGroup("user."..getAccountName(playerAcc), aclGetGroup("Admin") que no puedes aplicarlas a un clientside usa un trigger me Podrias Ayudar Con Ese Tigger?? Porfavor lo necesito urgente Link to comment
Tomas Posted March 10, 2014 Share Posted March 10, 2014 Aquí tienes todo lo necesario: https://wiki.multitheftauto.com/wiki/TriggerServerEvent Link to comment
Recommended Posts