From 2ce4629d735dc687850dc90b2d9f7d4f7d549eee Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 8 Mar 2018 00:13:57 -0500 Subject: [PATCH] Fixed vehicle network id issues by removing mission entity re gistration adding proper manifest version and setting up vehicle migration from config --- __resource.lua | 2 +- client/functions.lua | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/__resource.lua b/__resource.lua index 9dd1a91b..d4d72cc4 100644 --- a/__resource.lua +++ b/__resource.lua @@ -1,4 +1,4 @@ -resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' +resource_manifest_version '05cfa83c-a124-4cfa-a768-c24a5811d8f9' description 'ES Extended' diff --git a/client/functions.lua b/client/functions.lua index 3d413cbc..2be4b88a 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -390,7 +390,7 @@ ESX.Game.SpawnVehicle = function(modelName, coords, heading, cb) local id = NetworkGetNetworkIdFromEntity(vehicle) SetNetworkIdCanMigrate(id, true) - SetEntityAsMissionEntity(vehicle, true, false) + --SetEntityAsMissionEntity(vehicle, true, false) SetVehicleHasBeenOwnedByPlayer(vehicle, true) SetModelAsNoLongerNeeded(model) @@ -423,7 +423,7 @@ ESX.Game.SpawnLocalVehicle = function(modelName, coords, heading, cb) local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z, heading, false, false) - SetEntityAsMissionEntity(vehicle, true, false) + --SetEntityAsMissionEntity(vehicle, true, false) SetVehicleHasBeenOwnedByPlayer(vehicle, true) SetModelAsNoLongerNeeded(model) @@ -1182,7 +1182,7 @@ ESX.ShowInventory = function() function(data2, menu2) local quantity = tonumber(data2.value) if quantity <= pedammo and quantity >= 0 and quantity ~= nil then - local ammobefore = GetAmmoInPedWeapon(playerPed, item) + local ammobefore = GetAmmoInPedWeapon(playerPed, item) TriggerServerEvent('esx:giveInventoryItem', GetPlayerServerId(closestPlayer), type, item, quantity) local finalammo = math.floor(ammobefore - quantity) SetPedAmmo(playerPed, item, finalammo) @@ -1255,7 +1255,7 @@ ESX.ShowInventory = function() local quantity = tonumber(data2.value) if quantity <= pedammo and quantity >= 0 and quantity ~= nil then - local ammobefore = GetAmmoInPedWeapon(playerPed, item) + local ammobefore = GetAmmoInPedWeapon(playerPed, item) TriggerServerEvent('esx:removeInventoryItem', type, item, quantity) local finalammo = math.floor(ammobefore - quantity) SetPedAmmo(playerPed, item, finalammo) @@ -1324,7 +1324,7 @@ ESX.ShowInventory = function() function(data2, menu2) local quantity = tonumber(data2.value) if quantity <= pedammo and quantity >= 0 and quantity ~= nil then - local ammobefore2 = GetAmmoInPedWeapon(closestPed, item) + local ammobefore2 = GetAmmoInPedWeapon(closestPed, item) local finalammo = math.floor(pedammo - quantity) local finalammo2 = math.floor(ammobefore2 + quantity) SetPedAmmo(playerPed, item, finalammo)