> For the complete documentation index, see [llms.txt](https://aklgaming.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aklgaming.gitbook.io/documentation/code-snippets/blacklist-name.md).

# Blacklist Name

How to blacklist a name in Gta V FiveM. The purpose of this code is to make it easier for you to blacklist stubborn players/citizens (Cheaters) on your server.

```lua
local blacklistednames= {"", "script"}
local x = {}

AddEventHandler("playerConnecting", function(playerName, setKickReason)
   playerName = (string.gsub(string.gsub(string.gsub(playerName,  "-", ""), ",", ""), " ", ""):lower())
        for k, v in pairs(blacklistednames) do
          local g, f = playerName:find(string.lower(v))
          if g or f  then
            table.insert (x, v)
            local blresult = table.concat(x, " ")
              setKickReason('You have been kicked because you are a stupid cheater!')
              CancelEvent()
              for key in pairs (x) do
                x [key] = nil
          end
       end
    end
end)
```
