Mostafa MohammeD Posted March 26, 2016 Author Share Posted March 26, 2016 local places = { {"النخيل",2123.62622, 1397.25793, 10.81252}, {"منطقة سي جي",2494.11475, -1670.83850, 13.33595}, {"ساحة الالعاب",2683.67017, -1683.80151, 9.42411}, {"المطار الاول",1658.57507, -2519.34888, 13.54688}, {"المطار الثاني",-1180.51404, -197.14261, 14.14844}, {"المطار الثالث",1674.34668, 1611.93433, 10.82031}, {"استاد الكرة",1364.30066, 2165.78101, 11.01563}, {"المجمع السكني",2568.18945, 1826.29065, 10.82031}, } GUIEditor = { gridlist = {}, staticimage = {}, button = {}, label = {} } wnd = guiCreateStaticImage(0.00, 0.21, 0.16, 0.56, "11.png", true) guiSetProperty(wnd, "ImageColours", "tl:FF00FFFC tr:FF00FFFC bl:FF00FFFC br:FF00FFFC") guiSetVisible(wnd,false) label = guiCreateLabel(18, 10, 168, 40, "places mod", false, wnd) guiSetFont(label, "sa-header") guiLabelSetColor(label, 0, 255, 252) grid = guiCreateGridList(6, 87, 195, 289, false, wnd) guiGridListAddColumn(grid, "Places:", 0.6) for k,v in ipairs(places) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemData(grid,row,1,{v[2],v[3],v[4]}) end btn_warb = guiCreateButton(8, 380, 60, 32, "warb", false, wnd) guiSetFont(btn_warb, "default-bold-small") guiSetProperty(btn_warb, "NormalTextColour", "FF00FFFC") btn_close = guiCreateButton(155, 380, 40, 32, "✖", false, wnd) guiSetProperty(btn_close, "NormalTextColour", "FF00FFFC") label2 = guiCreateLabel(10, 418, 181, 16, "that mod made by :- 1XxCr[o]sS", false, wnd) guiSetFont(label2, "default-bold-small") guiLabelSetColor(label2, 0, 255, 252) search = guiCreateEdit(6, 56, 195, 27, "", false, wnd) guiSetProperty(search, "NormalTextColour", "FF00FFFC") bindKey ("F6", "down", function () guiSetVisible(wnd, not guiGetVisible(wnd)) showCursor(guiGetVisible(wnd)) end) addEventHandler('onClientGUIClick',root, function () if source == btn_close then guiSetVisible(wnd,false) showCursor(false) end end ) addEventHandler("onClientGUIChanged",search,function () guiGridListClear(grid) for k,v in ipairs(places) do if string.find(v[1],guiGetText(search)) then local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemData(grid,row,1,{v[2],v[3],v[4]}) end end end,false) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn_warb ) then if ( guiGridListGetSelectedItem ( grid ) ~= -1 ) then setElementPosition ( localPlayer, unpack ( guiGridListGetItemData ( grid, guiGridListGetSelectedItem ( grid ), 1 ) ) ) outputChatBox ( "*تم نقلك بنجاح للمكان الذي اخترته *", 0, 255, 0, true ) else outputChatBox ( "*الرجاء اختيار مكان لتنتقل له*", 255, 0, 0, true ) end end end ) مشكووووووووووووووووووور ممكن تشرحلي الكود مشان افهمه Link to comment
#|_oskar_|# Posted March 26, 2016 Share Posted March 26, 2016 الكود حقك كان في بق من المنتدي guiGridListAddColumn(grid, "places", 0. وكان يخرب المود كامل وكود البحث غيرته وسويت لك كود جديد addEventHandler("onClientGUIChanged",search,function () guiGridListClear(grid) for k,v in ipairs(places) do if string.find(v[1],guiGetText(search)) then local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemData(grid,row,1,{v[2],v[3],v[4]}) end end end,false) وبس اى استفتسار ثاني تفضل قوله Link to comment
Mostafa MohammeD Posted March 26, 2016 Author Share Posted March 26, 2016 الكود حقك كان في بق من المنتدي guiGridListAddColumn(grid, "places", 0. وكان يخرب المود كامل وكود البحث غيرته وسويت لك كود جديد addEventHandler("onClientGUIChanged",search,function () guiGridListClear(grid) for k,v in ipairs(places) do if string.find(v[1],guiGetText(search)) then local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemData(grid,row,1,{v[2],v[3],v[4]}) end end end,false) وبس اى استفتسار ثاني تفضل قوله ممكن تشرحلي كود البحث وشئ ثاني اسف guiGridListSetItemColor ( grid, row, col, 0, 255, 252 , 255 ) هاي الكود ما غير لون القريد ليست ليش اكواد كامله local places = { {"النخيل",2123.62622, 1397.25793, 10.81252}, {"منطقة سي جي",2494.11475, -1670.83850, 13.33595}, {"ساحة الالعاب",2683.67017, -1683.80151, 9.42411}, {"المطار الاول",1658.57507, -2519.34888, 13.54688}, {"المطار الثاني",-1180.51404, -197.14261, 14.14844}, {"المطار الثالث",1674.34668, 1611.93433, 10.82031}, {"استاد الكرة",1364.30066, 2165.78101, 11.01563}, {"المجمع السكني",2568.18945, 1826.29065, 10.82031}, } GUIEditor = { gridlist = {}, staticimage = {}, button = {}, label = {} } wnd = guiCreateStaticImage(0.00, 0.21, 0.16, 0.56, "11.png", true) guiSetProperty(wnd, "ImageColours", "tl:FF00FFFC tr:FF00FFFC bl:FF00FFFC br:FF00FFFC") guiSetVisible(wnd,false) label = guiCreateLabel(18, 10, 168, 40, "places mod", false, wnd) guiSetFont(label, "sa-header") guiLabelSetColor(label, 0, 255, 252) grid = guiCreateGridList(6, 87, 195, 289, false, wnd) local col = guiGridListAddColumn(grid, "Places:", 0.6) guiGridListSetItemColor ( grid, row, col, 0, 255, 252 , 255 ) for k,v in ipairs(places) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemData(grid,row,1,{v[2],v[3],v[4]}) end btn_warb = guiCreateButton(8, 380, 60, 32, "warb", false, wnd) guiSetFont(btn_warb, "default-bold-small") guiSetProperty(btn_warb, "NormalTextColour", "FF00FFFC") btn_close = guiCreateButton(155, 380, 40, 32, "✖", false, wnd) guiSetProperty(btn_close, "NormalTextColour", "FF00FFFC") label2 = guiCreateLabel(10, 418, 181, 16, "that mod made by :- 1XxCr[o]sS", false, wnd) guiSetFont(label2, "default-bold-small") guiLabelSetColor(label2, 0, 255, 252) search = guiCreateEdit(6, 56, 195, 27, "", false, wnd) guiSetProperty(search, "NormalTextColour", "FF00FFFC") bindKey ("F6", "down", function () guiSetVisible(wnd, not guiGetVisible(wnd)) showCursor(guiGetVisible(wnd)) end) addEventHandler('onClientGUIClick',root, function () if source == btn_close then guiSetVisible(wnd,false) showCursor(false) end end ) addEventHandler("onClientGUIChanged",search,function () guiGridListClear(grid) for k,v in ipairs(places) do if string.find(v[1],guiGetText(search)) then local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemData(grid,row,1,{v[2],v[3],v[4]}) end end end,false) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn_warb ) then if ( guiGridListGetSelectedItem ( grid ) ~= -1 ) then setElementPosition ( localPlayer, unpack ( guiGridListGetItemData ( grid, guiGridListGetSelectedItem ( grid ), 1 ) ) ) outputChatBox ( "*تم نقلك بنجاح للمكان الذي اخترته *", 0, 255, 0, true ) else outputChatBox ( "*الرجاء اختيار مكان لتنتقل له*", 255, 0, 0, true ) end end end ) واسف لازعاجك Link to comment
#|_oskar_|# Posted March 26, 2016 Share Posted March 26, 2016 اول شئ اللون ماشتغل لانك مو حاطه باللوب وبالنسبه لكود البحث سطر واحد بس اللى اضفته guiGetText -- يجيب الكلام من الايديت string.find -- يقراء الحرف اللى انكتب بالايديت ويقوم بالبحث عنه لو موجود يجيب لك سلسله نصيه من الكلمات اللى تم البحث عنها وان شاء الله تكون فهمت Link to comment
Mostafa MohammeD Posted March 27, 2016 Author Share Posted March 27, 2016 اول شئ اللون ماشتغل لانك مو حاطه باللوب وبالنسبه لكود البحث سطر واحد بس اللى اضفته guiGetText -- يجيب الكلام من الايديت string.find -- يقراء الحرف اللى انكتب بالايديت ويقوم بالبحث عنه لو موجود يجيب لك سلسله نصيه من الكلمات اللى تم البحث عنها وان شاء الله تكون فهمت اوك مشكور لك اوسكار 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