diff --git a/resources/[system]/scoreboard/scoreboard.lua b/resources/[system]/scoreboard/scoreboard.lua
index 88685d7..bbed5e7 100644
--- a/resources/[system]/scoreboard/scoreboard.lua
+++ b/resources/[system]/scoreboard/scoreboard.lua
@@ -13,7 +13,7 @@ Citizen.CreateThread(function()
local wantedLevel = GetPlayerWantedLevel(i)
r, g, b = GetPlayerRgbColour(i)
table.insert(players,
- '
' .. GetPlayerServerId(i) .. ' | ' .. GetPlayerName(i) .. ' | ' .. (wantedLevel and wantedLevel or tostring(0)) .. ' |
'
+ '' .. GetPlayerServerId(i) .. ' | ' .. sanitize(GetPlayerName(i)) .. ' | ' .. (wantedLevel and wantedLevel or tostring(0)) .. ' |
'
)
end
@@ -45,4 +45,16 @@ function GetPlayers()
end
return players
-end
\ No newline at end of file
+end
+
+function sanitize(txt)
+ local replacements = {
+ ['&' ] = '&',
+ ['<' ] = '<',
+ ['>' ] = '>',
+ ['\n'] = '
'
+ }
+ return txt
+ :gsub('[&<>\n]', replacements)
+ :gsub(' +', function(s) return ' '..(' '):rep(#s-1) end)
+end