Jump to content

Car Shop for my server


Recommended Posts

Hello guys, maybe you know I'm doing a car driving system.

I'm set the this script to my server. [https://community.multitheftauto.com/index.php?p=resources&s=details&id=9683]

But I need when I hit the marker on the dealerShip, car list is custom.

example : banshee > BMW F10

If you can do this or help me for my server you can send message the this topic.

Please guys I have 3 days for open this server <3

Thank you :)

Link to comment
local cars = { {579,60000},{400,60000}}
for i,v in ipairs(cars) do
    local carName = getVehicleNameFromModel(v[1])
    local row = guiGridListAddRow(carglVehicleSelection)
    guiGridListSetItemText(carglVehicleSelection,row,1,carName,false,true)
    guiGridListSetItemText(carglVehicleSelection,row,2,tostring(v[2]),false,true)
    end

My server using that and I dont know how to use :(

 

function buyCar1(button,state)
    if (source == buycar1) then 
        
            guiSetVisible(carWindow,false)
            showCursor(false)
            local carName = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),1)
            local carID = getVehicleModelFromName(carName)
            local carCost = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),2)
            triggerServerEvent("buycar1",getLocalPlayer(),carID,carCost,CarName)
   
    elseif (source == buycar2) then

            guiSetVisible(carWindow,false)
            showCursor(false)
            local carName = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),1)
            local carID = getVehicleModelFromName(carName)
            local carCost = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),2)
            triggerServerEvent("buycar2",getLocalPlayer(),carID,carCost,CarName)

        
    elseif (source == buycar3) then

            guiSetVisible(carWindow,false)
            showCursor(false)
            local carName = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),1)
            local carID = getVehicleModelFromName(carName)
            local carCost = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),2)
            triggerServerEvent("buycar3",getLocalPlayer(),carID,carCost,CarName)

        
            elseif (source == buycar4) then

            guiSetVisible(carWindow,false)
            showCursor(false)
            local carName = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),1)
            local carID = getVehicleModelFromName(carName)
            local carCost = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),2)
            triggerServerEvent("buycar4",getLocalPlayer(),carID,carCost,CarName)

        
            elseif (source == buycar5) then
            guiSetVisible(carWindow,false)
            showCursor(false)
            local carName = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),1)
            local carID = getVehicleModelFromName(carName)
            local carCost = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),2)
            triggerServerEvent("buycar5",getLocalPlayer(),carID,carCost,CarName)

        
        
    elseif (source == closecarButton) then
        guiSetVisible(carWindow, false)
        showCursor(false)
    end
end
addEventHandler("onClientGUIClick",getRootElement(),buyCar1)

    

 

Link to comment

Finished;
 

local cars = { 
{429,75000,"• BMW F10"," 5-25"},
{410,15000,"• Honda CRX"," 6-11"},
{451,36000,"• Honda S2000"," 5-9"},
{526,"VIP","• Mustang GT"," 10-35"},
{496,7500,"• Fiat 126"," 2-7"},
{527,42500,"• Toyota Supra"," 10-14"},
{402,32000,"• BMW E30 Stock"," 8-10"},
{426,27000,"• BMW E32 Stock"," 6-10"},
{554,42000,"• Chevrolet Silverado 1500"," 3-9"},
{401,11000,"• VAZ 2108"," 4-10"},
{400,65000,"• Alfa Romeo Giulietta"," 7-15"},
{479,45000,"• BMW E34 Touring"," 8-13"},
}

v1 = CarID

v2 = price

v3 = Name

v4 = giveMoney when speed is bigger then 50

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