Lucas Henrique Posted February 10, 2019 Share Posted February 10, 2019 Meu servidor esta com handling de mod ativado, eu já entrei varias vezes nas configurações lua do handling achando aonde colocar isObjectInACLGroup e então nunca achei já coloquei vários em .lua (cliente side e sever side) do handling eu queria saber aonde e oque colocar pra só staffs ter acesso lembrando que a ACL é Staff. Link to comment
#DaNiLiN Posted February 10, 2019 Share Posted February 10, 2019 Bom, tu iria ter que procurar a função que abre/fecha o painel para poder adiciona a função isObjectInACLGroup. Procura sempre por guiSetVisible, dai com facilidade tu chega até a função que abre e fecha. Link to comment
Lucas Henrique Posted February 10, 2019 Author Share Posted February 10, 2019 function startBuilding ( ) if DEBUGMODE then outputDebugString ( "Building the gui.." ) end if heditGUI.window then destroyGUI ( ) end local template = getUserTemplate ( ) if not template then if DEBUGMODE then end return false end local window = buildMainWindow ( template ) buildUtilButtons ( template ) buildMenuButtons ( template ) buildMenus ( template ) buildSpecials ( template ) guiSetVisible ( window, false ) toggleEvents ( window, true ) forceVehicleChange ( ) checkTheUpdates ( ) -- We check the updates after the gui has been build, because like this the updates will get listed upon a setting change too. bindKey ( getUserConfig ( "usedKey" ), "down", toggleEditor ) addCommandHandler ( getUserConfig ( "usedCommand" ), toggleEditor ) return true end Aonde coloca? Link to comment
Other Languages Moderators Lord Henry Posted February 10, 2019 Other Languages Moderators Share Posted February 10, 2019 IsObjectInACLGroup é uma função server-side. Não tem como colocar junto com guiSetVisible, que é uma função client-side. 1 Link to comment
Lucas Henrique Posted February 10, 2019 Author Share Posted February 10, 2019 Então onde posso colocar ele? Link to comment
Jonas^ Posted February 10, 2019 Share Posted February 10, 2019 Use um trigger do client ao server pra verificar. Link to comment
Lucas Henrique Posted February 10, 2019 Author Share Posted February 10, 2019 Se eu soubesse kkkk Sou muito iniciante nisso, desculpe. addEventHandler ( "onPlayerLogin", root, function ( ) local admin = isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) triggerClientEvent ( source, "updateClientRights", source, true, admin ) end ) Achei isso em Core.lua Sever side. Link to comment
Jonas^ Posted February 10, 2019 Share Posted February 10, 2019 É mais ou menos isso mostre a parte do client-side. Link to comment
Lucas Henrique Posted February 10, 2019 Author Share Posted February 10, 2019 Não tem isObjectInACLGroup em cliente side addEvent ( "requestRights", true ) addEventHandler ( "requestRights", root, function ( ) if not isValidPlayer ( client ) then if DEBUGMODE then error ( "Invalid client at event 'requestRights'!", 2 ) end return false end local pAccount = getPlayerAccount ( client ) if isGuestAccount ( pAccount ) then triggerClientEvent ( client, "updateClientRights", client, false, false ) else local admin = isObjectInACLGroup ( "user."..getAccountName ( pAccount ), aclGetGroup ( "Admin" ) ) triggerClientEvent ( client, "updateClientRights", client, true, admin ) end end ) Mais um em Server-side Link to comment
Jonas^ Posted February 10, 2019 Share Posted February 10, 2019 Não entendi exatamente oque você quer fazer. Link to comment
Lucas Henrique Posted February 10, 2019 Author Share Posted February 10, 2019 (edited) Quero colocar para apenas Staffs conseguir abrir o Painel b o Handling Edited February 10, 2019 by Lucas Henrique Link to comment
Jonas^ Posted February 10, 2019 Share Posted February 10, 2019 Mostre a função da bindKey. Link to comment
Lucas Henrique Posted February 10, 2019 Author Share Posted February 10, 2019 function startBuilding ( ) if DEBUGMODE then outputDebugString ( "Building the gui.." ) end if heditGUI.window then destroyGUI ( ) end local template = getUserTemplate ( ) if not template then if DEBUGMODE then end return false end local window = buildMainWindow ( template ) buildUtilButtons ( template ) buildMenuButtons ( template ) buildMenus ( template ) buildSpecials ( template ) guiSetVisible ( window, false ) toggleEvents ( window, true ) forceVehicleChange ( ) checkTheUpdates ( ) -- We check the updates after the gui has been build, because like this the updates will get listed upon a setting change too. bindKey ( getUserConfig ( "usedKey" ), "down", toggleEditor ) addCommandHandler ( getUserConfig ( "usedCommand" ), toggleEditor ) return true end Link to comment
#DaNiLiN Posted February 10, 2019 Share Posted February 10, 2019 Tu tem que achar a função que abre o painel e passar por triggerEvent. Exemplo: --CLIENT-SIDE function AbrirPainel () showCursor(true) guiSetVisible(Painel, true) else showCursor(false) guiSetVisible(Painel, false) end end addEvent("Open_Painel", true) addEventHandler("Open_Painel", resourceRoot, AbrirPainel) -- Server Side Grupo = "Console" function OpenGerenciador(source) accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. accountname, aclGetGroup(Grupo)) then triggerClientEvent(source, "Open_Painel", root) end end function BindStart() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "b", "down", OpenGerenciador) end end addEventHandler("onResourceStart", root, BindStart) function onPlayerJoin() bindKey(source, "b", "down", OpenGerenciador) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoin) function StopMod(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "b", "down", OpenGerenciador) end end addEventHandler("onResourceStop", root, StopMod) Link to comment
Lucas Henrique Posted February 10, 2019 Author Share Posted February 10, 2019 addEventHandler ( "onPlayerLogin", root, function ( ) ----- Server-Side local admin = isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) triggerClientEvent ( source, "updateClientRights", source, true, admin ) triggerClientEvent(source, "showMenu", root) end ) ----- Client-Side addEvent ( "showMenu", true ) addEventHandler ( "showMenu", root, guiShowMenu ) Link to comment
[R]odrigues Posted March 16, 2020 Share Posted March 16, 2020 Olá, estou com duvidas tbm sobre isso, mas meu handling é diferente, tem como você me mandar um link de download ? @Lucas Henrique De preferencia q so staff pode abrir, pois n sei quase nada de script em Lua. Vlw man! Link to comment
Other Languages Moderators Lord Henry Posted March 16, 2020 Other Languages Moderators Share Posted March 16, 2020 @[R]odrigues não peça mods prontos aqui. Isso viola as regras do fórum. E não reviva tópicos antigos. Link to comment
Recommended Posts