You need to modify esx_weaponshop and esx_policejob files.
Follow the instructions below:
Weapon Shop:
esx_weaponshop/client/main.lua > Line 222
Replace
OpenBuyLicenseMenu(CurrentActionData.zone)
With
ESX.ShowNotification("You do not have weapon license!")
Police Job
esx_policejob/client/main.lua > 260 - Add
{label = 'Weapon License (take/give)', value = 'weapon_license'}
esx_policejob/client/main.lua > 303 - Add
elseif action == 'weapon_license' then
TriggerServerEvent('esx_policejob:weaponLicense', GetPlayerServerId(closestPlayer))
end
esx_policejob/server/main.lua > Add anywhere
RegisterNetEvent('esx_policejob:weaponLicense')
AddEventHandler('esx_policejob:weaponLicense', function(target)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local xTarget = ESX.GetPlayerFromId(target)
if xPlayer.getJob().name == 'police' then
TriggerEvent('esx_license:checkLicense', target, 'weapon', function(hasWeaponLicense)
if hasWeaponLicense then
TriggerEvent('esx_license:removeLicense', target, 'weapon')
TriggerClientEvent('esx:showNotification', _source, _U('license_take', xTarget.getName()))
else
TriggerEvent('esx_license:addLicense', target, 'weapon')
TriggerClientEvent('esx:showNotification', _source, _U('license_give', xTarget.getName()))
end
end)
end
end)
8 Likes
system
Closed
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.