Wow,Tally you are brilliant :]
Wow,Tally you are brilliant :]
Two more things...
Players are not obligated to log in in order to play - they can just escape the login menu and open the ingame menu. If you want to force them to log in, go to _menus.gsc and replace
withCode:case "changeteam": self closeMenu(); self closeInGameMenu(); self openMenu(game["menu_team"]); break;
And also, the backspace function is not working.Code:case "changeteam": self closeMenu(); self closeInGameMenu(); if(isdefined(self.login)) self openMenu(game["menu_team"]); else self openMenu(game["menu_login"]); break;
In _account.gsc you need to add this:
after thisCode:else if( response == "backspace" ) { if( !self.edittext ) { if( self.lname.size > 0 ) { self.lname=getsubstr(self.lname,0,self.lname.size-1); } self setclientcvar( "loginname", self.lname + "_" ); continue; } else { if( self.lpw.size > 0 ) { self.lpw=getsubstr(self.lpw,0,self.lpw.size-1); } self setclientcvar( "loginpw", self.lpw + "_" ); continue; } }
The backspace thing is based on IzNoGod's acc system.Code:if( menu == "login" ) { if( response.size == 1 && issubstr( "0123456789abcdefghijklmnopqrstuvwxyz", response[0] ) ) { if( !self.edittext ) { if( self.lname.size < 35 ) self.lname += response; self setclientcvar( "loginname", self.lname + "_" ); continue; } else { if( self.lpw.size < 35 ) self.lpw += response; self setclientcvar( "loginpw", self.lpw + "_" ); continue; } }
set logfile 2
actually, ignore this
because, after logging in, each time you try to change team the login menu will show up, even after you're correctly logged in.Code:case "changeteam": self closeMenu(); self closeInGameMenu(); if(isdefined(self.login)) self openMenu(game["menu_team"]); else self openMenu(game["menu_login"]); break;
set logfile 2
Since I'm remaking what I've lost, I'd just like to complement this with a TAB function (to easily switch between the user name and password fields).
This should be included as a menu response under the possible responses for the login and register menus:
And this should be added to both login.menu and register.menu:PHP Code:
else if(response == "tab")
{
if(self.edittext == true)
{
self.edittext = false;
self setclientcvar("loginname", self.lname + "_");
self setclientcvar("loginpw", self.lpw);
continue;
}
else if(self.edittext == false)
{
self.edittext = true;
self setclientcvar("loginname", self.lname);
self setclientcvar("loginpw", self.lpw + "_");
continue;
}
}
Code:execKeyInt 9 { play "mouse_click"; scriptMenuResponse "tab" }
set logfile 2
kung foo man (8th October 2015)
Also, the "Enter" function
Just add to each of the menu files:
Code:execKeyInt 13 { play "mouse_click"; scriptMenuResponse "ok" }
set logfile 2
Expanding it a little more with a bad word check on register.
This should be placed after the register menu response:
PHP Code:
badword = [];
badword[0] = "badword1";
badword[1] = "badword2";
badword[2] = "badword3";
badword[3] = "badword4";
badword[4] = "badword5";
for(i = 0; i < badword.size; i++)
{
if(issubstr(self.lname, badword[i]))
break;
}
if(i != badword.size)
{
self thread errorMessage("^7Bad word.");
continue;
}
Last edited by guiismiti; 14th October 2015 at 02:16.
set logfile 2
Please dont be the asshole that disallows you from using the word fuck in your username...
"Does not work" is an error report for a bug between keyboard and chair.
All hail Artie Effem
I forgot to mention that I created a highscores menu, which is a table with the top 10 xp, accessed through the ingame menu (should encourage people to play more...).
Well, I wouldnt mind them having the words in their user names if these user names didnt show up in the public board.
And, by the way, I'm brazilian and people tend to use bad words more often here. The average age of the players is lower than the usual.
set logfile 2