Doffy Posted May 25, 2017 Share Posted May 25, 2017 ابي اول ما اللاعب يختار رو معين تجيله صورة في الاحداثيات الي انا محددها محاولتي Mar = { {"Pepsi","$7,500"}, {"Coca Cola","$7,000"}, {"Miranda","$8,000"}, {"Smoke","$10,000"}, } for i,k in ipairs (Mar) do l = guiGridListAddRow (mlist) guiGridListSetItemText (mlist,l,1,tostring(k[1]),false,false) guiGridListSetItemText (mlist,l,2,tostring(k[2]),false,false) guiGridListSetItemColor(mlist,l,1,0,150,255) guiGridListSetItemColor(mlist,l,2,0,150,255) guiSetFont(mlist, "default-bold-small") end guiSetVisible(pimg, false) guiSetVisible(mimg, false) guiSetVisible(simg, false) guiSetVisible(cimg, false) addEventHandler("onClientGUIClick",root, function () local selr = guiGridListGetSelectedItem(mlist) if ( source == mlist ) then if selr == 0 then guiSetVisible(pimg, true) guiSetVisible(cimg, false) guiSetVisible(mimg, false) guiSetVisible(simg, false) elseif selr == 1 then guiSetVisible(pimg, false) guiSetVisible(cimg, true) guiSetVisible(mimg, false) guiSetVisible(simg, false) elseif selr == 2 then guiSetVisible(pimg, false) guiSetVisible(cimg, false) guiSetVisible(mimg, true) guiSetVisible(simg, false) elseif selr == 3 then guiSetVisible(pimg, false) guiSetVisible(cimg, false) guiSetVisible(mimg, false) guiSetVisible(simg, true) end end end ) Link to comment
Abdul KariM Posted May 25, 2017 Share Posted May 25, 2017 pimg cimg mimg simg هذي اسماء الصور ؟ Link to comment
Doffy Posted May 25, 2017 Author Share Posted May 25, 2017 4 minutes ago, Abdul KariM said: pimg cimg mimg simg هذي اسماء الصور ؟ يب Link to comment
Abdul KariM Posted May 25, 2017 Share Posted May 25, 2017 في غيرها بالسكربت ولا بس هذي الصور ؟ Link to comment
Doffy Posted May 25, 2017 Author Share Posted May 25, 2017 2 minutes ago, Abdul KariM said: في غيرها بالسكربت ولا بس هذي الصور ؟ لا بس ذي الصور Link to comment
Abdul KariM Posted May 25, 2017 Share Posted May 25, 2017 تمام , جرب الكود Mar = { {"Pepsi","$7,500",pimg}, {"Coca Cola","$7,000",mimg}, {"Miranda","$8,000",simg}, {"Smoke","$10,000",cimg}, } for i,k in ipairs (Mar) do l = guiGridListAddRow (mlist) guiGridListSetItemText (mlist,l,1,tostring(k[1]),false,false) guiGridListSetItemText (mlist,l,2,tostring(k[2]),false,false) guiGridListSetItemData ( mlist , l , 1 , k [ 3 ] ) guiGridListSetItemColor(mlist,l,1,0,150,255) guiGridListSetItemColor(mlist,l,2,0,150,255) guiSetFont(mlist, "default-bold-small") guiSetVisible( k [ 3 ] , false) end function guiSetImgVisible ( xImg ) guiSetVisible ( xImg , true ) for _ ,v in ipairs ( getElementsByType ( "gui-staticimage" , resourceRoot ) ) do if ( v ~= xImg and guiGetVisible ( v ) == true ) then return guiSetVisible ( v , false ) end end return false end addEventHandler("onClientGUIClick",root, function ( ) if ( source == mlist ) then local aSelect = guiGridListGetSelectedItem ( source ) if ( aSelect == -1 ) then return end local aImg = guiGridListGetItemData ( source , aSelect , 1 ) guiSetImgVisible ( aImg ) end end ) ورد خبر Link to comment
Doffy Posted May 25, 2017 Author Share Posted May 25, 2017 11 minutes ago, Abdul KariM said: تمام , جرب الكود Mar = { {"Pepsi","$7,500",pimg}, {"Coca Cola","$7,000",mimg}, {"Miranda","$8,000",simg}, {"Smoke","$10,000",cimg}, } for i,k in ipairs (Mar) do l = guiGridListAddRow (mlist) guiGridListSetItemText (mlist,l,1,tostring(k[1]),false,false) guiGridListSetItemText (mlist,l,2,tostring(k[2]),false,false) guiGridListSetItemData ( mlist , l , 1 , k [ 3 ] ) guiGridListSetItemColor(mlist,l,1,0,150,255) guiGridListSetItemColor(mlist,l,2,0,150,255) guiSetFont(mlist, "default-bold-small") guiSetVisible( k [ 3 ] , false) end function guiSetImgVisible ( xImg ) guiSetVisible ( xImg , true ) for _ ,v in ipairs ( getElementsByType ( "gui-staticimage" , resourceRoot ) ) do if ( v ~= xImg and guiGetVisible ( v ) == true ) then return guiSetVisible ( v , false ) end end return false end addEventHandler("onClientGUIClick",root, function ( ) if ( source == mlist ) then local aSelect = guiGridListGetSelectedItem ( source ) if ( aSelect == -1 ) then return end local aImg = guiGridListGetItemData ( source , aSelect , 1 ) guiSetImgVisible ( aImg ) end end ) ورد خبر موب شغال الدي بق WARNING: Market\c.lua:22: Bad argument @ 'guiSetVisible' [Expected gui-element at argument 1, got nill ] [DUP x3] Link to comment
Doffy Posted May 25, 2017 Author Share Posted May 25, 2017 2 minutes ago, Abdul KariM said: اطرح الكلينت كامل طيب تعال خاص 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