Solved Restrict names

Discussion in 'Plugin Requests' started by OUTCAST, Apr 27, 2015.

  1. Need help converting to 2.0
    Code:
    PLUGIN.Title = "BlockedNames"
    PLUGIN.Description = "Block unwanted nicknames from your server"
    PLUGIN.Version = "1.0"
    PLUGIN.Author = "OUTCAST"function PLUGIN:Init()
         print("Loaded BlockedNames!")
    endfunction PLUGIN:OnUserConnect(netuser)
         local BlockedNames = {"Server Console", "chat name","yours here"}
         local name = netuser.displayName
         for _,v in pairs(BlockedNames) do
              if (v == name) then
                   rust.SendChatToUser(netuser, "You're not allowed to use this nickname!")
                   netuser:Kick( NetError.Facepunch_Kick_RCON, true)
                   return
              end
         end
    end
    Thanks OUTCAST
     
    Last edited by a moderator: Apr 27, 2015
  2. Wulf

    Wulf Community Admin

  3. For Legacy 2.0? I'll have to test later.
     
  4. Wulf

    Wulf Community Admin

    It doesn't really use anything that wouldn't work on Legacy, so it should work. The connection.username might need to be changed, but that's about it.
     
  5. Okay, I will have to test later. Not at my computer atm.