Jump to content

Question


TorNix~|nR

Recommended Posts

Hello guys, I need help please!

when someone join to server, I want to set this

function a()
            guiSetInputEnabled(true)
			guiSetInputMode ( "no_binds_when_editing" )
end
addEventHandler("onClientPlayerJoin", getRootElement(), a)

but it's not working, how can I make it for example when someone join, it disable using binds and when login back to normal?

Link to comment
3 minutes ago, TorNix~|nR said:

I want when a player join, he can not use the F1 F2 F3, for example all panels

Yeah, that will never work with 'guiSetInputMode'. You'll need to do something like

if getElementData(localPlayer, "LoggedIn") == true then
  --open panel
end

client-side and something like this

function onPlayerJoin()
  setElementData(source, "LoggedIn", false)
end
addEventHandler("onPlayerJoin", root, onPlayerJoin)

function onPlayerLogin()
  setElementData(source, "LoggedIn", true)
end
addEventHandler("onPlayerLogin", root, onPlayerLogin)

server-side. That's what I do and it works for me. Good luck :)

  • Thanks 1
Link to comment

it works for me ( i don't speak english :P )


function join()
    addEventHandler("onClientKey", root, disableKeys)
end
addEventHandler("onClientPlayerJoin", root, join)

function disableKeys(btn) 
    if ( btn == "F1" or btn == "F2" or btn == "F3" ) then 
   	    cancelEvent() 
    end
end 

-- or 

function disableKeys(btn) 
   	cancelEvent() 
end 

 

  • Thanks 1
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...