Your GUI code should go in a weapon which is added to players on login. onActionPlayerOnline is only called in the Control-NPC, and only serverside.
In Control-NPC
PHP Code:
function onActionPlayerOnline() {
// eventually you'll want to set up an array or so here of weapons and
// loop through them rather than adding another addWeapon line per weapon
// since most servers tend to add a dozen or more weapons on login
player.addWeapon("LoginGUI");
}
In weapon LoginGUI:
PHP Code:
//#CLIENTSIDE
function onCreated() {
new GuiWindowCtrl(...) {
// etc
}
}