Jump to content

car save


Wei

Recommended Posts

  
local vehs = getElementsByType("vehicle") 
for i,v in ipairs (vehs) do 
     local carId = getVehicleNameFromModel(v) 
     local row = guiGridListAddRow(yourList) -- change yourList to your list's name.. 
     guiGridListSetItemText (yourList, row, 1, carID, false, true) 
     guiGridListSetItemText (yourList, row, 2, v, false, true) 
end 

Link to comment
function carSpawn () 
    local Acc = getPlayerAccount( source ) 
    local x,y,z = getElementPosition (source) 
    local theFar = getAccountData( Acc, "theCar" ) 
    veh = createVehicle(tonumber (theFar), x,y,z) 
    warpPedIntoVehicle( source, veh ) 
end 
addCommandHandler( "spawnMyCar", carSpawn) 

whats the problem ?

Link to comment
function carSpawn () 
    local acc = getPlayerAccount(source) 
    local x,y,z = getElementPosition(source) 
    local theCar = getAccountData(Acc,"theCar") 
    veh = createVehicle(tostring(theCar),x,y,z) 
    warpPedIntoVehicle(source,veh) 
end 
addCommandHandler( "spawnMyCar", carSpawn) 

Link to comment
function carSpawn (source) --  
    local Acc = getPlayerAccount( source ) 
    local x,y,z = getElementPosition (source) 
    local theFar = getAccountData( Acc, "theCar" ) 
    veh = createVehicle(tonumber (theFar), x,y,z) 
    warpPedIntoVehicle( source, veh ) 
end 
addCommandHandler( "spawnMyCar", carSpawn) 

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