Hello, I am currently trying to make a command that the players with the job ambulance and police can do /revivea and they can revive players so that users do not abuse the /revivea feature.
I have a script that I put in Ambulance from the snippets but I cant seem to get it to check for the job.
Server File not Client File
TriggerEvent('es:addGroupCommand', 'revive', 'admin', function(source, args, user)
if args[2] ~= nil then
TriggerClientEvent('esx_ambulancejob:revive', tonumber(args[2]))
else
TriggerClientEvent('esx_ambulancejob:revive', source)
end
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
end, {help = _U('revive_help'), params = {{name = 'id'}}})
TriggerEvent('es:addGroupCommand', 'revivea', 'user', function(source, args, user)
if args[2] ~= nil then
if PlayerData.job.name ~= 'police' then
TriggerClientEvent('esx_ambulancejob:revive', tonumber(args[2]))
else
TriggerClientEvent('esx_ambulancejob:revive', source)
end
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
end, {help = _U('revive_help'), params = {{name = 'id'}}})