kewizzle Posted March 30, 2017 Share Posted March 30, 2017 heres my source, idk how to add the skin ids next to it. shinshop = createMarker(-673, 916.4, 11,"cylinder",2.0,0,255,0,255) local Skins = { { "CJ", 0 }, { "Hippie", 1 }, { "Division Sheild", 17 }, { "Division fumigator", 18 }, { "Division incinerator", 19 }, { "Rich Woman", 55 }, { "Tall Balla", 104 }, } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() skinwindow = guiCreateWindow((screenW - 527) / 2, (screenH - 608) / 2, 527, 608, "Kewizzle's Skin Shop", false) guiWindowSetSizable(skinwindow, false) guiSetProperty(skinwindow, "CaptionColour", "FFDDEA14") guiSetVisible( skinwindow, not guiGetVisible( skinwindow ) ) skinselect = guiCreateGridList(99, 29, 324, 490, false, skinwindow) guiGridListAddColumn(skinselect, "Skin Name", 0.5) guiGridListAddColumn(skinselect, "Skin ID", 0.5) purchase = guiCreateButton(99, 529, 155, 61, "Buy Skin $500", false, skinwindow) guiSetFont(purchase, "default-bold-small") guiSetProperty(purchase, "NormalTextColour", "FF00F940") cancelbuy = guiCreateButton(269, 529, 154, 61, "Cancel", false, skinwindow) guiSetFont(cancelbuy, "default-bold-small") guiSetProperty(cancelbuy, "NormalTextColour", "FFF90000") addEventHandler("onClientGUIClick", cancelbuy, CloseWindow) addEventHandler("onClientGUIClick", purchase, function() local Select = tonumber( guiGridListGetItemData( skinselect, guiGridListGetSelectedItem( skinselect ), 1 ) ) if ( Select and Select ~= '' ) then triggerServerEvent( "setClientSkin", localPlayer, tonumber( guiGridListGetItemData( skinselect, guiGridListGetSelectedItem( skinselect ), 1 ) ) ) CloseWindow() end end) for _,v in ipairs( Skins ) do local Row = guiGridListAddRow( skinselect ) guiGridListSetItemText( skinselect, Row, 1, v[1], false, false ) guiGridListSetItemData( skinselect, Row, 1, v[2] ) end end ) Link to comment
NeXuS™ Posted March 30, 2017 Share Posted March 30, 2017 Do you mean you want that the text shows the ID too? 1 Link to comment
Master_MTA Posted March 30, 2017 Share Posted March 30, 2017 (edited) try it shinshop = createMarker(-673, 916.4, 11,"cylinder",2.0,0,255,0,255) local Skins = { { "CJ", 0 }, { "Hippie", 1 }, { "Division Sheild", 17 }, { "Division fumigator", 18 }, { "Division incinerator", 19 }, { "Rich Woman", 55 }, { "Tall Balla", 104 }, } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() skinwindow = guiCreateWindow((screenW - 527) / 2, (screenH - 608) / 2, 527, 608, "Kewizzle's Skin Shop", false) guiWindowSetSizable(skinwindow, false) guiSetProperty(skinwindow, "CaptionColour", "FFDDEA14") guiSetVisible( skinwindow, not guiGetVisible( skinwindow ) ) skinselect = guiCreateGridList(99, 29, 324, 490, false, skinwindow) guiGridListAddColumn(skinselect, "Skin Name", 0.5) guiGridListAddColumn(skinselect, "Skin ID", 0.5) purchase = guiCreateButton(99, 529, 155, 61, "Buy Skin $500", false, skinwindow) guiSetFont(purchase, "default-bold-small") guiSetProperty(purchase, "NormalTextColour", "FF00F940") cancelbuy = guiCreateButton(269, 529, 154, 61, "Cancel", false, skinwindow) guiSetFont(cancelbuy, "default-bold-small") guiSetProperty(cancelbuy, "NormalTextColour", "FFF90000") addEventHandler("onClientGUIClick", cancelbuy, CloseWindow) addEventHandler("onClientGUIClick", purchase, function() local Select = tonumber( guiGridListGetItemData( skinselect, guiGridListGetSelectedItem( skinselect ), 1 ) ) if ( Select and Select ~= '' ) then triggerServerEvent( "setClientSkin", localPlayer, tonumber( guiGridListGetItemData( skinselect, guiGridListGetSelectedItem( skinselect ), 1 ) ) ) CloseWindow() end end) for _,v in ipairs( Skins ) do local Row = guiGridListAddRow( skinselect ) guiGridListSetItemText( skinselect, Row, 1, v[1], false, false ) guiGridListSetItemText( skinselect, Row, 2, v[2], false, false ) guiGridListSetItemData( skinselect, Row, 1, v[2] ) end end ) you must create 2 columns in grid list Edited March 30, 2017 by Master_MTA 1 Link to comment
kewizzle Posted March 30, 2017 Author Share Posted March 30, 2017 thanks guys im learning so much lol. Link to comment
Master_MTA Posted March 30, 2017 Share Posted March 30, 2017 1 minute ago, kewizzle said: thanks guys im learning so much lol. any time my brother study hard Link to comment
kewizzle Posted March 30, 2017 Author Share Posted March 30, 2017 1 hour ago, Master_MTA said: any time my brother study hard i see what you did guiGridListSetItemData( skinselect, Row, 1, v[2] ) would mean to get the Item data in the table skins and place it in the second column in each row according to the skin in the table. 1 Link to comment
Master_MTA Posted March 30, 2017 Share Posted March 30, 2017 1 minute ago, kewizzle said: i see what you did guiGridListSetItemData( skinselect, Row, 1, v[2] ) would mean to get the Item data in the table skins and place it in the second column in each row according to the skin in the table. no you mean guiGridListSetItemText if you wanna use guiGridListSetItemData you should know something about guiGridListGetItemData the function guiGridListSetItemData used for set data on the item wich you just created it with guiGridListAddRow in the loop so the difference between guiGridListSetItemData and guiGridListSetItemText is the visible the function guiGridListSetItemText is visible you can see it but the function guiGridListSetItemData is invisible it's look like setElementData i hope u understood me +_+ 1 Link to comment
kewizzle Posted March 30, 2017 Author Share Posted March 30, 2017 1 hour ago, Master_MTA said: no you mean guiGridListSetItemText if you wanna use guiGridListSetItemData you should know something about guiGridListGetItemData the function guiGridListSetItemData used for set data on the item wich you just created it with guiGridListAddRow in the loop so the difference between guiGridListSetItemData and guiGridListSetItemText is the visible the function guiGridListSetItemText is visible you can see it but the function guiGridListSetItemData is invisible it's look like setElementData i hope u understood me +_+ thanks for that lovely info 1 Link to comment
Master_MTA Posted March 30, 2017 Share Posted March 30, 2017 Just now, kewizzle said: thanks for that lovely info any time +_+ 1 Link to comment
Abu-Solo Posted March 30, 2017 Share Posted March 30, 2017 4 hours ago, Master_MTA said: any time +_+ God bless Google translate ;> Link to comment
itHyperoX Posted March 30, 2017 Share Posted March 30, 2017 16 minutes ago, Abu-Solo said: God bless Google translate ;> you wanna hear allah bless 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