Jump to content

GUI one player see


Laysiks

Recommended Posts

Hello!

I've problem. My gui when im logging in is visible for all players on server. I have added addEventHandler("onPlayerLogin".. on server side and i have in this function trigger to open gui in client side but all players see this gui. How to make it visible for one player ?

Link to comment
addEventHandler("onPlayerLogin",getRootElement(), 
    function () 
    local pl = source 
    local acc = pl:getAccount() 
    local login = acc:getName() 
    local q = dbQuery(polaczenie,"SELECT rowid,* FROM postacie WHERE login=?",login) 
    local result = dbPoll(q,-1) 
    if #result == 0 then 
        triggerClientEvent("otworzgui",pl) 

That was bit s-side

Client

  
function open () 
if guiGetVisible(Postac.window[1]) == false then 
guiSetVisible(Postac.window[1],true) 
showCursor(true) 
else 
guiSetVisible(Postac.window[1],false) 
showCursor(false) 
end 
end 
addEvent("otworzgui",true) 
addEventHandler("otworzgui",getRootElement(),open) 

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