From fd0a90ba2d5230f71b7998d892552bd912c580cb Mon Sep 17 00:00:00 2001 From: RedAlex Date: Thu, 8 Nov 2018 21:12:30 -0500 Subject: [PATCH] Fix Fail-Safe for reason command --- server.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server.lua b/server.lua index 957325f..29aa733 100644 --- a/server.lua +++ b/server.lua @@ -189,7 +189,9 @@ 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', @@ -197,14 +199,14 @@ TriggerEvent('es:addGroupCommand', 'reason', "admin", function (source, args, us ['@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) @@ -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)