^#Dream Posted July 24, 2014 Share Posted July 24, 2014 السلام عليكم كيف الحال ؟ انا ابي اععرف كيف اخلي لو ضغطت على رو من القريد لست تجي صورهه بالنافذهه ؟ وشكرا لكم مقدمآ Link to comment
jafar Posted July 24, 2014 Share Posted July 24, 2014 إستبدل الـ ,gridlist بإسم القريد لست حقك. واستبدل احداثيات الصورة بإحداثيات صورتك وحط لها بارنت اللوحة: ) ImgTable = { { "img1", "img1.png" }; { "img2", "img2.png" }; { "img3", "img3.png" }; -- { "imgName, "filePath" }; }; img = guiCreateStaticImage ( 200, 200, 100, 100, ImgTable [ 1 ][ 2 ], false ); guiSetVisible ( img, false ); for i, v in ipairs ( ImgTable ) do local row = guiGridListAddRow ( gridlist ); guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); end addEventHandler ( "onClientGUIClick", root, function ( ) if source == gridlist then if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); if filePath and filePath ~= "" then guiStaticImageLoadImage ( img, filePath ); end end end ); Link to comment
iMr.TZ[W]ER Posted July 24, 2014 Share Posted July 24, 2014 https://forum.multitheftauto.com/viewtopic.php?f=160&t=77005 Link to comment
^#Dream Posted July 26, 2014 Author Share Posted July 26, 2014 الله يعطيك العافيةة ! بس بغيت لو فتح النافذه يطلع له صورةة X يعني بدون مايضغط على رو جربت احط صورهه بس مانفع لو اضغط على بتطلع الصوره فوق الـ x Link to comment
^#Dream Posted July 26, 2014 Author Share Posted July 26, 2014 + جتني مشكلة ثانية اذا ضغطت على صورة وضغطت على رو ثاني ماتروح الصورة الاولى GUIEditor = { button = {}, staticimage = {} } Window = guiCreateWindow(281, 109, 320, 393, "- [ Health Shop ] - ", false) guiWindowSetSizable(Window, false) guiSetAlpha(Window, 1.00) GridList = guiCreateGridList(9, 20, 159, 363, false, Window) Col = guiGridListAddColumn(GridList, "Menu", 0.5) Col = guiGridListAddColumn(GridList, "Price", 0.5) for i = 1, 8 do row = guiGridListAddRow(GridList) end guiGridListSetItemText(GridList, 0, 1, "Health1", false, false) guiGridListSetItemText(GridList, 0, 2, "100", false, false) guiGridListSetItemText(GridList, 1, 1, "Health2", false, false) guiGridListSetItemText(GridList, 1, 2, "500", false, false) guiGridListSetItemText(GridList, 2, 1, "Health3", false, false) guiGridListSetItemText(GridList, 2, 2, "1000", false, false) guiGridListSetItemText(GridList, 2, 2, "Health4", false, false) guiGridListSetItemText(GridList, 2, 2, "1500", false, false) guiGridListSetItemText(GridList, 3, 1, "Health5", false, false) guiGridListSetItemText(GridList, 3, 2, "2000", false, false) guiGridListSetItemText(GridList, 4, 1, "Health6", false, false) guiGridListSetItemText(GridList, 4, 2, "2500", false, false) Button = guiCreateButton(178, 351, 132, 32, "= [ Close ] =", false, Window) guiSetProperty(Button, "NormalTextColour", "FFAAAAAA") Button1 = guiCreateButton(178, 305, 132, 32, "= [ Buy ] =", false, Window) guiSetProperty(Button2, "NormalTextColour", "FFAAAAAA") guiSetVisible(Window, true) function hidegui() guiSetVisible(Window, false) showCursor ( false ) end addEventHandler ( "onClientGUIClick", Button, hidegui, false ) addEventHandler("onClientGUIClick", guiRoot, function() if source == Button1 then local row = guiGridListGetSelectedItem(GridList) if row == 0 then triggerServerEvent("setMyHealth", localPlayer) elseif row == 1 then triggerServerEvent("setMyHealth1", localPlayer) elseif row == 2 then triggerServerEvent("setMyHealth2", localPlayer) elseif row == 3 then triggerServerEvent("setMyHealth3", localPlayer) elseif row == 4 then triggerServerEvent("setMyHealth4", localPlayer) end end end) ImgTable = { { "health", "health1.png" }; { "health2", "health2.png" }; { "img3", "img3.png" }; -- { "imgName, "filePath" }; }; img = guiCreateStaticImage ( 171, 21, 139, 257, ImgTable [ 1 ][ 2 ], false, Window ); guiSetVisible ( img, false ); for i, v in ipairs ( ImgTable ) do guiGridListSetItemText ( GridList, row, 1, v [ 1 ], false, false ); guiGridListSetItemData ( GridList, row, 1, v [ 2 ] ); end addEventHandler ( "onClientGUIClick", root, function ( ) if source == GridList then if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end local filePath = guiGridListGetItemData ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ); if filePath and filePath ~= "" then guiStaticImageLoadImage ( img, filePath ); end end end ); Link to comment
!#NssoR_) Posted July 26, 2014 Share Posted July 26, 2014 رتبتهم لك واختصرت عليك بعض الاكواد Note : غير مجرب GUIEditor = { button = {}, staticimage = {} } addEventHandler('onClientResourceStart',resourceRoot, function () Window = guiCreateWindow(281, 109, 320, 393, "- [ Health Shop ] - ", false) guiWindowSetSizable(Window, false) guiSetAlpha(Window, 1.00) GridList = guiCreateGridList(9, 20, 159, 363, false, Window) Col = guiGridListAddColumn(GridList, "Menu", 0.5) Col = guiGridListAddColumn(GridList, "Price", 0.5) Button = guiCreateButton(178, 351, 132, 32, "= [ Close ] =", false, Window) guiSetProperty(Button, "NormalTextColour", "FFAAAAAA") Button1 = guiCreateButton(178, 305, 132, 32, "= [ Buy ] =", false, Window) guiSetProperty(Button1, "NormalTextColour", "FFAAAAAA") guiSetVisible(Window, true) ImgTable = { { "health", "health1.png" }; { "health2", "health2.png" }; { "img3", "img3.png" }; -- { "imgName, "filePath" }; }; for i, v in ipairs ( ImgTable ) do row = guiGridListAddRow(GridList) guiGridListSetItemText ( GridList, row, 1, v [ 1 ], false, false ); guiGridListSetItemData ( GridList, row, 1, v [ 2 ] ); end img = guiCreateStaticImage ( 171, 21, 139, 257, ImgTable [ 1 ][ 2 ], false, Window ); guiSetVisible ( img, false ); end) addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if source == GridList then if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end local filePath = guiGridListGetItemData ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ); if filePath and filePath ~= "" then guiStaticImageLoadImage ( img, filePath ); end elseif source == Button then guiSetVisible(Window, false) showCursor ( false ) elseif source == Button1 then local row = guiGridListGetSelectedItem(GridList) if row == 0 then triggerServerEvent("setMyHealth", localPlayer) elseif row == 1 then triggerServerEvent("setMyHealth1", localPlayer) elseif row == 2 then triggerServerEvent("setMyHealth2", localPlayer) elseif row == 3 then triggerServerEvent("setMyHealth3", localPlayer) end end end ); Link to comment
^#Dream Posted July 26, 2014 Author Share Posted July 26, 2014 انا حاط فوق guiGridListSetItemText(GridList, 4, 1, "Health6", false, false) guiGridListSetItemText(GridList, 4, 2, "2500", false, false) وانت مسحتها وحطيت بالتيبل حقت الصور Health health1.png يطلع الاسم Health بس ابي اطلع السعر بعد ! Link to comment
!#NssoR_) Posted July 26, 2014 Share Posted July 26, 2014 لوووووول وليه زعلان طيب؟ يمديك تسويه بهذا الشكل , اكوادك الي انت كنت مسويها للسعر كثيره ع الفاضي GUIEditor = { button = {}, staticimage = {} } addEventHandler('onClientResourceStart',resourceRoot, function () Window = guiCreateWindow(281, 109, 320, 393, "- [ Health Shop ] - ", false) guiWindowSetSizable(Window, false) guiSetAlpha(Window, 1.00) GridList = guiCreateGridList(9, 20, 159, 363, false, Window) Col = guiGridListAddColumn(GridList, "Menu", 0.5) Col = guiGridListAddColumn(GridList, "Price", 0.5) Button = guiCreateButton(178, 351, 132, 32, "= [ Close ] =", false, Window) guiSetProperty(Button, "NormalTextColour", "FFAAAAAA") Button1 = guiCreateButton(178, 305, 132, 32, "= [ Buy ] =", false, Window) guiSetProperty(Button1, "NormalTextColour", "FFAAAAAA") guiSetVisible(Window, true) ImgTable = { { "health",2500, "health1.png" }; { "health2",300, "health2.png" }; { "img3",5400, "img3.png" }; -- { "imgName,price, "filePath" }; }; for i, v in ipairs ( ImgTable ) do row = guiGridListAddRow(GridList) guiGridListSetItemText ( GridList, row, 1, v [ 1 ], false, false ); guiGridListSetItemData ( GridList, row, 1, v [ 3 ] ); guiGridListSetItemText ( GridList, row, 2, v [ 2 ], false, false ); end img = guiCreateStaticImage ( 171, 21, 139, 257, ImgTable [ 1 ][ 3 ], false, Window ); guiSetVisible ( img, false ); end) addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if source == GridList then if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end local filePath = guiGridListGetItemData ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ); if filePath and filePath ~= "" then guiStaticImageLoadImage ( img, filePath ); end elseif source == Button then guiSetVisible(Window, false) showCursor ( false ) elseif source == Button1 then local row = guiGridListGetSelectedItem(GridList) if row == 0 then triggerServerEvent("setMyHealth", localPlayer) elseif row == 1 then triggerServerEvent("setMyHealth1", localPlayer) elseif row == 2 then triggerServerEvent("setMyHealth2", localPlayer) elseif row == 3 then triggerServerEvent("setMyHealth3", localPlayer) end end end ); 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