Jump to content

how to disable f1 if player is muted.


killingyasoon

Recommended Posts

Posted
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

Posted
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)

 

Posted (edited)

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
Posted
function blockWindow() 
  local muted =getElementData(localPlayer, "muted") 
  if muted == true then 
     guiSetVisible(panel, false) 
    end 
end
function noOpengui(thePlayer) 
  if isPlayerMuted(thePlayer) then
     setElementData(thePlayer, "muted", true) 
  else
      setElementData(thePlayer, "muted", false) 
    end 
end 

Try that

Posted (edited)
22 hours ago, killingyasoon said:

none of both are working, sorry ik i am a :O, but i need your help.

What do you get in debugscript? Also, are you using the SERVER part in a server file?

Since it looks really weird to me

Edited by XisH
Posted
2 hours ago, XisH said:

What do you get in debugscript? Also, are you using the SERVER part in a server file?

Since it looks really weird to me

no :~ in debugscript, yes i do i'm using the server part in server file, and idk how it's not working.

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