mustang Posted February 25, 2014 Share Posted February 25, 2014 (edited) السلام عليكم في عندي مشكلة والله ماني عارف كيف ازبطها function engineT() window8 = guiCreateWindow(466, 175, 411, 234, " ", false) vid = guiCreateEdit(180, 31, 84, 25, "", false, window8) combobox = guiCreateComboBox(144, 70, 229, 109, "Engine 4 (Golden Feathers)", false, window8) button1 = guiCreateButton(52, 190, 115, 31, "Install", false, window8) addEventHandler("onClientGUIClick", button1, installe, false) end addCommandHandler ( "engineworks", engineT ) function installe() local vehid = guiGetText(vid) local enginen = guiComboBoxGetSelected(comboBox) local result = exports.mysql:query_free("UPDATE vehicles SET HD = " .. vehid .. " WHERE id = ".. enginen ) end WARRNING: ****/***.lua:59Bad argument @ 'guiGetText' [Expected gui-element at argument 1, go nil] WARRNING: ****/***.lua:59Bad argument @ 'guiComboBoxGetSelected' [Expected gui-element at argument 1, go nil] و شكرا Edited February 26, 2014 by Guest Link to comment
abu5lf Posted February 25, 2014 Share Posted February 25, 2014 استبدل هذي: local enginen = guiComboBoxGetSelected(comboBox) بهذي: local enginen = guiComboBoxGetItemText( combobox, guiComboBoxGetSelected( combobox ) ) Link to comment
3ssol Posted February 25, 2014 Share Posted February 25, 2014 ممكن تقولي وش الفرق بينهم اخ عاشق ؟ Link to comment
فاّرس Posted February 26, 2014 Share Posted February 26, 2014 string guiComboBoxGetItemText ( element comboBox, int itemId ) itemId: The index of the item. int guiComboBoxGetSelected ( element comboBox ) Returns the index of the selected item if the specified combobox is valid and has a selected item, -1 if no item is selected, false or nil otherwise. Link to comment
mustang Posted February 26, 2014 Author Share Posted February 26, 2014 انا رح اجرب و راح اشوف شو النتيجة Link to comment
mustang Posted February 26, 2014 Author Share Posted February 26, 2014 استبدل هذي: local enginen = guiComboBoxGetSelected(comboBox) بهذي: local enginen = guiComboBoxGetItemText( combobox, guiComboBoxGetSelected( combobox ) ) ما زبط للاسف Link to comment
abu5lf Posted February 26, 2014 Share Posted February 26, 2014 طلع خطأ في debguscript 3 ? Link to comment
mustang Posted February 26, 2014 Author Share Posted February 26, 2014 طلع خطأ في debguscript 3 ? يب ، بطلع لما إكبس إل button Link to comment
mustang Posted February 26, 2014 Author Share Posted February 26, 2014 WARRNING: ****/***.lua:66 bad argument @ 'guiComboBoxGetSelected' [Expected gui-combobox at argument 1, got gui-edit] Link to comment
#DRAGON!FIRE Posted February 26, 2014 Share Posted February 26, 2014 (edited) WARRNING: ****/***.lua:66 bad argument @ 'guiComboBoxGetSelected' [Expected gui-combobox at argument 1, got gui-edit] متاكد انك حاط اسم الألمنت صحيح .. ومتاكد من وجود الكمبو بوكس : guiComboBoxGetSelected لو متأكد اطرح سطر الكمبو بوكس .. والكود كامل حق Edited September 11, 2014 by Guest Link to comment
mustang Posted February 26, 2014 Author Share Posted February 26, 2014 هذا إلكود معدل على طريقة عاشق function engineT() window8 = guiCreateWindow(466, 175, 411, 234, " ", false) vid = guiCreateEdit(180, 31, 84, 25, "", false, window8) combobox = guiCreateComboBox(144, 70, 229, 109, "Engine 4 (Golden Feathers)", false, window8) button1 = guiCreateButton(52, 190, 115, 31, "Install", false, window8) addEventHandler("onClientGUIClick", button1, installe, false) end addCommandHandler ( "engineworks", engineT ) function installe() local vehid = guiComboBoxGetItemText( vid, guiGetText( vid ) ) local enginen = guiComboBoxGetItemText( combobox, guiComboBoxGetSelected( combobox ) ) local result = exports.mysql:query_free("UPDATE vehicles SET HD = " .. vehid .. " WHERE id = ".. enginen ) end Link to comment
فاّرس Posted February 26, 2014 Share Posted February 26, 2014 -- Client Side # window8 = guiCreateWindow(466, 175, 411, 234, " ", false) vid = guiCreateEdit(180, 31, 84, 25, "", false, window8) combobox = guiCreateComboBox(144, 70, 229, 109, "Engine 4 (Golden Feathers)", false, window8) button1 = guiCreateButton(52, 190, 115, 31, "Install", false, window8) guiSetVisible(window8,false) function engineT() guiSetVisible(window8,not guiGetVisible(window8)) showCursor(guiGetVisible(window8)) end addCommandHandler ( "engineworks", engineT ) addEventHandler("onClientGUIClick", button1, installe, false) addEventHandler("onClientGUIClick", button1,function () local vehid = guiGetText( vid ) local enginen = guiComboBoxGetItemText( combobox, guiComboBoxGetSelected( combobox ) ) local result = exports.mysql:query_free("UPDATE vehicles SET HD = " .. vehid .. " WHERE id = ".. enginen ) end ,false ) لو ما اشتغل اطرح اكوادك كامله عشان نقدر نساعدك ! Link to comment
mustang Posted February 26, 2014 Author Share Posted February 26, 2014 -- Client Side # window8 = guiCreateWindow(466, 175, 411, 234, " ", false) vid = guiCreateEdit(180, 31, 84, 25, "", false, window8) combobox = guiCreateComboBox(144, 70, 229, 109, "Engine 4 (Golden Feathers)", false, window8) button1 = guiCreateButton(52, 190, 115, 31, "Install", false, window8) guiSetVisible(window8,false) function engineT() guiSetVisible(window8,not guiGetVisible(window8)) showCursor(guiGetVisible(window8)) end addCommandHandler ( "engineworks", engineT ) addEventHandler("onClientGUIClick", button1, installe, false) addEventHandler("onClientGUIClick", button1,function () local vehid = guiGetText( vid ) local enginen = guiComboBoxGetItemText( combobox, guiComboBoxGetSelected( combobox ) ) local result = exports.mysql:query_free("UPDATE vehicles SET HD = " .. vehid .. " WHERE id = ".. enginen ) end ,false ) لو ما اشتغل اطرح اكوادك كامله عشان نقدر نساعدك ! إلايرور بطل يطلع ، بس إلمشكله الآن إنه إلقيمة ما بتتغير بال database كمان هذا تقريبا كل إلكود الباقي tables فيهم تعديل handling ماله دخل 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