How to make a resource only for specific job (ESX)?

Hey everyone! I want set “rp-radio” to be available just for EMS and LSPD (as it is in real life). How can i do that?
Link: RP Radio

just check what the job is on client.

You don’t understand… What i have to change / add to what scripts to be available for certain jobs…

pretty sure it replaces the original voice of fivem, So you probably can’t do that.

I think you have to “ask” the server which job the “xPlayer” has. First you define the player with

local xPlayer = ESX.GetPlayerFromId(source)

Next you gonna callback to your server with the question which job “xPlayer” has.

if xPlayer and xPlayer.job.name == 'ambulance' then
    T h i s   i s    t h e    c o d e      w h i c h     y o u     w a n t    t o    d o     f o r     t h i s     j o b.
end)

Take care that you use an event or a function :slight_smile:

I wish a nice day!

1 Like

Thank you sooooo much <3

Can you snd me the full code to add? Mine didn´t work idk why.
Thanks