TorNix~|nR Posted January 6, 2020 Share Posted January 6, 2020 Hello guys, I wanted to know how to make this button be visible or open only for specific ACL button = guiCreateButton(370, 525, 80, 30, "Button", false, tab) if (source == button) then -- opens punishment window guiSetVisible(window, true) guiBringToFront(window) Help please Link to comment
Moderators Patrick Posted January 6, 2020 Moderators Share Posted January 6, 2020 (edited) https://wiki.multitheftauto.com/wiki/IsPlayerInACL This example open window with command. First, check acl rights on server side, after it trigger client. -- SERVER function isPlayerInACL(player, acl) if isElement(player) and getElementType(player) == "player" and aclGetGroup(acl or "") and not isGuestAccount(getPlayerAccount(player)) then local account = getPlayerAccount(player) return isObjectInACLGroup( "user.".. getAccountName(account), aclGetGroup(acl) ) end return false end addCommandHandler("open", function(player) if isPlayerInACL(player, "groupWhoCanOpenPanel") then -- is player added to acl group? triggerClientEvent(player, "openPanel", player) -- if yes trigger the panel open else outputChatBox("You have no right to it :(", player) -- :( end end) -- CLIENT addEvent("openWindow", true) addEventHandler("openWindow", root, function() guiSetVisible(window, true) guiBringToFront(window) end) Edited January 6, 2020 by stPatrick 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now