yayo Posted October 2, 2012 Share Posted October 2, 2012 Ok, so I have my menu, gridlist, and "OK" button all setup for my clothes store, but I cannot seem to figure out how to make it so that when you select your clothes by clicking each item on the gridlist, and then hit the OK button, it will give you what is selected on the gridlist. If you understand my problem please help me out. Heres my code if it helps... CLIENT shirts = { "blackwifebeater" "whitewifebeater" "whiteundershirt" "redplaid" "greent" "oranget" "basketball" } pants = { "greencamo" "greycamo" "greyreg" "greenreg" "whitereg" "bluejump" "redjump" } shoes = { "whitegrey" "lightgrey" "green" "blue" "black" "chucks" "red" } function setupClothesSelection() clothesmenu = guiCreateWindow(0.15,0.33,0.7,0.34,"Select your Clothes", true) clothesmenubutton = guiCreateButton(0.4,0.85,0.20,0.15, "OK",true,clothesmenu) guiWindowSetMovable(clothesmenu,false) guiWindowSetSizable(clothesmenu,false) clothesmenugrid = guiCreateGridList(0,0.1,1,0.9, true, clothesmenu) guiGridListSetSelectionMode(clothesmenugrid, 2) for key,clothesname in pairs(shirts) do local row = guiGridListAddRow(clothesmenugrid) guiGridListSetItemText(clothesmenugrid, row, 1, clothesname, false, false) end for key,clothesname in pairs(pants) do guiGridListSetItemText(clothesmenugrid, row, 2, clothesname, false, false) row = row + 1 end for key,clothesname in pairs(shoes) do guiGridListSetItemText(clothesmenugrid, row, 2, clothesname, false, false) row = row + 1 end end addEventHandler("onMarkerHit",theMarker,setupClothesSelection) SERVER clothesout = createMarker(917.0478515625, 2234.98046875, 10.848437309265, "arrow", 2.0, 255, 0, 0, 150 ) clothesin = createMarker( 919.26721191406, 2233.1640625, 5.1059565544128, "arrow", 2.0, 255, 0, 0, 150 ) theMarker = createMarker( 927.30041503906, 2232.8837890625, 5.0999999046326, "arrow", 1.5, 255, 255, 0, 255 ) setElementAlpha( theMarker, 0 ) ammunationdude = createPed ( 11, 928.93029785156, 2233.6328125, 5.0999999046326, 270 ) function clothesstoreaout( player ) if isPedInVehicle( player ) == false then setElementPosition( player, 923.44982910156, 2233.1005859375, 4.9749999046326 ) end end function clothesstoreain( source ) setElementPosition(source, 914.4033203125, 2235.2119140625, 10.8203125 ) end addEventHandler( "onMarkerHit", clothesout, clothesstoreaout ) addEventHandler( "onMarkerHit", clothesin, clothesstoreain ) Link to comment
yayo Posted October 3, 2012 Author Share Posted October 3, 2012 Sorry for the noob question, should have looked more I found it. guiGridListGetSelectedItems 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