mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 01:38:52 +00:00
+2
-1
@@ -170,6 +170,7 @@ AddEventHandler('esx:addWeapon', function(weaponName, ammo)
|
||||
local weaponHash = GetHashKey(weaponName)
|
||||
|
||||
GiveWeaponToPed(playerPed, weaponHash, ammo, false, false)
|
||||
SetPedAmmo(playerPed, weaponHash, ammo) -- remove leftover ammo
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:removeWeapon')
|
||||
@@ -178,6 +179,7 @@ AddEventHandler('esx:removeWeapon', function(weaponName)
|
||||
local weaponHash = GetHashKey(weaponName)
|
||||
|
||||
RemoveWeaponFromPed(playerPed, weaponHash)
|
||||
SetPedAmmo(playerPed, weaponHash, 0) -- remove leftover ammo
|
||||
end)
|
||||
|
||||
-- Commands
|
||||
@@ -337,7 +339,6 @@ AddEventHandler('esx:pickupWeapon', function(weaponPickup, weaponName,ammo)
|
||||
|
||||
local ped = GetPlayerPed(-1)
|
||||
local playerPedPos = GetEntityCoords(ped, true)
|
||||
print(ammo)
|
||||
CreateAmbientPickup(GetHashKey(weaponPickup), playerPedPos.x + 2.0, playerPedPos.y, playerPedPos.z + 0.5, 0, ammo, 1, false, true)
|
||||
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user