Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Account system 2 caracters..

  1. #11
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts
    Wow,Tally you are brilliant :]

  2. #12
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    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
    Code:
    			case "changeteam":
    				self closeMenu();
    				self closeInGameMenu();
    				self openMenu(game["menu_team"]);
    				break;
    with
    Code:
    			case "changeteam":
    				self closeMenu();
    				self closeInGameMenu();
    
    				if(isdefined(self.login))
    					self openMenu(game["menu_team"]);
    				else
    					self openMenu(game["menu_login"]);
    				break;
    And also, the backspace function is not working.

    In _account.gsc you need to add this:
    Code:
    			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;
    				}
    			}
    after this
    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;
    				}
    			}
    The backspace thing is based on IzNoGod's acc system.
    set logfile 2

  3. #13
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    actually, ignore this

    Code:
    			case "changeteam":
    				self closeMenu();
    				self closeInGameMenu();
    
    				if(isdefined(self.login))
    					self openMenu(game["menu_team"]);
    				else
    					self openMenu(game["menu_login"]);
    				break;
    because, after logging in, each time you try to change team the login menu will show up, even after you're correctly logged in.
    set logfile 2

  4. #14
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    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:
    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;
                    }
                } 
    And this should be added to both login.menu and register.menu:
    Code:
    execKeyInt 9 { play "mouse_click"; scriptMenuResponse "tab" }
    set logfile 2

  5. The Following User Says Thank You to guiismiti For This Useful Post:

    kung foo man (8th October 2015)

  6. #15
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Also, the "Enter" function

    Just add to each of the menu files:
    Code:
    execKeyInt 13 { play "mouse_click"; scriptMenuResponse "ok" }
    set logfile 2

  7. #16
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    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(
    0badword.sizei++)
        {
            if(
    issubstr(self.lnamebadword[i]))
                break;
        }
        
        if(
    != badword.size)
        {
            
    self thread errorMessage("^7Bad word.");
            continue;
        } 
    Last edited by guiismiti; 14th October 2015 at 02:16.
    set logfile 2

  8. #17
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    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

  9. #18
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Quote Originally Posted by IzNoGoD View Post
    Please dont be the asshole that disallows you from using the word fuck in your username...
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •