Jump to content

Small Problem


Blinker.

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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 

Posted

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 )

Posted

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

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