Skip to content

Commit

Permalink
1. Fixed a bug with unloading animals from the Utility Wagon. Added c…
Browse files Browse the repository at this point in the history
…ustom action offset coords.
  • Loading branch information
codermanchris committed Jun 4, 2020
1 parent 14fdfaa commit 065a225
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client/vehiclerental.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function VehicleRental.HandleVehicle(playerPed, playerCoords)
end

-- load/unload animal into cart
local vehicleCoords = GetOffsetFromEntityInWorldCoords(VehicleRental.WagonEntity, 0.0, -2.0, 0.25)
local vehicleCoords = GetOffsetFromEntityInWorldCoords(VehicleRental.WagonEntity, VehicleRental.VehicleData.ActionOffset.x, VehicleRental.VehicleData.ActionOffset.y, VehicleRental.VehicleData.ActionOffset.z)
local distanceToVehicle = Helpers.GetDistance(playerCoords, vehicleCoords)
if (distanceToVehicle < 5.0) then
local holdingPed = Citizen.InvokeNative(0xD806CD2A4F2C2996, playerPed)
Expand Down Expand Up @@ -209,6 +209,7 @@ function VehicleRental.SpawnWagon(vehicleId)
VehicleRental.WagonSupplyCount = 0
VehicleRental.WagonSupplyMaxCount = vehicle.MaxCapacity
VehicleRental.WagonCountText = string.format('0/%d', vehicle.MaxCapacity)
VehicleRental.VehicleData = vehicle

VehicleRental.HasRental = true
end
Expand Down
6 changes: 4 additions & 2 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,16 @@ VehicleRental = {
Name = 'Small Cart',
MaxCapacity = 2,
Hash = GetHashKey('CART01'),
Price = 5
Price = 5,
ActionOffset = vector3(0.0, -2.0, 0.25)
},
[2] = {
Id = 2,
Name = 'Utility Wagon',
MaxCapacity = 10,
Hash = GetHashKey('UTILLIWAG'),
Price = 15
Price = 15,
ActionOffset = vector3(0.0, -2.65, 0.25)
}
}
}
Expand Down

0 comments on commit 065a225

Please sign in to comment.