From 201b5f9ff2cc8893817f9933edc61553d28a4af7 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 23 Dec 2018 17:46:55 +0100 Subject: [PATCH] Use old native as new one broke drawing 3d text --- client/functions.lua | 2 +- server/main.lua | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index 61333dd2..a4f82218 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -966,7 +966,7 @@ ESX.Game.SetVehicleProperties = function(vehicle, props) end ESX.Game.Utils.DrawText3D = function(coords, text, size) - local onScreen, x, y = GetScreenCoordFromWorldCoord(coords.x, coords.y, coords.z) + local onScreen, x, y = World3dToScreen2d(coords.x, coords.y, coords.z) local camCoords = GetGameplayCamCoords() local dist = GetDistanceBetweenCoords(camCoords, coords.x, coords.y, coords.z, true) local size = size diff --git a/server/main.lua b/server/main.lua index cb7dfa8f..fedefeda 100644 --- a/server/main.lua +++ b/server/main.lua @@ -421,20 +421,17 @@ AddEventHandler('esx:removeInventoryItem', function(type, itemName, itemCount) end end - -- workaround for CreateAmbientPickup() giving 30 rounds of ammo when you drop the weapon with 0 ammo - if itemCount == 0 then - itemCount = 1 - end - if xPlayer.hasWeapon(itemName) then local weaponLabel, weaponPickup = ESX.GetWeaponLabel(itemName), 'PICKUP_' .. string.upper(itemName) xPlayer.removeWeapon(itemName) - TriggerClientEvent('esx:pickupWeapon', _source, weaponPickup, itemName, itemCount) - + if itemCount > 0 then + TriggerClientEvent('esx:pickupWeapon', _source, weaponPickup, itemName, itemCount) TriggerClientEvent('esx:showNotification', _source, _U('threw_weapon_ammo', weaponLabel, itemCount)) else + -- workaround for CreateAmbientPickup() giving 30 rounds of ammo when you drop the weapon with 0 ammo + TriggerClientEvent('esx:pickupWeapon', _source, weaponPickup, itemName, 1) TriggerClientEvent('esx:showNotification', _source, _U('threw_weapon', weaponLabel)) end end