jobVehicleSpawned

Register a vehicle to the job vehicle keys system.

This function adds a vehicle to the key system, giving an item to the player, and then ensuring that item is deleted on playerDropped.

-- ARGUMENTS
-- player:   number
-- vehicle:  number
-- model:    string (OPTIONAL)

-- RETURNS
-- nil

RegisterCommand("jobVehicleSpawned", function(source, args)
    if not args[1] then return end
    
    local vehicle = tonumber(args[1])

    if not vehicle or vehicle ~= vehicle then return end

    local model = args[2]
    
    exports["ti_vehicleKeys"]:jobVehicleSpawned(source, vehicle, model)
end, true)

Last updated