Electro88 Posted July 29, 2016 Posted July 29, 2016 Bind key why not working Server: function gui (player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then triggerClientEvent (player,"pop",player) end end bindKey("F2","down", gui) function bindTab(localPlayer ) bindKey(localPlayer, "F2","down", gui) end Client: function popa ( player ) guiSetVisible(Wnd,true) showCursor(true) end addEvent("pop",true) addEventHandler("pop", getRootElement(), popa )
Electro88 Posted July 29, 2016 Author Posted July 29, 2016 Not change anything and why random player please anyone help me ?
Walid Posted July 29, 2016 Posted July 29, 2016 Try this untested i'm using the phone. -- Server side function gui (player) local account = getPlayerAccount(player) if account and not isGuestAccount(account) then local accName = getAccountName (account) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then triggerClientEvent (player,"pop",player) end end end function bindTab( thePlayer ) bindKey( thePlayer, "F2","down", gui) end function bindTabOnPlayerJoin () bindTab(source) end addEventHandler("onPlayerJoin",root, bindTabOnPlayerJoin) function bindTabOnResourceStart () local players = getElementsByType("player") for index, player in pairs(players) do bindTab(player) end end addEventHandler("onResourceStart",resourceRoot, bindTabOnResourceStart ) -- Client side -- Client side function popa () guiSetVisible(Wnd,true) showCursor(true) end addEvent("pop",true) addEventHandler("pop", root), popa )
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