Jump to content

Small Problem


Blinker.

Recommended Posts

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

Link to comment

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 

Link to comment

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

Link to comment

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