ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
RegisterServerEvent('viber-suleymanpro:viberfree')
AddEventHandler('viber-suleymanpro:viberfree',function()
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
xPlayer.addInventoryItem('viberfree', 1)
TriggerClientEvent('inventory:client:ItemBox', _source, ESX.GetItems()['viberfree'],'add',1)
end)
RegisterNetEvent("viber-suleymanpro:duzenle")
AddEventHandler("viber-suleymanpro:duzenle", function(item, count)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
if xPlayer ~= nil then
if xPlayer.getQuantity('viberfree') >= 1 then
xPlayer.removeInventoryItem('viberfree', 1)
xPlayer.removeInventoryItem('vsc', 1)
xPlayer.addInventoryItem('tlhm3infinityv1', 1)
TriggerClientEvent('inventory:client:ItemBox', _source, ESX.GetItems()['vsc'],'remove',1)
TriggerClientEvent('inventory:client:ItemBox', _source, ESX.GetItems()['viberfree'],'remove',1)
TriggerClientEvent('inventory:client:ItemBox', _source, ESX.GetItems()['tlhm3infinityv1'],'add',1)
elseif xPlayer.getQuantity('viberfree') <= 1 then
TriggerClientEvent('mythic_notify:client:SendAlert', xPlayer.source, { type = 'error', text = 'Bunu yapmak için üstünde '})
end
end
end)
ESX.RegisterUsableItem('vsc', function(source)
TriggerClientEvent('viber-suleymanpro:vsc', source)
end)