; Mr.T76eM # Posted August 8, 2015 Share Posted August 8, 2015 السلام عليكمُ ورحمة الله وبركـآته ~ بسم الله الرحمن الرحيم ~ اليوم كنت بسوي سكربت عادي ~ لكن واجهتني مشكلة الفكرة هي ان يوم يضغط على سطر من القريد لست تتغير السكن الي موجودة الكود : skin = { {"skin1",20,10000}, {"skin2",150,22}, {"skin3",46,333}, } for i,skins in ipairs(skin) do local row = guiGridListAddRow(GridList) guiGridListSetItemText(GridList,row,1,skins[1],false,false) guiGridListSetItemText(GridList,row,2,skins[3],false,false) guiGridListSetItemText( GridList, row, 3, skins[2],false,false ) end ------------------------------------------- local ped = createPed(264,337.81802,-7989.18262,16.00000,180) addEventHandler('onClientGUIClick', root, function () if source == x then guiSetVisible(Buywnd ,false) showCursor(false) elseif source == GridList then local sel = guiGridListGetSelectedItem(GridList) local id = tonumber(guiGridListGetItemText(GridList,sel,3)) if sel ~= -1 then setElementModel(ped,id) end end end ); المطلوب هو ان يوم يضغط على القريد لست تتغير الشخصية حسب التكست اتمنى الافادة والسلام عليكم ْ Link to comment
i S6O Posted August 8, 2015 Share Posted August 8, 2015 skin = { {"skin1",20,10000}, {"skin2",150,22}, {"skin3",46,333}, } for i,skins in ipairs(skin) do local row = guiGridListAddRow(GridList) guiGridListSetItemText(GridList,row,1,skins[1],false,false) guiGridListSetItemText(GridList,row,2,skins[3],false,false) guiGridListSetItemText( GridList, row, 3, skins[2],false,false ) guiGridListSetItemData( GridList, row, 3, skins[2] ) end ------------------------------------------- local ped = createPed(264,337.81802,-7989.18262,16.00000,180) addEventHandler('onClientGUIClick', root, function () if source == x then guiSetVisible(Buywnd ,false) showCursor(false) elseif source == GridList then local sel = guiGridListGetSelectedItem(GridList) local id = unpack(guiGridListGetItemData(GridList,sel,3)) if sel ~= -1 then setElementModel(ped,id) end end end ); Link to comment
; Mr.T76eM # Posted August 8, 2015 Author Share Posted August 8, 2015 skin = { {"skin1",20,10000}, {"skin2",150,22}, {"skin3",46,333}, } for i,skins in ipairs(skin) do local row = guiGridListAddRow(GridList) guiGridListSetItemText(GridList,row,1,skins[1],false,false) guiGridListSetItemText(GridList,row,2,skins[3],false,false) guiGridListSetItemText( GridList, row, 3, skins[2],false,false ) guiGridListSetItemData( GridList, row, 3, skins[2] ) end ------------------------------------------- local ped = createPed(264,337.81802,-7989.18262,16.00000,180) addEventHandler('onClientGUIClick', root, function () if source == x then guiSetVisible(Buywnd ,false) showCursor(false) elseif source == GridList then local sel = guiGridListGetSelectedItem(GridList) local id = unpack(guiGridListGetItemData(GridList,sel,3)) if sel ~= -1 then setElementModel(ped,id) end end end ); نفس الشيء + كنت مستخدم الداتا ما نفعت قلت اجرب التيكست برضو مـ نفعت مدري وش المشكلة Link to comment
Naif Posted August 8, 2015 Share Posted August 8, 2015 skin = { {"skin1",20,10000}, {"skin2",150,22}, {"skin3",46,333}, } for i,skins in ipairs(skin) do local row = guiGridListAddRow(GridList) guiGridListSetItemText(GridList,row,1,skins[1],false,false) guiGridListSetItemText(GridList,row,2,skins[3],false,false) guiGridListSetItemText( GridList, row, 3, skins[2],false,false ) end ------------------------------------------- addEventHandler('onClientGUIClick', root, function () if source == x then guiSetVisible(Buywnd ,false) destroyElement(ped) showCursor(false) elseif source == GridList then ped = createPed(264,337.81802,-7989.18262,16.00000,180) local sel = guiGridListGetSelectedItem(GridList) if sel ~= -1 then local id = guiGridListGetItemText(GridList,sel,3) setElementModel(ped,id) else destroyElement(ped) end end end ); ماني متأكد بس جرب .. Link to comment
iMr.SFA7 Posted August 8, 2015 Share Posted August 8, 2015 nameColumn = Your Column Name skin = { {"skin1",20,10000}, {"skin2",150,22}, {"skin3",46,333}, } for i,skins in ipairs(skin) do local row = guiGridListAddRow(GridList) guiGridListSetItemText(GridList,row,1,skins[1],false,false) guiGridListSetItemText(GridList,row,2,skins[3],false,false) guiGridListSetItemText( GridList, row, 3, skins[2],false,false ) guiGridListSetItemData( GridList, row, 3, skins[2] ) end ------------------------------------------- local ped = createPed(264,337.81802,-7989.18262,16.00000,180) addEventHandler('onClientGUIClick', root, function () if source == x then guiSetVisible(Buywnd ,false) showCursor(false) elseif source == GridList then if guiGridListGetSelectedItem ( GridList ) ~= -1 then setElementModel ( ped,guiGridListGetItemData ( GridList,guiGridListGetSelectedItem ( GridList ), nameColumn ) ) end end end ); Link to comment
iMr.SFA7 Posted August 8, 2015 Share Posted August 8, 2015 ^ رأجع الجدول لبى قلبك . راجعته مالقيت شيء تقصد ذا السطر ؟ guiGridListSetItemText( GridList, row, 3, skins[2],false,false ) Link to comment
i S6O Posted August 8, 2015 Share Posted August 8, 2015 توي مسويه ماجربته Skin = { { 'Skin[1]', 100, 46 }, -- { 'Skin', Money, ID } } for i, Skins in ipairs ( Skin ) do local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, Skins[1], false, false ) guiGridListSetItemText ( GridList, Row, 2, tonumber( Skins[2] ), false, false ) guiGridListSetItemText ( GridList, Row, 3, tonumber( Skins[3] ), false, false ) guiGridListSetItemData ( GridList, Row, 3, Skins[3] ) end addEventHandler ( 'onClientGUIClick', root, function ( ) if source == x then guiSetVisible ( Buywnd, false ) showCursor ( false ) elseif source == GridList then local Selected = guiGridListGetSelectedItem ( GridList ) local id = unpack ( guiGridListGetItemData( GridList, Selected, 3 ) ) if Selected ~= -1 then local ped = createPed ( 264,337.81802,-7989.18262,16.00000,180 ) setElementModel ( ped, id ) else outputChatBox ( 'Please Selected #FF000000Item.', 255, 255, 255, true ) destroyElement ( ped ) end end end ) Link to comment
; Mr.T76eM # Posted August 8, 2015 Author Share Posted August 8, 2015 ول ول ~ يعطيكم العافية كل الاكواد نفس كودي في النهاية والشخصية ما تتغير Link to comment
iMr.SFA7 Posted August 8, 2015 Share Posted August 8, 2015 skin = { {"skin1",20,10000}, {"skin2",150,22}, {"skin3",46,333}, } for _,v in ipairs ( skin ) do row = guiGridListAddRow ( GridList ) guiGridListSetItemText(GridList,row,1,v[1],false,false) guiGridListSetItemText(GridList,row,2,v[3],false,false) guiGridListSetItemData( GridList, row, 3, v[2] ) end local ped = createPed(264,337.81802,-7989.18262,16.00000,180) addEventHandler('onClientGUIClick',root, function ( ) local id = guiGridListGetItemData( GridList, guiGridListGetSelectedItem( GridList ), 3 ) if ( source == x ) then guiSetVisible(Buywnd ,false) showCursor(false) elseif ( source == GridList ) then if guiGridListGetSelectedItem ( GridList ) ~= -1 then setElementModel ( ped, id) 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