Hey
I was wondering how esx_policejob could give weapons licenses to players.
(sorry if it’s posed in the wrong category)
Have a look to see how the weaponshop script does it.
2 Likes
I have done that earlier but it doesn’t have one of those fetchers i am looking for.
1 Like
Sorry but you will need a seperate script for that!
1 Like
Do you know of a script that will to that?
Not sure, but I have seen a couple of scripts. Maybe you can modify it to you liking
3 Likes
Hmmm Maby, but i am not the greatest dev.
Sorry man, maybe look online for tutorials!
2 Likes
Ok thanks
1 Like
Hello it’s possible, in the menu of police check my code
In my code, a licence give if you are grade 3-4-5
In the client
~L°604
if data.current.value == 'citizen_interaction' then
local elements = {
{label = _U('id_card'), value = 'identity_card'},
{label = _U('search'), value = 'body_search'},
{label = _U('handcuff'), value = 'handcuff'},
{label = _U('drag'), value = 'drag'},
{label = _U('put_in_vehicle'), value = 'put_in_vehicle'},
{label = _U('out_the_vehicle'), value = 'out_the_vehicle'},
{label = _U('fine'), value = 'fine'},
{label = _U('unpaid_bills'), value = 'unpaid_bills'},
{label = 'Prendre ADN', value = 'adn'}
}
if Config.EnableLicenses then
table.insert(elements, { label = _U('license_check'), value = 'license' })
end
--Prison
if PlayerData.job.grade_name == 'boss' then
table.insert(elements, { label = 'Prison', value = 'jail' })
end
if PlayerData.job.grade_name == 'capitaine' then
table.insert(elements, { label = 'Prison', value = 'jail' })
end
if PlayerData.job.grade_name == 'lieutenant' then
table.insert(elements, { label = 'Prison', value = 'jail' })
end
--PPA
if PlayerData.job.grade_name == 'boss' then
table.insert(elements, { label = 'Donner PPA', value = 'ppa' })
end
if PlayerData.job.grade_name == 'capitaine' then
table.insert(elements, { label = 'Donner PPA', value = 'ppa' })
end
if PlayerData.job.grade_name == 'lieutenant' then
table.insert(elements, { label = 'Donner PPA', value = 'ppa' })
end
Sorry i am french ^^
And ~L°648
ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'citizen_interaction',
{
title = _U('citizen_interaction'),
align = 'top-left',
elements = elements
}, function(data2, menu2)
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer ~= -1 and closestDistance <= 3.0 then
local action = data2.current.value
if action == 'identity_card' then
OpenIdentityCardMenu(closestPlayer)
elseif action == 'body_search' then
TriggerServerEvent('esx_policejob:message', GetPlayerServerId(closestPlayer), _U('being_searched'))
OpenBodySearchMenu(closestPlayer)
elseif action == 'handcuff' then
TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(closestPlayer))
elseif action == 'drag' then
TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(closestPlayer))
elseif action == 'put_in_vehicle' then
TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(closestPlayer))
elseif action == 'out_the_vehicle' then
TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(closestPlayer))
elseif action == 'fine' then
OpenFineMenu(closestPlayer)
elseif action == 'license' then
ShowPlayerLicense(closestPlayer)
elseif action == 'unpaid_bills' then
OpenUnpaidBillsMenu(closestPlayer)
elseif action == 'jail' then
TriggerEvent("esx-qalle-jail:openJailMenu")
elseif action == 'adn' then
local player, distance = ESX.Game.GetClosestPlayer()
if distance ~= -1 and distance <= 3.0 then
TriggerEvent('jsfour-dna:get', player)
end
elseif action == 'ppa' then
local player, distance = ESX.Game.GetClosestPlayer()
if distance ~= -1 and distance <= 3.0 then
TriggerServerEvent('esx_policejob:messageppa', GetPlayerServerId(closestPlayer), _U('notifppa'))
PpaPlayer(GetPlayerServerId(closestPlayer))
end
end
1 Like
PPa is var for select PPA in your menu F6 (with police job)
1 Like
It did not work
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.