PLUGIN.Title = "FixYourName" PLUGIN.Description = "Disables Weird Characters in Usernames, prevent them from preventing bans." PLUGIN.Author = "XoXFaby" function PLUGIN:Init() self.Characters = "abcdefghijklmnopqrstuvwxyz1234567890 [](){}!@#$%^&*_-=+.|" end function isNumCode( num ) if tonumber(num) ~= nil or num:lower() == "a" or num:lower() == "b" or num:lower() == "c" or num:lower() == "d" or num:lower() == "e" or num:lower() == "f" or num:lower() == "-" then return true else return false end end function PLUGIN:OnUserConnect( netuser ) local name = netuser.displayName local allowedName = true local forbidChar = "" for i = 1, name:len() do local allowedChar = false for j = 1, self.Characters:len() do if name:sub(i,i):lower() == self.Characters:sub(j,j) then allowedChar = true end end if allowedChar == false then allowedName = false forbidChar = i break end end local namecolor = false for i = 1, name:len() - 8 do if name:sub(i,i) == "[" and name:sub(i+1, i+1) and name:sub(i+2, i+2) and name:sub(i+3, i+3) and name:sub(i+4, i+4) and name:sub(i+5, i+5) and name:sub(i+5, i+5) and name:sub(i+6,i+6) == "]" then namecolor = true end end if not allowedName and namecolor then rust.Notice( netuser, "Kicked: Color code") rust.BroadcastChat( name .. " has been kicked ( Color code ) " ) netuser:Kick( NetError.Facepunch_Kick_RCON, true ) elseif not allowedName then rust.Notice( netuser, "Kicked: Name contains illegal character" ) rust.BroadcastChat( name .. " has been kicked ( Name contains illegal character ) " ) rust.RunClientCommand( netuser, 'chat.add "' .. 'Oxide" "Illegal Character: ' .. rust.QuoteSafe( name:sub(forbidChar,forbidChar) ) .. '"' ) netuser:Kick( NetError.Facepunch_Kick_RCON, true ) end end