[Help] [ESX] How to make a job only command!

RegisterCommand(“craft”, function(source, args, rawCommand)

That is my RegisterCommand line! And the problem is how can I make it a command for only the mechanic job?

Hey :slight_smile:

RegisterCommand(“craft”, function(source, args, rawCommand)

local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.getJob().name == 'mechanic' then 
    --HERE YOU CAN DO WHAT YOU WANT 
end 

end, false)

Thank you! <3 Wish you best!