Resolved invalid number format

Setting jobs on players causes grade check to return an error rather than the check itself.

`if PlayerData.job.grade >= 3 then` returns `Attempt to compare number with string`
This commit is contained in:
Ben Sherman
2018-05-26 22:51:08 +02:00
committed by GitHub
parent a055373343
commit f5a9a96f38
+2 -2
View File
@@ -20,7 +20,7 @@ TriggerEvent('es:addGroupCommand', 'setjob', 'jobmaster', function(source, args,
if tonumber(args[1]) and args[2] and tonumber(args[3]) then
local xPlayer = ESX.GetPlayerFromId(args[1])
if xPlayer ~= nil then
xPlayer.setJob(args[2], args[3])
xPlayer.setJob(args[2], tonumber(args[3]))
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Player not online.")
end
@@ -177,4 +177,4 @@ TriggerEvent('es:addGroupCommand', 'disconnect', 'admin', function(source, args,
DropPlayer(source, 'You have been disconnected')
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
end, {help = _U('disconnect')})
end, {help = _U('disconnect')})