As far as I am aware, the initial flag of the EVENT_PLAYER_ACTIVATED is a bit broken (or at least it was when I checked the last time). It works in that it passes true and false for login and reloadui, but for every other loading screen it passes true too, which may come a bit unexpected if you do not unregister the event handler.
To work around that you'll either have to add an extra variable which tracks if it's the first loading screen after the UI load or make sure the function is only called once by unregistering inside the handler.
|