Jump to content

color picker


Wei

Recommended Posts

addEventHandler("onClientGUIClick", guiRoot, 
function() 
    if source == vehicleShop["Color1Button"] then 
    openPicker(localPlayer) 
    end 
end 
) 
  
addEventHandler("onColorPickerOK", root,  
function(element, hex, r, g, b) 
    triggerServerEvent("setColor", r, g, b ) 
end 
) 

why it doesn't work ?

It opens but it doesn't trigger event

Link to comment

U need edit the AiboCpicker (the button for set the color)

in my old user panel i have this :

  
gui.button1 = guiCreateButton ( 338, 106, 64, 20, " Name_Button ", false, gui.window) 
  

and for trigger server

  
if (source == gui.button1) then 
Rcolor = guiGetText (gui.editr) -- get the numbers from edit  R 
Gcolor = guiGetText (gui.editg) -- get the numbers from edit  G 
Bcolor = guiGetText (gui.editb) -- get the numbers from edit  B 
triggerServerEvent ("name_event", getLocalPlayer(),Rcolor,Gcolor,Bcolor) 
  

server side

  
addEvent("name_event",true) 
addEventHandler ("name_event", getRootElement(),name_function) 
function name_function (Rcolor, Gcolor, Bcolor) 
-- setAccountData 
--getAccountData 
--set the color 
  

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