Fixed a gsub return error and removed gsub from the STEAMID replacement.

This commit is contained in:
Zach P 2022-08-05 13:16:07 -07:00 committed by GitHub
parent 7dbc4687ca
commit 78c55336c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@ ULib.BanMessage = [[
function ULib.getBanMessage( steamid, banData, templateMessage )
banData = banData or ULib.bans[ steamid ]
if not banData then return end
print( templateMessage )
templateMessage = templateMessage or ULib.BanMessage
local replacements = {
@ -24,7 +25,7 @@ function ULib.getBanMessage( steamid, banData, templateMessage )
BAN_START = "(Unknown)",
REASON = "(None given)",
TIME_LEFT = "(Permaban)",
STEAMID = steamid:gsub("%D", ""),
STEAMID = steamid,
STEAMID64 = util.SteamIDTo64( steamid ),
}
@ -45,8 +46,9 @@ function ULib.getBanMessage( steamid, banData, templateMessage )
if unban and unban > 0 then
replacements.TIME_LEFT = ULib.secondsToStringTime( unban - os.time() )
end
return templateMessage:gsub( "{{([%w_]+)}}", replacements )
local banMessage = templateMessage:gsub( "{{([%w_]+)}}", replacements )
return banMessage
end
local function checkBan( steamid64, ip, password, clpassword, name )