WTF_ Posted August 29, 2017 Share Posted August 29, 2017 addEventHandler("onClientResourceStart", resourceRoot, function() w1 = guiCreateWindow(226, 50, 349, 457, "بائع أسلح", false) guiWindowSetSizable(w1, false) guiSetAlpha(w1, 1.00) guiSetProperty(w1, "CaptionColour", "FFFD000B") c1 = guiCreateComboBox(51, 37, 251, 239, "الأسلح", false, w1) guiComboBoxAddItem(c1, "Desert egale") guiComboBoxAddItem(c1, "Shotgun") guiComboBoxAddItem(c1, "Sawn-off") guiComboBoxAddItem(c1, "MP5") guiComboBoxAddItem(c1, "Uzi") guiComboBoxAddItem(c1, "M4") guiComboBoxAddItem(c1, "Sniper") guiComboBoxAddItem(c1, "Country Sniper") guiComboBoxAddItem(c1, "Grenade") guiComboBoxAddItem(c1, "Parachute") l1 = guiCreateLabel(41, 266, 262, 37, "الذخيرة المتوفرة : 100", false, w1) guiSetFont(l1, "default-bold-small") guiLabelSetColor(l1, 142, 0, 252) guiLabelSetHorizontalAlign(l1, "center", false) guiLabelSetVerticalAlign(l1, "center") l2 = guiCreateLabel(51, 303, 247, 33, "السعر :", false, w1) guiSetFont(l2, "default-bold-small") guiLabelSetColor(l2, 35, 251, 0) guiLabelSetHorizontalAlign(l2, "center", false) b1 = guiCreateButton(115, 336, 109, 50, "شــــراء", false, w1) guiSetFont(b1, "default-bold-small") guiSetProperty(b1, "NormalTextColour", "FF113FE9") b2 = guiCreateButton(291, 412, 49, 36, "خروج", false, w1) guiSetFont(b2, "default-bold-small") guiSetProperty(b2, "NormalTextColour", "FFF90000") end ) addEventHandler ( 'onClientGUIClick', root, function ( ) if ( source == b2 ) then guiSetVisible ( w1, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIComboBoxAccepted", guiRoot, function ( ) if ( source == c1 ) then guiComboBoxGetSelected ( c1 ) guiComboBoxGetItemText ( c1 , "Desert egale" ) if ( text == "السعر : 15000" ) then guiSetText ( l2 , text ) end end end ) مشكلة بتجيني دائماااااااا c.lua:52:Expected number , got non_convertible string. this warning may be an error in future versions سطر guiComboBoxGetItemText ( c1 , "Desert egale" ) Link to comment
Rockyz Posted August 29, 2017 Share Posted August 29, 2017 راجع الويكي string guiComboBoxGetItemText ( element comboBox, int itemId ) Link to comment
Ahmed_Negm Posted August 29, 2017 Share Posted August 29, 2017 (edited) guiComboBoxGetItemText ( c1 , "Desert egale" ) ازاي انت عايز تجيب التكست واحطط التكست وبعيدن اصلآ المفروض تدي الأمر دا اسم علشان تقدر تستخدمه بص علشان تجيب التكست بتاع الأختيار الي الاعب مختاره لازم الأول تجيب الأختيار دا عن طريق امر guiComboBoxGetSelected ( element comboBox ) كدا local item = guiComboBoxGetSelected ( c1 ) local text = guiComboBoxGetItemText ( c1 , item ) -- او ممكن كدا local text = guiComboBoxGetItemText ( c1 , guiComboBoxGetSelected ( c1 ) ) Edited August 29, 2017 by Ahmed_Negm 1 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