TheIceman1 Posted March 15, 2013 Posted March 15, 2013 (edited) addEventHandler("onClientGUIClick", GUIEditor_Button[1], function() exports.cpicker:openPicker(localPlayer, "#FFAA00", "Clan system") end) addEvent ( "onColorPickerOK", true ) addEventHandler("onColorPickerOK", root, function(element, hex, r, g, b) guiSetText(GUIEditor_Edit[2], r ) guiSetText(GUIEditor_Edit[3], g ) guiSetText(GUIEditor_Edit[4], b ) end) Edited March 15, 2013 by Guest Need paid scripter just pm me i will accept every job!
Castillo Posted March 15, 2013 Posted March 15, 2013 You forgot the addEvent function: addEvent ( "onColorPickerOK", true ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Tete omar Posted March 15, 2013 Posted March 15, 2013 If you don't use the following arguments: elements, hex; why are you passing them to this function?
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 Nothing happens. Need paid scripter just pm me i will accept every job!
Tete omar Posted March 15, 2013 Posted March 15, 2013 Nothing happens. Show us how did you add castillo's code
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 If you don't use the following arguments:elements, hex; why are you passing them to this function? if i delete "element" and "hex" then in edit says "#f0f00"(hex code). addEventHandler("onClientGUIClick", GUIEditor_Button[1], function() exports.cpicker:openPicker(localPlayer, "#FFAA00", "Clan system") end) addEvent ( "onColorPickerOK", true ) addEventHandler("onColorPickerOK", root, function(element, hex, r, g, b) guiSetText(GUIEditor_Edit[2], r ) guiSetText(GUIEditor_Edit[3], g ) guiSetText(GUIEditor_Edit[4], b ) end) Need paid scripter just pm me i will accept every job!
Castillo Posted March 15, 2013 Posted March 15, 2013 No errors on your debugscript? you are clicking the "OK" button after choosing the color, right? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Tete omar Posted March 15, 2013 Posted March 15, 2013 It seems right to me, but can you show us what debugscript says?
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 No errors.Yes im 100% sure i clicked "OK" Need paid scripter just pm me i will accept every job!
Castillo Posted March 15, 2013 Posted March 15, 2013 addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], function ( ) exports.cpicker:openPicker ( localPlayer, "#FFAA00", "Clan system" ) end ,false ) addEvent ( "onColorPickerOK", true ) addEventHandler ( "onColorPickerOK", root, function ( element, hex, r, g, b ) guiSetText ( GUIEditor_Edit[2], r ) guiSetText ( GUIEditor_Edit[3], g ) guiSetText ( GUIEditor_Edit[4], b ) outputChatBox ( r ..", ".. g ..", ".. b ) end ) See what it outputs to chat. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 Castillo,it outputs r,g,b,but look this this code set only edit[2],edit[3] text. Need paid scripter just pm me i will accept every job!
Tete omar Posted March 15, 2013 Posted March 15, 2013 Are you putting the code in the same resource 'cpicker'??
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 No Need paid scripter just pm me i will accept every job!
Castillo Posted March 15, 2013 Posted March 15, 2013 So, it's only loading R and G colors? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 Yes Need paid scripter just pm me i will accept every job!
Jaysds1 Posted March 15, 2013 Posted March 15, 2013 maybe you created the blue editbox first, so try guiSetText ( GUIEditor_Edit[1], b ) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Castillo Posted March 15, 2013 Posted March 15, 2013 Yes The problem must be on your GUI then. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 GUIEditor_Edit[4] = guiCreateEdit(139,90,49,34,"",false,GUIEditor_Window[1]) Need paid scripter just pm me i will accept every job!
Castillo Posted March 15, 2013 Posted March 15, 2013 Maybe you got messed up indexs. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 Solved,i found problem! Need paid scripter just pm me i will accept every job!
Castillo Posted March 15, 2013 Posted March 15, 2013 What was it? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 There was two edits with name GUIEditor_Edit[4],but i have new problem Why this dont set element data?Error "setElementData"[Expected bool at argument 4, got string"59"] local r = guiGetText ( GUIEditor_Edit[2] ) local g = guiGetText ( GUIEditor_Edit[3] ) local b = guiGetText ( GUIEditor_Edit[4] ) setElementData ( localPlayer, "color", r, g, b ) Need paid scripter just pm me i will accept every job!
Castillo Posted March 15, 2013 Posted March 15, 2013 Because you are setting it wrong, "r, g, b" should be a table instead, like this: setElementData ( localPlayer, "color", { r, g, b } ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted March 15, 2013 Author Posted March 15, 2013 Because you are setting it wrong, "r, g, b" should be a table instead, like this: setElementData ( localPlayer, "color", { r, g, b } ) Thanks! Need paid scripter just pm me i will accept every job!
Castillo Posted March 15, 2013 Posted March 15, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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