Jump to content

create a private HELP panel


DiGiTal

Recommended Posts

try this client side

Spoiler

function guiToggleVisible ( )        
if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount (player) ), aclGetGroup ( "Admin" ) ) then
        if ( guiGetVisible ( admenwindow ) == true ) then -- check if the gui element is visible               
                guiSetVisible ( admenwindow, false ) -- if it is, we hide it
                showCursor(false)
        else              
                guiSetVisible ( admenwindow, true ) -- if not, we make it visible
                showCursor(true)
        end
end
end

 

  • Like 1
Link to comment
  • Moderators

Use these functions Server side:

getAccountName
getPlayerAccount
isObjectInACLGroup
aclGetGroup
triggerClientEvent

And trigger a Client custom event to open the panel.

 

1 hour ago, Reval said:

try this client side

  Hide contents


 
function guiToggleVisible ( )        
if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount (player) ), aclGetGroup ( "Admin" ) ) then
        if ( guiGetVisible ( admenwindow ) == true ) then -- check if the gui element is visible               
                guiSetVisible ( admenwindow, false ) -- if it is, we hide it
                showCursor(false)
        else              
                guiSetVisible ( admenwindow, true ) -- if not, we make it visible
                showCursor(true)
        end
end
end

 

That will not work. You're mixing server-side functions with client side.

Edited by DNL291
  • Like 1
Link to comment
--Client 
key = "F3"
bindKey(key,"down",
function ()
triggerServerEvent("onPlayerOpenPanel",localPlayer)
end
)

addEvent("open",true)
addEventHandler("open",root,
function ()
if  guiGetVisible (Window ) == false  then             
guiSetVisible (Window,true) 
showCursor(true)
playSoundFrontEnd(20)
else              
guiSetVisible (Window,false) 
showCursor(false)
              end
		end 

)


--Server
addEvent("onPlayerOpenPanel",true)
addEventHandler("onPlayerOpenPanel",root,
function ()
acc = getPlayerAccount(source)
if not isGuestAccount(acc) then 
if isObjectInACLGroup( "user.".. getAccountName(acc),aclGetGroup ( "Admin" ) ) then
triggerClientEvent(source,"open",source)
end
end
end
)

 

  • Like 1
Link to comment

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