Jump to content

how to disable f1 if player is muted.


killingyasoon

Recommended Posts

function binds()
	bindKey(KeyToOpen or "F1","down", function ()  
		guiSetVisible(panel,not guiGetVisible(panel) )
		showCursor(guiGetVisible(panel))
		if guiGetVisible(panel) == true then mode = "no_binds_when_editing" else mode = "allow_binds" end
		guiSetInputMode(mode or "allow_binds")
	end
	end )

can you add it here? if possible

Link to comment
function noOpengui(thePlayer)
  if isPlayerMuted(thePlayer) then
    triggerClientEvent(thePlayer, "blockWindow", root)
  end
end
function binds()
	bindKey(KeyToOpen or "F1","down", function ()  
		guiSetVisible(panel,false )
		showCursor(guiGetVisible(panel))
		if guiGetVisible(panel) == true then mode = "no_binds_when_editing" else mode = "allow_binds" end
		guiSetInputMode(mode or "allow_binds")
	end
	end )
addEvent("blockWindow", true)
addEventHandler("blockWindow", root, binds)

 

Link to comment

Server: 

function CheckMute ()
    if isPlayerMuted ( source ) then
  		setElementData(source,"Muted",true);
    else
      setElementData(source,"Muted",false);
    end
end
addEventHandler("onPlayerMute", root,CheckMute)
addEventHandler("onPlayerJoin", root,CheckMute)

Client:

bindKey(KeyToOpen or "F1","down", function ()
    if getElementData(localPlayer,"Muted") then return end
    guiSetVisible(panel,false )
    showCursor(guiGetVisible(panel))
    if guiGetVisible(panel) == true then mode = "no_binds_when_editing" else mode = "allow_binds" end
    guiSetInputMode(mode or "allow_binds")
  end
end)

 

Edited by XisH
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...