Jump to content

How to...


Recommended Posts

i want to know How to attach a veh in a row in the gridlist??

function createGui () 
                gui = guiCreateWindow( 300, 100, 265, 500, "Bike Rent Shop", false) 
                guiSetInputEnabled ( false ) 
                guiSetVisible(gui, false) 
                guiWindowSetMovable( gui, false ) 
                guiWindowSetSizable( gui, false ) 
                List = guiCreateGridList ( 0.04, 0.05, 0.95, 0.75, false, gui ) 
                column = guiGridListAddColumn( List, "Bikes", 0.85 ) 
      
                    btn1 = guiCreateButton( 149, 430, 99, 45, "Leave", false, gui ) 
                    guiSetFont( btn1, "default-bold-small" )       
            List = guiCreateGridList ( 0.04, 0.05, 0.95, 0.75, true, gui ) 
            column = guiGridListAddColumn( List, "Bikes", 0.85 ) 
            btn2 = guiCreateButton(18,430,99,45,"Rent 50$",false, gui) 
            guiSetProperty( btn1, "HoverTextColour", "FFFF0000" ) 
            guiSetProperty( btn2, "HoverTextColour", "FFFFFF00" ) 
            row = guiGridListAddRow (List) 
        guiGridListSetItemText ( List, row, column, "Mountain Bike", false, false ) 
       myItemData = guiGridListGetItemData (List, row, column ) 
          row2 = guiGridListAddRow (List) 
          guiGridListSetItemText (List, row2, column, "BMX", false, false ) 
           row3 = guiGridListAddRow (List) 
           guiGridListSetItemText (List, row3, column, "Bike", false, false ) 
        
            
        addEventHandler("onClientGUIClick", btn1, close, false) 
        addEventHandler("onClientGUIClick", btn2, rent, false) 
    end 

Link to comment

You must get the selected gridlist item using guiGridListGetSelectedItem, then you must get the item text using guiGridListGetItemText, and then you have to trigger a server side event using triggerServerEvent sending the vehicle name to the server side function ( which you have to make and add the event ), then on the server side you must get the vehicle model from it's name using getVehicleModelFromName and to finish, you get player's position and create the vehicle using createVehicle.

Link to comment
You must get the selected gridlist item using guiGridListGetSelectedItem, then you must get the item text using guiGridListGetItemText, and then you have to trigger a server side event using triggerServerEvent sending the vehicle name to the server side function ( which you have to make and add the event ), then on the server side you must get the vehicle model from it's name using getVehicleModelFromName and to finish, you get player's position and create the vehicle using createVehicle.

HAHAHAHAAH, Anyway ty

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...