mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 17:28:53 +00:00
Fixed vehicle network id issues by removing mission entity re
gistration adding proper manifest version and setting up vehicle migration from config
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
|
||||
resource_manifest_version '05cfa83c-a124-4cfa-a768-c24a5811d8f9'
|
||||
|
||||
description 'ES Extended'
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user