Ulib Name enforcer. Cant seem to figure it out

[lua]if ULib.pluginEnabled() then
ULib.addon = ULib.addon or {}
local usernames = {}

    ULib.addon.forcename = function (iUserid, sNewname, sOldname)
            if not _PlayerInfo (iUserid, "connected") then
                    return false, "User is not connected"
            end
            local login, name = ULib.getSteamLogin (iUserid), _PlayerInfo (iUserid, "name")

            if not usernames[login] then
                    usernames[login] = name
            elseif sNewname ~= usernames[login] then
                    _PrintMessage (iUserid, HUD_PRINTTALK, "The server forced you to keep your name.")
                    AddTimer (0.1, 1, ULib.cexec, iUserid, "name " .. usernames[login])
            end
            return true
    end

    HookEvent ("eventPlayerInitialSpawn", ULib.addon.forcename)
    HookEvent ("eventPlayerNameChange", ULib.addon.forcename)

else
_Msg ("Plugin is not enabled
")
end [/lua]

Cannot seem to make this This is suppose to force a players name to always be the same even if he changes it out side of the game.

[lua]
[ERROR] addons/ulib/lua/ulib/modules/nameforcer.lua:1: attempt to call field ‘pluginEnabled’ (a nil value)

  1. unknown - addons/ulib/lua/ulib/modules/nameforcer.lua:1
  2. include - [C]:-1
    3. unknown - addons/ulib/lua/ulib/cl_init.lua:23
    4. include - [C]:-1
    5. unknown - addons/ulib/lua/autorun/ulib_init.lua:5

[/lua]

Even if someone pointed me in a different direction with making it so people cannot change there names I would be grateful.

plugginEnabled is not a valid function

[editline]19th July 2013[/editline]

What documentation are you looking at?

Yeah I realize that this is outdated. But I’m not sure what the plugginEnabled should be changed to. Cant really find anything to reference from.

steamworks.GetPlayerName( LocalPlayer():SteamID64() )
This MAY return their actual name?

[editline]19th July 2013[/editline]

I also think you could http.Fetch( “http://steamcommunity.com/profiles/”…ply:SteamID64(), function onSuccess, function onFailure )
and get their “persona_name” which is their actual name

hmm very cool, never dabbled in this before so thank you. Now just have to figure out how to implement it.

You could just override the ply:Nick() function, if your scripts are using that to return the player name.