Jump to content

Help me with meh Gridlist :P


yayo

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...