Skip to content

Commit

Permalink
Fix Fail-Safe for reason command
Browse files Browse the repository at this point in the history
  • Loading branch information
RedAlex committed Nov 9, 2018
1 parent 48839f5 commit fd0a90b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,22 +189,24 @@ TriggerEvent('es:addGroupCommand', 'reason', "admin", function (source, args, us
['@name'] = name
}, function(identifier)

if identifier ~= nil then
if identifier == nil then
TriggerEvent('bansql:sendMessage', source, Text.invalidid)
else
local steamID = identifier

MySQL.Async.fetchScalar('SELECT license FROM users WHERE name=@name',
{
['@name'] = name
}, function(license)

if identifier ~= nil then
if license ~= nil then
local fivemID = license

if reason == "" then
reason = Text.noreason
end

if name ~= nil then
if name ~= "" then
if duree ~= nil and duree < 365 then
local sourceplayername = GetPlayerName(source)

Expand All @@ -227,8 +229,6 @@ TriggerEvent('es:addGroupCommand', 'reason', "admin", function (source, args, us
end
end
end)
else
TriggerEvent('bansql:sendMessage', source, Text.invalidid)
end

end)
Expand Down

0 comments on commit fd0a90b

Please sign in to comment.