kewizzle Posted March 30, 2017 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 ) MTA:SA Scripting Is Fun!
NeXuS™ Posted March 30, 2017 Posted March 30, 2017 Do you mean you want that the text shows the ID too? 1 Did I help you? NeXuS™#0001
Master_MTA Posted March 30, 2017 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 Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
kewizzle Posted March 30, 2017 Author Posted March 30, 2017 thanks guys im learning so much lol. MTA:SA Scripting Is Fun!
Master_MTA Posted March 30, 2017 Posted March 30, 2017 1 minute ago, kewizzle said: thanks guys im learning so much lol. any time my brother study hard Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
kewizzle Posted March 30, 2017 Author 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 MTA:SA Scripting Is Fun!
Master_MTA Posted March 30, 2017 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 Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
kewizzle Posted March 30, 2017 Author 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 MTA:SA Scripting Is Fun!
Master_MTA Posted March 30, 2017 Posted March 30, 2017 Just now, kewizzle said: thanks for that lovely info any time +_+ 1 Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Abu-Solo Posted March 30, 2017 Posted March 30, 2017 4 hours ago, Master_MTA said: any time +_+ God bless Google translate ;> خلك احسن من غيرك, لا تقول عندهم اشياء ماهي عندي انت عندك اشياء ماهي عند غيرك #
itHyperoX Posted March 30, 2017 Posted March 30, 2017 16 minutes ago, Abu-Solo said: God bless Google translate ;> you wanna hear allah bless 1
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