Blinker. Posted August 12, 2014 Posted August 12, 2014 Hello , i made a script to show/hide scoreboard columns , if a player clicks on a checkbox , a named column should hide / appear. the problem is when a player clicks on a checkbox it shows/hides the column for all , not only for the player that clicked on it.. Below you can see my code -- client side function click() if ( source == checkboxmoney ) then if guiCheckBoxGetSelected(checkboxmoney) then triggerServerEvent("deleteexportmoney",root,deleteexportmoney) else triggerServerEvent("addexportmoney",root,addexportmoney) end end end addEventHandler("onClientGUIClick",root,click) -- server side function deleteexportmoney() exports.scoreboard:addScoreboardColumn('Money') end addEvent("deleteexportmoney",true) addEventHandler("deleteexportmoney",root,deleteexportmoney) function addexportmoney() exports.scoreboard:removeScoreboardColumn('Money') end addEvent("addexportmoney",true) addEventHandler("addexportmoney",root,addexportmoney) Thanks in Advance
Et-win Posted August 12, 2014 Posted August 12, 2014 Try the exports in client-side. If that doesn't work, I'm afraid it's not possible to hide it for just one player. Or you have to edit scoreboard.
Blinker. Posted August 12, 2014 Author Posted August 12, 2014 well i guess remove / add scoreboardcolumn only works server-side , i tried it now and it showed call:Failed to call 'scoreboard:removeScoreboardcolumn and addScoreboardColumn
Saml1er Posted August 12, 2014 Posted August 12, 2014 I'm phone so I can't help but anyway try this: function deleteexportmoney() exports.scoreboard:removeScoreboardColumn('Money') end addEvent("deleteexportmoney",true) addEventHandler("deleteexportmoney",root,deleteexportmoney) function addexportmoney() exports.scoreboard:addScoreboardColumn('Money') end addEvent("addexportmoney",true) addEventHandler("addexportmoney",root,addexportmoney
Blinker. Posted August 13, 2014 Author Posted August 13, 2014 Now when i click one time Money column will hide , but doesnt work if i click another time , and still the same problem (show/hide for all players not for 1 )
Et-win Posted August 13, 2014 Posted August 13, 2014 I'm afraid it's not possible to hide it for just one player. Or you have to edit scoreboard.
Et-win Posted August 13, 2014 Posted August 13, 2014 well how can i edit the scoreboard? By going to resource 'scoreboard' and opening it. Open a script and have fun editing, lol.
Blinker. Posted August 13, 2014 Author Posted August 13, 2014 i didn't mean how to edit , but i meant what to edit i have no idea what can fix this thing
Saml1er Posted August 13, 2014 Posted August 13, 2014 So you want this script to work for a specific (1) player only? There are client side exported functions as well so: function click() if ( source == checkboxmoney ) then if guiCheckBoxGetSelected(checkboxmoney) then exports.scoreboard:scoreboardRemoveColumn ( 'Money') else exports.scoreboard:scoreboardAddColumn ('Money') end end end addEventHandler("onClientGUIClick",root,click) source: https://wiki.multitheftauto.com/wiki/Re ... scoreboard
Blinker. Posted August 13, 2014 Author Posted August 13, 2014 That Worked , Thank you a lot . Thank you Et-win too.
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