Jump to content

#triggerClientEvent


Recommended Posts

Hi Guys!

It's not work and debugscript is say it;

WARNING: sel/test_s.lua:6: Bad Argument @ 'bindKey'

Where is the my mistake?

Client-Side

function open() 
    if (guiGetVisible (duyuruGrid) == true) then 
    guiSetVisible(duyuruGrid, false) 
    showCursor(false) 
    elseif (guiGetVisible (duyuruGrid) == false) then 
    guiSetVisible(duyuruGrid, true) 
    showCursor(true) 
    end 
end 
addEvent("openGUI", true) 
addEventHandler("openGUI", getRootElement(), open) 

Server-Side

function open (player) 
    if isObjectInACLGroup ( "user.".. getAccountName( getPlayerAccount( player ) ), aclGetGroup ( "Admin" ) ) then 
        triggerClientEvent (player, "openGUI", player ) 
    end 
end 
bindKey ( player, "L", "down", open )  

Link to comment
  • Moderators

You can't bind anything without a player? :idea:

addEventHandler("onResourceStart",resourceRoot, 
function() 
local players = getElementsByType("player") 
for i=1,#players do 
bindKey ( players[i], "l", "down", open )  
end 
end) 
  
addEventHandler("onPlayerJoin",root, 
function() 
bindKey ( source, "l", "down", open )  
end) 
  

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