[Help] tunertablet restrictions

Hi There,

i’m using the tuning chip for car modification. Normally everyone can use this tablet to change vehicle elements. We device it should be possible by the mechanic only. First ad hoc solution was to keep this item at a special shop. But if the mechanic drop the tablet everyone can use it. I devide to include a if condition to the script.

The following lines below shows the normal code:

RegisterNetEvent(“tunertablet:useLaptop”)
AddEventHandler(“tunertablet:useLaptop”, function()
if not menu then
TriggerEvent(‘esx_inventoryhud:doClose’)
Citizen.Wait(3000)
local ped = GetPlayerPed(-1)
toggleMenu(true,true)
while IsPedInAnyVehicle(ped, false) and GetPedInVehicleSeat(GetVehiclePedIsIn(ped, false), -1)==ped do
Citizen.Wait(100)
end
toggleMenu(false,true)
else
return
end
end)

I changed it to:
RegisterNetEvent(“tunertablet:useLaptop”)
AddEventHandler(“tunertablet:useLaptop”, function()
if ESX.PlayerData.job.name == ‘mechanic’ then
if not menu then
TriggerEvent(‘esx_inventoryhud:doClose’)
Citizen.Wait(3000)
local ped = GetPlayerPed(-1)
toggleMenu(true,true)
while IsPedInAnyVehicle(ped, false) and GetPedInVehicleSeat(GetVehiclePedIsIn(ped, false), -1)==ped do
Citizen.Wait(100)
end
toggleMenu(false,true)
else
return
end
else
print(‘Kein Mechanic’)
end
end)

but the ESX.PlayerData.job.name could not be found. Does anyone get a idee how include this solution?

Thanks