Jump to content

BindKey


Recommended Posts

Posted

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 ) 

76561198095270230.png

Posted

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 ) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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