Wei Posted July 19, 2012 Share Posted July 19, 2012 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
TwiX! Posted July 19, 2012 Share Posted July 19, 2012 you trigger to COLOR ® triggerServerEvent("setColor",source, r, g, b ) or triggerServerEvent(source,"setColor", r, g, b ) or triggerServerEvent(element,"setColor", r, g, b ) i don't know what it's element Link to comment
HunT Posted July 19, 2012 Share Posted July 19, 2012 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
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