Jump to content

BindKey


Recommended Posts

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 ) 

Link to comment

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 ) 

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