killingyasoon Posted September 7, 2018 Posted September 7, 2018 as the title says, how to disable f1 if player is muted.
Mqtyx Posted September 7, 2018 Posted September 7, 2018 Add isPlayerMuted check in the function that handles F1 to check whether the player is muted or not.
killingyasoon Posted September 7, 2018 Author Posted September 7, 2018 can you show me just an example?
Dimos7 Posted September 7, 2018 Posted September 7, 2018 function checkPlyer(thePlayer) if isPlayerMuted(thePlayer) then triggerClientEvent() end end something like that
killingyasoon Posted September 7, 2018 Author Posted September 7, 2018 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
Dimos7 Posted September 7, 2018 Posted September 7, 2018 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)
killingyasoon Posted September 10, 2018 Author Posted September 10, 2018 sorry for late responise, but it's not working, no errors so far.
sFxMTA Posted September 10, 2018 Posted September 10, 2018 (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 September 10, 2018 by XisH
Dimos7 Posted September 10, 2018 Posted September 10, 2018 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
killingyasoon Posted September 11, 2018 Author Posted September 11, 2018 none of both are working, sorry ik i am a :O, but i need your help.
sFxMTA Posted September 12, 2018 Posted September 12, 2018 (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 September 12, 2018 by XisH
killingyasoon Posted September 12, 2018 Author Posted September 12, 2018 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.
sFxMTA Posted September 12, 2018 Posted September 12, 2018 Take a look in the whole code if there's more than one bindkey on f1, because it seems impossible, the code should work...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now