Merge branch 'master' of github.com:Re-Ignited-Development/new-phone-who-dis into feature/twitter

This commit is contained in:
erik-sn committed 2020-10-03 16:19:48 -04:00
commit b180c4c655
18 files changed
+223 -77

No files matched your search

+19
View File
@@ -47,4 +47,23 @@ ESX.RegisterServerCallback('phone:getItemAmount', function(source, cb, item)
else
cb(items.count)
end
end)
----
--Destroy Phone
--
ESX.RegisterServerCallback('phone:removephone', function(source, cb, item)
local xPlayer = ESX.GetPlayerFromId(source)
local items = xPlayer.getInventoryItem(item)
if items == nil then
cb(0)
else
cb(items.count)
if items.count > 0 then
xPlayer.removeInventoryItem('phone', items.count)
xPlayer.addInventoryItem('dphone', items.count)
end
end
end)