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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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
Anubhav Posted August 13, 2014 Posted August 13, 2014 Not the same its diffrent one. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Et-win Posted August 13, 2014 Posted August 13, 2014 Exports code switched. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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