# Registration & Login system V1.00 26-05-2014 -Initial release # # Registration & Login system V1.01 26-05-2014 -Code cleanup & comments added # # Registration & Login system V1.02 28-05-2014 -Fixed a massive bug in Register and then Login account # # -Only show Login button if account is present # # -Only show Register button if no account is present # # -Show warning about password being send&stored in plain text # # -Added button to leave server # # -All clickable buttons are shown with yellow text # # -Added timer to each screen, to avoid people will stil drive, while screen is left open # # Registration & Login system V1.03 13-09-2015 -Added message in chat, when someone logs in # # Registration & Login system V1.04 16-09-2015 -Changed show "registered name" on logon, instead of "LFS username" # # -Added configuration screen to: # # - Set Teamname # # - Set who is allowed to register accounts # # - Set if message is shown when someone logs in # # -Excluded admins from the need to login # # -Added option so that admins can create an account for users # # Registration & Login system V1.05 04-10-2015 -Added option for extra check when a player tries to join the track # # Registration & Login system V1.06 11-10-2015 -Made the exclusion of Admins a configurable option (default setting is: yes) # # -Updated the layout of the configuration screen (!confreg) a bit # # -Fixed the number of login attemps left, that could go below zero # # -Updated the login screen, so that is closes (for local admins) when login attemps reach zero # # Registration & Login system V1.07 16-10-2015 -Added a new way to store accounts, can be used to avoid accounts with the same name # # -Made the new store method configurable # # -Made the check on accounts with the same name configurable # # -Fixed an issue with an empty screen when no account could be found # # -Fixed a bug with "$register_join_check" where a ; was missing in the code # # -Added an extra command !login to be excuted by admins, after they registered them self # # -Added a variable to reflect the version number of the code # # Registration & Login system V1.08 18-10-2015 -Disabled the possibility to register accounts, while not all the required fields where filled # # -Added a module to manage registered accounts (to be accessed using: !manreg) # # -Disabled a piece of probably obsolete code # # -Added check to see if LFSusername already has an account when admin tries to add one # # Registration & Login system V1.09 25-10-2015 -Fixed a bug on check account, when player isn't a server admin # # Registration & Login system V1.10 12-02-2017 -Added option to check if someone is banned and if so, kick him out # # -Added option to ban someone and write that ban to a file # # Registration & Login system V1.11 25-02-2017 -Removed all code for ban management and put it in a seperate module # # Registration & Login system V1.11b 26-02-2017 -Forgot to remove one piece of the ban management code # ######################################################################################################################################################### CatchEvent OnMSO( $userName, $text ) # Player event $idxOfFirtsSpace = indexOf( $text, " "); IF( $idxOfFirtsSpace == -1 ) THEN $command = $text; $argv = ""; ELSE $command = subStr( $text,0,$idxOfFirtsSpace ); $argv = trim( subStr( $text,$idxOfFirtsSpace ) ); ENDIF SWITCH( $command ) CASE "!register": IF( UserInGroup( "admin", $userName ) == 1 ) THEN Register( $KeyFlags,$id ); ELSE PrivMsg( "^1You are not allowed to do that"); ENDIF BREAK; CASE "!confreg": IF( UserInGroup( "admin", $userName ) == 1 ) THEN Conf_Register( $KeyFlags,$id ); ELSE PrivMsg( "^1You are not allowed to do that"); ENDIF BREAK; CASE "!login": IF( UserInGroup( "admin", $userName ) == 1 ) THEN Login( $KeyFlags,$id ); ELSE PrivMsg( "^1You are not allowed to do that"); ENDIF BREAK; CASE "!manreg": IF( UserInGroup( "admin", $userName ) == 1 ) THEN Manage_registrations( $KeyFlags,$id ); ELSE PrivMsg( "^1You are not allowed to do that"); ENDIF BREAK; ENDSWITCH EndCatchEvent CatchEvent OnLapperStart() OnLapperStart_Registration(); EndCatchEvent CatchEvent OnConnect( $userName ) # Player event OnConnect_Ask_Registration(); EndCatchEvent CatchEvent OnNewPlayerJoin( $userName ) # Player event OnNewPlayerJoin_Registration(); EndCatchEvent Sub OnLapperStart_Registration() ### Declare global variables ### GlobalVar $register_version; GlobalVar $register_teamname; GlobalVar $register_option; GlobalVar $register_show_logon; GlobalVar $register_join_check; GlobalVar $register_exclude_admins; GlobalVar $register_counter; GlobalVar $register_store_method; GlobalVar $register_allow_duplicates; GlobalVar $lfs_username; GlobalVar $login_name; GlobalVar $password; GlobalVar $account_id; GlobalVar $rows_displayed; GlobalVar $total_rows_displayed; ### End ### ### Set version number ### $register_version="V1.11b"; ### End ### ### Load stored values and give them a default setting if no stored value has been found ### $register_teamname = GetStoredValue( "REGISTER_TEAMNAME" ); IF ($register_teamname == "") THEN $register_teamname ="[TEAMNAME]"; ENDIF $register_option = GetStoredValue( "REGISTER_OPTION" ); IF ($register_option == "") THEN $register_option="admin"; ENDIF $register_show_logon = GetStoredValue( "REGISTER_SHOW_LOGON" ); IF ($register_show_logon == "") THEN $register_show_logon="no"; ENDIF $register_join_check = GetStoredValue( "REGISTER_JOIN_CHECK" ); IF ($register_join_check == "") THEN $register_join_check="no"; ENDIF $register_exclude_admins = GetStoredValue( "REGISTER_EXCLUDE_ADMINS" ); IF ($register_exclude_admins == "") THEN $register_exclude_admins="yes"; ENDIF $register_counter = ToNum( GetStoredValue( "REGISTER_COUNTER" ) ); IF ($register_counter == "") THEN $register_counter=0; ENDIF $register_store_method = GetStoredValue( "REGISTER_STORE_METHOD" ); IF ($register_store_method == "") THEN $register_store_method="lfsname"; ENDIF $register_allow_duplicates = GetStoredValue( "REGISTER_ALLOW_DUPLICATES" ); IF ($register_allow_duplicates == "") THEN $register_allow_duplicates="yes"; ENDIF ### End ### ### Give global variables an empty value ### $lfs_username=""; $login_name=""; $password=""; $account_id=""; $rows_displayed=0; $total_rows_displayed=0; ### End ### EndSub Sub OnConnect_Ask_Registration() ### Set userName variable and load the nicknames of admins specified in admin.txt ### $userName = GetCurrentPlayerVar( "UserName" ); UserGroupFromFile( "admin", "./admin.txt" ); ### End ### ### Set allowed_to_join to no by default, this is only checked if check is enabled ### SetCurrentPlayerVar( "allowed_to_join","no" ); ### End ### ### If user isn't a specified admin, login or registration is required ### IF ( $register_exclude_admins == "yes" ) THEN IF( UserInGroup( "admin", $userName ) != 1 ) THEN ### Get UserName and search in storedvalue.dbs for saved values for this user ### IF ( $register_store_method == "number" ) THEN FOR ($i=0;$i<$register_counter;$i=$i+1) IF (GetStoredValue( "logon_username_" . $i ) == $userName ) THEN SetCurrentPlayerVar( "logon_code",GetStoredValue( "logon_code_" . $i ) ); SetCurrentPlayerVar( "logon_password",GetStoredValue( "logon_password_" . $i ) ); ENDIF ENDFOR ELSE SetCurrentPlayerVar( "logon_code",GetStoredValue( $userName . "logon_code" ) ); SetCurrentPlayerVar( "logon_password",GetStoredValue( $userName . "logon_password" ) ); ENDIF ### End ### ### Set number of logon attempts to 3 ### SetCurrentPlayerVar( "login_attempts",3 ); ### End ### ### Set left/right and top/bottom coordinates ### $left_right_welcome=64; $top_bottom_welcome=80; ### End ### openPrivButton( "welcome_reg_bg",$left_right_welcome,$top_bottom_welcome,72,32,5,-1,16,"" ); openPrivButton( "welcome_reg_title",$left_right_welcome+1,$top_bottom_welcome+1,70,5,5,-1,32,"^7Welcome at this ".$register_teamname." ^7server" ); openPrivButton( "welcome_reg_server",$left_right_welcome+1,$top_bottom_welcome+6,70,5,5,-1,32,"^7You are on server: " . getLapperVar( "HostName" ) ); IF ($register_option == "user") THEN IF ( GetCurrentPlayerVar( "logon_code") == "" && GetCurrentPlayerVar( "logon_password") == "" ) THEN openPrivButton( "welcome_register",$left_right_welcome+1,$top_bottom_welcome+16,35,5,5,-1,32,"^3Register",Register ); ELSE openPrivButton( "welcome_login",$left_right_welcome+1,$top_bottom_welcome+16,35,5,5,-1,32,"^3Login",Login ); ENDIF ELSE IF ( GetCurrentPlayerVar( "logon_code") != "" && GetCurrentPlayerVar( "logon_password") != "" ) THEN openPrivButton( "welcome_login",$left_right_welcome+1,$top_bottom_welcome+16,35,5,5,-1,32,"^3Login",Login ); ELSE openPrivButton( "welcome_register",$left_right_welcome+1,$top_bottom_welcome+16,35,5,5,-1,32,"^3MESSAGE: ^7Ask an admin..." . "%nl%^7... to create an account for you"); ENDIF ENDIF openPrivButton( "leave_server_connect",$left_right_welcome+36,$top_bottom_welcome+16,35,5,5,-1,32,"^3Leave server",Leave_server ); openPrivButton( "action_required_connect",$left_right_welcome+1,$top_bottom_welcome+26,70,5,5,30,32,"^7Time left before being kicked off the server: %cpt%",Leave_server ); ELSE PrivMsg ("^3MESSAGE: ^7Admins don't need to login on this server"); ENDIF ELSE ### Get UserName and search in storedvalue.dbs for saved values for this user ### IF ( $register_store_method == "number" ) THEN FOR ($i=0;$i<$register_counter;$i=$i+1) IF (GetStoredValue( "logon_username_" . $i ) == $userName ) THEN SetCurrentPlayerVar( "logon_code",GetStoredValue( "logon_code_" . $i ) ); SetCurrentPlayerVar( "logon_password",GetStoredValue( "logon_password_" . $i ) ); ENDIF ENDFOR ELSE SetCurrentPlayerVar( "logon_code",GetStoredValue( $userName . "logon_code" ) ); SetCurrentPlayerVar( "logon_password",GetStoredValue( $userName . "logon_password" ) ); ENDIF ### End ### ### Set number of logon attempts to 3 ### SetCurrentPlayerVar( "login_attempts",3 ); ### End ### ### Set left/right and top/bottom coordinates ### $left_right_welcome=64; $top_bottom_welcome=80; ### End ### openPrivButton( "welcome_reg_bg",$left_right_welcome,$top_bottom_welcome,72,32,5,-1,16,"" ); openPrivButton( "welcome_reg_title",$left_right_welcome+1,$top_bottom_welcome+1,70,5,5,-1,32,"^7Welcome at this ".$register_teamname." ^7server" ); openPrivButton( "welcome_reg_server",$left_right_welcome+1,$top_bottom_welcome+6,70,5,5,-1,32,"^7You are on server: " . getLapperVar( "HostName" ) ); IF ( GetCurrentPlayerVar( "logon_code") != "" && GetCurrentPlayerVar( "logon_password") != "" ) THEN openPrivButton( "welcome_login",$left_right_welcome+1,$top_bottom_welcome+16,35,5,5,-1,32,"^3Login",Login ); ELSE IF ( UserInGroup( "admin", $userName ) == 1 ) THEN openPrivButton( "welcome_register",$left_right_welcome+1,$top_bottom_welcome+16,35,5,5,-1,32,"^1Admin register",Register ); SetCurrentPlayerVar( "admin_login_username",$userName ); ELSE openPrivButton( "welcome_register",$left_right_welcome+1,$top_bottom_welcome+16,35,5,5,-1,32,"^3MESSAGE: ^7Ask an admin..." . "%nl%^7... to create an account for you"); ENDIF ENDIF IF ($register_option == "user") THEN IF ( GetCurrentPlayerVar( "logon_code") == "" && GetCurrentPlayerVar( "logon_password") == "" ) THEN openPrivButton( "welcome_register",$left_right_welcome+1,$top_bottom_welcome+16,35,5,5,-1,32,"^3Register",Register ); ENDIF ENDIF openPrivButton( "leave_server_connect",$left_right_welcome+36,$top_bottom_welcome+16,35,5,5,-1,32,"^3Leave server",Leave_server ); openPrivButton( "action_required_connect",$left_right_welcome+1,$top_bottom_welcome+26,70,5,5,30,32,"^7Time left before being kicked off the server: %cpt%",Leave_server ); ENDIF ### End ### EndSub Sub OnNewPlayerJoin_Registration() $userName = GetCurrentPlayerVar( "UserName" ); IF ($register_join_check == "yes") THEN IF ( GetCurrentPlayerVar( "allowed_to_join" ) == "no" && UserInGroup( "admin", $userName ) != 1 ) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^3MESSAGE: ^7Spectated for not being logged in succesfully"); ENDIF ENDIF EndSub Sub Login( $KeyFlags,$id ) ### Set left/right and top/bottom coordinates ### $left_right_welcome=64; $top_bottom_welcome=80; ### End ### ### Close buttons that were drawn when user connected ### closePrivButton("welcome_reg_bg&welcome_reg_title&welcome_reg_server&welcome_login&welcome_register&leave_server_connect&warning&action_required_connect"); ### End ### openPrivButton( "loginscreen_bg",$left_right_welcome,$top_bottom_welcome,72,42,5,-1,16,"" ); openPrivButton( "loginscreen_title",$left_right_welcome+1,$top_bottom_welcome+1,70,5,5,-1,32,"^7Login at this ".$register_teamname." ^7server" ); openPrivButton( "loginscreen_1a",$left_right_welcome+1,$top_bottom_welcome+11,35,5,5,-1,32,"^7Login name: " ); IF ( GetCurrentPlayerVar( "logon_code_input" ) == "") THEN openPrivTextButton( "loginscreen_1b",$left_right_welcome+36,$top_bottom_welcome+11,35,5,5,32,"^3Login name","^3Click to enter",40,config_loginname ); ELSE openPrivTextButton( "loginscreen_1b",$left_right_welcome+36,$top_bottom_welcome+11,35,5,5,32,"^3Login name","^3".GetCurrentPlayerVar( "logon_code_input" ),40,config_loginname ); ENDIF openPrivButton( "loginscreen_2a",$left_right_welcome+1,$top_bottom_welcome+16,35,5,5,-1,32,"^7Password: " ); IF ( GetCurrentPlayerVar( "logon_password_input" ) == "") THEN openPrivTextButton( "loginscreen_2b",$left_right_welcome+36,$top_bottom_welcome+16,35,5,5,32,"^3Password","^3Click to enter",40,config_password ); ELSE openPrivTextButton( "loginscreen_2b",$left_right_welcome+36,$top_bottom_welcome+16,35,5,5,32,"^3Password","^3".GetCurrentPlayerVar( "logon_password_input" ),40,config_password ); ENDIF openPrivButton( "loginscreen_check",$left_right_welcome+1,$top_bottom_welcome+26,35,5,5,-1,32,"^3Login",Check_login ); openPrivButton( "leave_server_login",$left_right_welcome+36,$top_bottom_welcome+26,35,5,5,-1,32,"^3Leave server",Leave_server ); openPrivButton( "action_required_login",$left_right_welcome+1,$top_bottom_welcome+36,70,5,5,60,32,"^7Time left before being kicked off the server: %cpt%",Leave_server ); EndSub Sub Register( $KeyFlags,$id ) ### Set left/right and top/bottom coordinates ### $left_right_welcome=64; $top_bottom_welcome=80; ### End ### ### Close buttons that were drawn when user connected ### closePrivButton("welcome_reg_bg&welcome_reg_title&welcome_reg_server&welcome_login&welcome_register&leave_server_connect&action_required_connect"); ### End ### ### Set userName variable ### $userName = GetCurrentPlayerVar( "UserName" ); ### End ### ### Check if register option is set to 'user' and if user is or isn't an admin ### ### Check if user already has a registered account on this server, start registration if not, redirect to login screen if account is present ### IF ($register_option == "user" && UserInGroup( "admin", $userName ) != 1) THEN IF ( GetCurrentPlayerVar( "logon_code") == "" && GetCurrentPlayerVar( "logon_password") == "" ) THEN openPrivButton( "register_bg",$left_right_welcome,$top_bottom_welcome,72,67,5,-1,16,"" ); openPrivButton( "register_title",$left_right_welcome+1,$top_bottom_welcome+1,70,5,5,-1,32,"^7Register at this ".$register_teamname." ^7server" ); openPrivButton( "warning",$left_right_welcome+1,$top_bottom_welcome+11,70,5,5,-1,96," ^1!!! WARNING ^7- ^1WARNING ^7- ^1WARNING ^7- ^1WARNING !!! " . "%nl%^7 " . "%nl%^7- Your password is send and stored in plain text" . "%nl%^7- ^1DON'T^7 use a password you use regularly somewhere else"); openPrivButton( "register_1a",$left_right_welcome+1,$top_bottom_welcome+36,35,5,5,-1,32,"^7Login name: " ); IF ( GetCurrentPlayerVar( "logon_code_input_2" ) == "") THEN openPrivTextButton( "register_1b",$left_right_welcome+36,$top_bottom_welcome+36,35,5,5,32,"^3Login name","^3Click to enter",40,config_loginname_2 ); ELSE openPrivTextButton( "register_1b",$left_right_welcome+36,$top_bottom_welcome+36,35,5,5,32,"^3Login name","^3".GetCurrentPlayerVar( "logon_code_input_2" ),40,config_loginname_2 ); ENDIF openPrivButton( "register_2a",$left_right_welcome+1,$top_bottom_welcome+41,35,5,5,-1,32,"^7Password: " ); IF ( GetCurrentPlayerVar( "logon_password_input_2" ) == "") THEN openPrivTextButton( "register_2b",$left_right_welcome+36,$top_bottom_welcome+41,35,5,5,32,"^3Password","^3Click to enter",40,config_password_2 ); ELSE openPrivTextButton( "register_2b",$left_right_welcome+36,$top_bottom_welcome+41,35,5,5,32,"^3Password","^3".GetCurrentPlayerVar( "logon_password_input_2" ),40,config_password_2 ); ENDIF openPrivButton( "registration_check",$left_right_welcome+1,$top_bottom_welcome+51,35,5,5,-1,32,"^3Register account",Check_registration ); openPrivButton( "leave_server_register",$left_right_welcome+36,$top_bottom_welcome+51,35,5,5,-1,32,"^3Leave server",Leave_server ); openPrivButton( "action_required_register",$left_right_welcome+1,$top_bottom_welcome+61,70,5,5,60,32,"^7Time left before being kicked off the server: %cpt%",Leave_server ); ELSE /* ### 18-10-15 , this code looks to be obsolete ### PrivMsg ("^1WARNING: ^7You already have an account on this server"); PrivMsg ("^1WARNING: " . GetCurrentPlayerVar( "logon_code") ); Login( $KeyFlags,$id ); */ ENDIF ELSE openPrivButton( "register_bg",$left_right_welcome,$top_bottom_welcome,72,67,5,-1,16,"" ); openPrivButton( "register_title",$left_right_welcome+1,$top_bottom_welcome+1,70,5,5,-1,32,"^7Admin registration form" ); openPrivButton( "warning",$left_right_welcome+1,$top_bottom_welcome+11,70,5,5,-1,96," ^1!!! WARNING ^7- ^1WARNING ^7- ^1WARNING ^7- ^1WARNING !!! " . "%nl%^7 " . "%nl%^7- Password is send and stored in plain text" . "%nl%^7- ^1DON'T^7 use a password used regularly somewhere else"); openPrivButton( "register_1a",$left_right_welcome+1,$top_bottom_welcome+36,35,5,5,-1,32,"^7LFS username: " ); IF ( $lfs_username == "" ) THEN IF ( GetCurrentPlayerVar( "admin_login_username" ) != "" ) THEN $lfs_username=GetCurrentPlayerVar( "admin_login_username" ); openPrivButton( "register_1b",$left_right_welcome+36,$top_bottom_welcome+36,35,5,5,-1,32,"^7".$lfs_username ); ELSE openPrivTextButton( "register_1b",$left_right_welcome+36,$top_bottom_welcome+36,35,5,5,32,"^3LFS username","^3Click to enter",40,config_lfs_username ); ENDIF ELSE openPrivTextButton( "register_1b",$left_right_welcome+36,$top_bottom_welcome+36,35,5,5,32,"^3LFS username","^3".$lfs_username,40,config_lfs_username ); ENDIF openPrivButton( "register_2a",$left_right_welcome+1,$top_bottom_welcome+41,35,5,5,-1,32,"^7Login name: " ); IF ( $login_name == "" ) THEN openPrivTextButton( "register_2b",$left_right_welcome+36,$top_bottom_welcome+41,35,5,5,32,"^3Login name","^3Click to enter",40,config_loginname_3 ); ELSE openPrivTextButton( "register_2b",$left_right_welcome+36,$top_bottom_welcome+41,35,5,5,32,"^3Login name","^3".$login_name,40,config_loginname_3 ); ENDIF openPrivButton( "register_3a",$left_right_welcome+1,$top_bottom_welcome+46,35,5,5,-1,32,"^7Password: " ); IF ( $password == "" ) THEN openPrivTextButton( "register_3b",$left_right_welcome+36,$top_bottom_welcome+46,35,5,5,32,"^3Password","^3Click to enter",40,config_password_3 ); ELSE openPrivTextButton( "register_3b",$left_right_welcome+36,$top_bottom_welcome+46,35,5,5,32,"^3Password","^3".$password,40,config_password_3 ); ENDIF openPrivButton( "registration_check",$left_right_welcome+1,$top_bottom_welcome+61,35,5,5,-1,32,"^3Register account",Check_registration ); openPrivButton( "close_admin_reg",$left_right_welcome+36,$top_bottom_welcome+61,35,5,5,-1,32,"^3Close",close_admin_reg ); ENDIF ### End ### EndSub Sub config_loginname ( $loginname_value,$text ) ### Collect login name which has been entered in login screen ### $loginname=$text; SetCurrentPlayerVar( "logon_code_input",$loginname ); Login( $KeyFlags,$id ); ### End ### EndSub Sub config_password ( $password_value,$text ) ### Collect password name which has been entered in login screen ### $password_user=$text; SetCurrentPlayerVar( "logon_password_input",$password_user ); Login( $KeyFlags,$id ); ### End ### EndSub Sub Check_login ( $KeyFlags,$id ) ### Get UserName and search in storedvalue.dbs for saved values for this user ### $userName = GetCurrentPlayerVar( "UserName" ); IF ( $register_store_method == "number" ) THEN FOR ($i=0;$i<$register_counter;$i=$i+1) IF (GetStoredValue( "logon_username_" . $i ) == $userName ) THEN SetCurrentPlayerVar( "logon_code",GetStoredValue( "logon_code_" . $i ) ); SetCurrentPlayerVar( "logon_password",GetStoredValue( "logon_password_" . $i ) ); ENDIF ENDFOR ELSE SetCurrentPlayerVar( "logon_code",GetStoredValue( $userName . "logon_code" ) ); SetCurrentPlayerVar( "logon_password",GetStoredValue( $userName . "logon_password" ) ); ENDIF ### End ### IF ( GetCurrentPlayerVar( "logon_code_input") == GetCurrentPlayerVar( "logon_code") && GetCurrentPlayerVar( "logon_password_input" ) == GetCurrentPlayerVar( "logon_password") ) THEN closePrivButton("loginscreen_bg&loginscreen_title&loginscreen_1a&loginscreen_1b&loginscreen_2a&loginscreen_2b&loginscreen_check&leave_server_login&action_required_login"); PrivMsg ("^7Login okay"); IF ($register_show_logon == "yes") THEN GlobalMsg ("^7".GetCurrentPlayerVar( "logon_code")."^7 has logged into the server"); ENDIF IF ($register_join_check == "yes") THEN SetCurrentPlayerVar( "allowed_to_join","yes"); ENDIF ELSE PrivMsg ("^1WARNING: ^7Login NOT okay"); IF ( ToNum(GetCurrentPlayerVar( "login_attempts")) >= 1) THEN $login_attempts=ToNum( GetCurrentPlayerVar( "login_attempts")-1 ); SetCurrentPlayerVar( "login_attempts",$login_attempts ); ENDIF IF ( ToNum(GetCurrentPlayerVar( "login_attempts")) > 0) THEN PrivMsg ("^7Login attempts left: " . GetCurrentPlayerVar( "login_attempts") ); Login( $KeyFlags,$id ); ELSE ### Close login screen, this is for local admins, since they can't be kicked ### closePrivButton("loginscreen_bg&loginscreen_title&loginscreen_1a&loginscreen_1b&loginscreen_2a&loginscreen_2b&loginscreen_check&leave_server_login&action_required_login"); ### End ### cmdLFS("/kick " . GetCurrentPlayerVar("UserName") ); ENDIF ENDIF EndSub Sub config_lfs_username ( $lfs_username_value,$text ) ### Collect kfs username which has been entered in registration screen ### $lfs_username=$text; Register( $KeyFlags,$id ); ### End ### EndSub Sub config_loginname_2 ( $loginname_value,$text ) ### Collect login name which has been entered in registration screen ### $loginname=$text; SetCurrentPlayerVar( "logon_code_input_2",$loginname ); Register( $KeyFlags,$id ); ### End ### EndSub Sub config_loginname_3 ( $loginname_value,$text ) ### Collect login name which has been entered in registration screen ### $login_name=$text; Register( $KeyFlags,$id ); ### End ### EndSub Sub config_password_2 ( $password_value,$text ) ### Collect password which has been entered in registration screen ### $password_user=$text; SetCurrentPlayerVar( "logon_password_input_2",$password_user ); Register( $KeyFlags,$id ); ### End ### EndSub Sub config_password_3 ( $password_value,$text ) ### Collect password which has been entered in registration screen ### $password=$text; Register( $KeyFlags,$id ); ### End ### EndSub Sub Check_registration ( $KeyFlags,$id ) IF ($register_option == "user") THEN IF ( GetCurrentPlayerVar( "logon_code_input_2") != "" && GetCurrentPlayerVar( "logon_password_input_2") != "" ) THEN IF ( $register_store_method == "number" ) THEN SetCurrentPlayerVar( "logon_code_double","false" ); IF ( $register_allow_duplicates == "no" ) THEN FOR ($i=0;$i<$register_counter;$i=$i+1) IF (GetStoredValue( "logon_code_" . $i ) == GetCurrentPlayerVar( "logon_code_input_2" ) ) THEN SetCurrentPlayerVar( "logon_code_double","true" ); ENDIF ENDFOR ENDIF IF ( GetCurrentPlayerVar( "logon_code_double" ) == "true" ) THEN PrivMsg ("^3MESSAGE: ^7There's already an account registered with..."); PrivMsg ("^7...that name"); ELSE IF ( GetCurrentPlayerVar( "logon_code_input_2" ) != "" && GetCurrentPlayerVar( "logon_password_input_2" ) != "" ) THEN $userName = GetCurrentPlayerVar( "UserName" ); SetStoredValue( "logon_username_" . $register_counter, $userName ); SetStoredValue( "logon_code_" . $register_counter, GetCurrentPlayerVar( "logon_code_input_2" ) ); SetStoredValue( "logon_password_" . $register_counter, GetCurrentPlayerVar( "logon_password_input_2" ) ); $register_counter=$register_counter+1; SetStoredValue( "REGISTER_COUNTER", ToNum( $register_counter ) ); closePrivButton("register_bg®ister_title&warning®ister_1a®ister_1b®ister_2a®ister_2b®istration_check&leave_server_register&action_required_register"); PrivMsg ("^7Registration okay"); Login( $KeyFlags,$id ); ELSE PrivMsg ("^3MESSAGE: ^7One or more values are empty"); ENDIF ENDIF ELSE IF ( GetCurrentPlayerVar( "logon_code_input_2" ) != "" && GetCurrentPlayerVar( "logon_password_input_2" ) != "" ) THEN $userName = GetCurrentPlayerVar( "UserName" ); SetStoredValue( $userName . "logon_code", GetCurrentPlayerVar( "logon_code_input_2" ) ); SetStoredValue( $userName . "logon_password", GetCurrentPlayerVar( "logon_password_input_2" ) ); closePrivButton("register_bg®ister_title&warning®ister_1a®ister_1b®ister_2a®ister_2b®istration_check&leave_server_register&action_required_register"); PrivMsg ("^7Registration okay"); Login( $KeyFlags,$id ); ELSE PrivMsg ("^3MESSAGE: ^7One or more values are empty"); ENDIF ENDIF ELSE IF ( GetCurrentPlayerVar( "logon_code_input_2") != "" && GetCurrentPlayerVar( "logon_password_input_2") == "" ) THEN PrivMsg ("^1WARNING: ^7Password NOT set"); Register( $KeyFlags,$id ); ELSE IF ( GetCurrentPlayerVar( "logon_code_input_2") == "" ) THEN PrivMsg ("^1WARNING: ^7Login name NOT set"); Register( $KeyFlags,$id ); ENDIF ENDIF ENDIF ELSE IF ( $register_store_method == "number" ) THEN SetCurrentPlayerVar( "logon_code_double","false" ); SetCurrentPlayerVar( "lfsname_double","false" ); IF ( $register_allow_duplicates == "no" ) THEN FOR ($i=0;$i<$register_counter;$i=$i+1) IF (GetStoredValue( "logon_code_" . $i ) == $login_name ) THEN SetCurrentPlayerVar( "logon_code_double","true" ); ENDIF ENDFOR ENDIF FOR ($i=0;$i<$register_counter;$i=$i+1) IF (GetStoredValue( "logon_username_" . $i ) == $lfs_username ) THEN SetCurrentPlayerVar( "lfsname_double","true" ); ENDIF ENDFOR IF ( GetCurrentPlayerVar( "logon_code_double" ) == "true" ) THEN PrivMsg ("^3MESSAGE: ^7There's already an account registered with..."); PrivMsg ("^7...that name"); ELSE IF ( GetCurrentPlayerVar( "lfsname_double" ) == "true" ) THEN PrivMsg ("^3MESSAGE: ^7There's already an account registered for..."); PrivMsg ("^7...this LFSusername"); ELSE IF ( $lfs_username != "" && $login_name != "" && $password != "") THEN SetStoredValue( "logon_username_" . $register_counter, $lfs_username ); SetStoredValue( "logon_code_" . $register_counter, $login_name ); SetStoredValue( "logon_password_" . $register_counter, $password ); $register_counter=$register_counter+1; SetStoredValue( "REGISTER_COUNTER", ToNum ( $register_counter ) ); closePrivButton("register_bg®ister_title&warning®ister_1a®ister_1b®ister_2a®ister_2b®ister_3a®ister_3b®istration_check&close_admin_reg"); $lfs_username=""; $login_name=""; $password=""; PrivMsg ("^7Registration by admin okay"); ELSE PrivMsg ("^3MESSAGE: ^7One or more values are empty"); ENDIF ENDIF ENDIF ELSE IF ( $login_name != "" && $password != "") THEN $userName = GetCurrentPlayerVar( "UserName" ); SetStoredValue( $userName . "logon_code", $login_name ); SetStoredValue( $userName . "logon_password", $password ); closePrivButton("register_bg®ister_title&warning®ister_1a®ister_1b®ister_2a®ister_2b®ister_3a®ister_3b®istration_check&close_admin_reg"); $lfs_username=""; $login_name=""; $password=""; PrivMsg ("^7Registration by admin okay"); ELSE PrivMsg ("^3MESSAGE: ^7One or more values are empty"); ENDIF ENDIF ENDIF SetCurrentPlayerVar( "admin_login_username","" ); EndSub Sub Leave_server ( $KeyFlags,$id ) cmdLFS("/kick " . GetCurrentPlayerVar("UserName") ); EndSub Sub close_admin_reg( $KeyFlags,$id ) closePrivButton("register_bg®ister_title&warning®ister_1a®ister_1b®ister_2a®ister_2b®ister_3a®ister_3b®istration_check&close_admin_reg"); EndSub Sub Conf_Register( $KeyFlags,$id ) ### Set left/right and top/bottom coordinates ### $left_right_conf_reg=64; $top_bottom_conf_reg=80; ### End ### openPrivButton( "register_conf_bg",$left_right_conf_reg,$top_bottom_conf_reg,78,67,5,-1,16,"" ); openPrivButton( "register_conf_title",$left_right_conf_reg+1,$top_bottom_conf_reg+1,76,5,5,-1,32,"^7Configure Registration module " . $register_version ); openPrivButton( "register_conf_teamname_1",$left_right_conf_reg+1,$top_bottom_conf_reg+11,38,5,5,-1,96,"^7Teamname:" ); IF ($register_teamname == "") THEN openPrivTextButton( "register_conf_teamname_2",$left_right_conf_reg+39,$top_bottom_conf_reg+11,38,5,5,32,"^3Teamname","^3Click to set",80,config_teamname ); ELSE openPrivTextButton( "register_conf_teamname_2",$left_right_conf_reg+39,$top_bottom_conf_reg+11,38,5,5,32,"^3Teamname","^3".$register_teamname,80,config_teamname ); ENDIF openPrivButton( "register_counter_title",$left_right_conf_reg+1,$top_bottom_conf_reg+16,38,5,5,-1,96,"^7Number of registered accounts:" ); openPrivButton( "register_counter",$left_right_conf_reg+39,$top_bottom_conf_reg+16,38,5,5,-1,32,"^7" . $register_counter ); openPrivButton( "register_conf_reg_allowed",$left_right_conf_reg+1,$top_bottom_conf_reg+21,38,5,5,-1,96,"^7Registration done by:" ); IF ($register_option == "user") THEN openPrivButton( "register_conf_reg_allowed_user",$left_right_conf_reg+39,$top_bottom_conf_reg+21,19,5,5,-1,32,"^2User" ); openPrivButton( "register_conf_reg_allowed_admin",$left_right_conf_reg+58,$top_bottom_conf_reg+21,19,5,5,-1,32,"^3Admin", config_reg_allowed ); ELSE openPrivButton( "register_conf_reg_allowed_user",$left_right_conf_reg+39,$top_bottom_conf_reg+21,19,5,5,-1,32,"^3User", config_reg_allowed ); openPrivButton( "register_conf_reg_allowed_admin",$left_right_conf_reg+58,$top_bottom_conf_reg+21,19,5,5,-1,32,"^2Admin" ); ENDIF openPrivButton( "register_conf_show_logon",$left_right_conf_reg+1,$top_bottom_conf_reg+26,38,5,5,-1,96,"^7Show logon:" ); IF ($register_show_logon == "yes") THEN openPrivButton( "register_conf_show_logon_yes",$left_right_conf_reg+39,$top_bottom_conf_reg+26,19,5,5,-1,32,"^2Yes" ); openPrivButton( "register_conf_show_logon_no",$left_right_conf_reg+58,$top_bottom_conf_reg+26,19,5,5,-1,32,"^3No", config_show_logon ); ELSE openPrivButton( "register_conf_show_logon_yes",$left_right_conf_reg+39,$top_bottom_conf_reg+26,19,5,5,-1,32,"^3Yes", config_show_logon ); openPrivButton( "register_conf_show_logon_no",$left_right_conf_reg+58,$top_bottom_conf_reg+26,19,5,5,-1,32,"^2No" ); ENDIF openPrivButton( "register_conf_join_check",$left_right_conf_reg+1,$top_bottom_conf_reg+31,38,5,5,-1,96,"^7Extra check on joining track:" ); IF ($register_join_check == "yes") THEN openPrivButton( "register_conf_join_check_yes",$left_right_conf_reg+39,$top_bottom_conf_reg+31,19,5,5,-1,32,"^2Yes" ); openPrivButton( "register_conf_join_check_no",$left_right_conf_reg+58,$top_bottom_conf_reg+31,19,5,5,-1,32,"^3No", config_join_check ); ELSE openPrivButton( "register_conf_join_check_yes",$left_right_conf_reg+39,$top_bottom_conf_reg+31,19,5,5,-1,32,"^3Yes", config_join_check ); openPrivButton( "register_conf_join_check_no",$left_right_conf_reg+58,$top_bottom_conf_reg+31,19,5,5,-1,32,"^2No" ); ENDIF openPrivButton( "register_conf_exclude_admins",$left_right_conf_reg+1,$top_bottom_conf_reg+36,38,5,5,-1,96,"^7Exclude admins from login:" ); IF ($register_exclude_admins == "yes") THEN openPrivButton( "register_conf_exclude_admins_yes",$left_right_conf_reg+39,$top_bottom_conf_reg+36,19,5,5,-1,32,"^2Yes" ); openPrivButton( "register_conf_exclude_admins_no",$left_right_conf_reg+58,$top_bottom_conf_reg+36,19,5,5,-1,32,"^3No", config_exclude_admins ); ELSE openPrivButton( "register_conf_exclude_admins_yes",$left_right_conf_reg+39,$top_bottom_conf_reg+36,19,5,5,-1,32,"^3Yes", config_exclude_admins ); openPrivButton( "register_conf_exclude_admins_no",$left_right_conf_reg+58,$top_bottom_conf_reg+36,19,5,5,-1,32,"^2No" ); ENDIF openPrivButton( "register_conf_store_method",$left_right_conf_reg+1,$top_bottom_conf_reg+41,38,5,5,-1,96,"^7Method to store accounts:" ); IF ($register_store_method == "lfsname") THEN openPrivButton( "register_conf_store_method_lfs",$left_right_conf_reg+39,$top_bottom_conf_reg+41,19,5,5,-1,32,"^2LFSname" ); openPrivButton( "register_conf_store_method_nbr",$left_right_conf_reg+58,$top_bottom_conf_reg+41,19,5,5,-1,32,"^3Number", config_store_method ); ELSE openPrivButton( "register_conf_store_method_lfs",$left_right_conf_reg+39,$top_bottom_conf_reg+41,19,5,5,-1,32,"^3LFSname", config_store_method ); openPrivButton( "register_conf_store_method_nbr",$left_right_conf_reg+58,$top_bottom_conf_reg+41,19,5,5,-1,32,"^2Number" ); ENDIF openPrivButton( "register_conf_allow_duplicates",$left_right_conf_reg+1,$top_bottom_conf_reg+46,38,5,5,-1,96,"^7Allow duplicate accountnames:" ); IF ($register_store_method == "number") THEN IF ($register_allow_duplicates == "yes") THEN openPrivButton( "register_conf_allow_duplicates_yes",$left_right_conf_reg+39,$top_bottom_conf_reg+46,19,5,5,-1,32,"^2Yes" ); openPrivButton( "register_conf_allow_duplicates_no",$left_right_conf_reg+58,$top_bottom_conf_reg+46,19,5,5,-1,32,"^3No", config_allow_duplicates ); ELSE openPrivButton( "register_conf_allow_duplicates_yes",$left_right_conf_reg+39,$top_bottom_conf_reg+46,19,5,5,-1,32,"^3Yes", config_allow_duplicates ); openPrivButton( "register_conf_allow_duplicates_no",$left_right_conf_reg+58,$top_bottom_conf_reg+46,19,5,5,-1,32,"^2No" ); ENDIF ENDIF $top_bottom_conf_reg=141; openPrivButton( "register_conf_save",$left_right_conf_reg+1,$top_bottom_conf_reg,38,5,5,-1,32,"^3Save",register_conf_save ); openPrivButton( "register_conf_close",$left_right_conf_reg+39,$top_bottom_conf_reg,38,5,5,-1,32,"^3Close",register_conf_close ); EndSub Sub config_teamname ( $teamname_1_value,$text ) $register_teamname=$text; Conf_Register( $KeyFlags,$id ); EndSub Sub config_reg_allowed ( $KeyFlags,$id ) IF ( $register_option == "user") THEN $register_option = "admin"; ELSE $register_option = "user"; ENDIF Conf_Register( $KeyFlags,$id ); EndSub Sub config_show_logon ( $KeyFlags,$id ) IF ( $register_show_logon == "yes") THEN $register_show_logon = "no"; ELSE $register_show_logon = "yes"; ENDIF Conf_Register( $KeyFlags,$id ); EndSub Sub config_join_check ( $KeyFlags,$id ) IF ( $register_join_check == "yes") THEN $register_join_check = "no"; ELSE $register_join_check = "yes"; ENDIF Conf_Register( $KeyFlags,$id ); EndSub Sub config_exclude_admins ( $KeyFlags,$id ) IF ( $register_exclude_admins == "yes") THEN $register_exclude_admins = "no"; ELSE $register_exclude_admins = "yes"; ENDIF Conf_Register( $KeyFlags,$id ); EndSub Sub config_store_method ( $KeyFlags,$id ) IF ( $register_store_method == "lfsname") THEN $register_store_method = "number"; ELSE $register_store_method = "lfsname"; $register_allow_duplicates = "no"; closePrivButton("register_conf_allow_duplicates_yes"); closePrivButton("register_conf_allow_duplicates_no"); ENDIF Conf_Register( $KeyFlags,$id ); EndSub Sub config_allow_duplicates ( $KeyFlags,$id ) IF ( $register_allow_duplicates == "yes") THEN $register_allow_duplicates = "no"; ELSE $register_allow_duplicates = "yes"; ENDIF Conf_Register( $KeyFlags,$id ); EndSub Sub Manage_registrations( $KeyFlags,$id ) IF ( $register_store_method == "number" ) THEN FOR ($i=0;$i<$register_counter;$i=$i+1) $username_array[1,$i] = GetStoredValue( "logon_username_" . $i ); $logon_code_array[1,$i] = GetStoredValue( "logon_code_" . $i ); $logon_password_array[1,$i] = GetStoredValue( "logon_password_" . $i ); ENDFOR ENDIF IF ( $rows_displayed == 0 ) THEN ### Set left/right and top/bottom coordinates ### $left_right_conf_reg=51; $top_bottom_conf_reg=80; ### End ### openPrivButton( "manage_regs_bg",$left_right_conf_reg,$top_bottom_conf_reg,97,67,5,-1,16,"" ); openPrivButton( "manage_regs_title",$left_right_conf_reg+1,$top_bottom_conf_reg+1,95,5,5,-1,32,"^7Manage registered accounts " ); openPrivButton( "manage_regs_subtitle_1",$left_right_conf_reg+1,$top_bottom_conf_reg+11,28,5,5,-1,96,"^2LFSusername:" ); openPrivButton( "manage_regs_subtitle_2",$left_right_conf_reg+29,$top_bottom_conf_reg+11,28,5,5,-1,96,"^2Account:" ); openPrivButton( "manage_regs_subtitle_3",$left_right_conf_reg+57,$top_bottom_conf_reg+11,28,5,5,-1,96,"^2Password:" ); openPrivButton( "manage_regs_subtitle_4",$left_right_conf_reg+85,$top_bottom_conf_reg+11,11,5,5,-1,96,"^2Edit:" ); ENDIF $top_bottom_conf_reg=96; FOR ($i=$total_rows_displayed;$i<$register_counter;$i=$i+1) IF ( $rows_displayed < 9 ) THEN openPrivButton( "manage_regs_account_".$i,$left_right_conf_reg+1,$top_bottom_conf_reg,28,5,5,-1,96,"^7" . $username_array[1,$i] ); openPrivButton( "manage_regs_logon_code_".$i,$left_right_conf_reg+29,$top_bottom_conf_reg,28,5,5,-1,96,"^7" . $logon_code_array[1,$i] ); openPrivButton( "manage_regs_logon_password_".$i,$left_right_conf_reg+57,$top_bottom_conf_reg,28,5,5,-1,96,"^7" . $logon_password_array[1,$i] ); openPrivButton( "manage_regs_edit_".$i,$left_right_conf_reg+85,$top_bottom_conf_reg,11,5,5,-1,96,"^3Edit", Man_reg_edit ); $top_bottom_conf_reg=$top_bottom_conf_reg+5; $rows_displayed=$rows_displayed+1; $total_rows_displayed=$total_rows_displayed+1; ELSE openPrivButton( "manage_regs_next",$left_right_conf_reg+1,141,95,5,5,-1,32,"^3Next", Man_reg_next ); ENDIF IF ( $total_rows_displayed == $register_counter ) THEN openPrivButton( "manage_regs_close",$left_right_conf_reg+1,141,95,5,5,-1,32,"^3Close", Man_reg_close ); ENDIF ENDFOR EndSub Sub Man_reg_edit ( $KeyFlags,$id ) IF ( GetCurrentPlayerVar( "account_edit" ) != "progress" ) Then $lfs_username=GetStoredValue( "logon_username_" . subStr( $id, 17, 6 ) ); $login_name=GetStoredValue( "logon_code_" . subStr( $id, 17, 6 ) ); $password=GetStoredValue( "logon_password_" . subStr( $id, 17, 6 ) ); $account_id=subStr( $id, 17, 6 ); Man_reg_close( $KeyFlags,$id ); ENDIF ### Set left/right and top/bottom coordinates ### $left_right_welcome=64; $top_bottom_welcome=80; ### End ### openPrivButton( "register_bg",$left_right_welcome,$top_bottom_welcome,72,67,5,-1,16,"" ); openPrivButton( "register_title",$left_right_welcome+1,$top_bottom_welcome+1,70,5,5,-1,32,"^7Admin registration form" ); openPrivButton( "warning",$left_right_welcome+1,$top_bottom_welcome+11,70,5,5,-1,96," ^1!!! WARNING ^7- ^1WARNING ^7- ^1WARNING ^7- ^1WARNING !!! " . "%nl%^7 " . "%nl%^7- Password is send and stored in plain text" . "%nl%^7- ^1DON'T^7 use a password used regularly somewhere else"); openPrivButton( "register_1a",$left_right_welcome+1,$top_bottom_welcome+36,35,5,5,-1,32,"^7LFS username: " ); openPrivTextButton( "register_1b",$left_right_welcome+36,$top_bottom_welcome+36,35,5,5,32,"^3LFS username","^3".$lfs_username,40,update_lfs_username ); openPrivButton( "register_2a",$left_right_welcome+1,$top_bottom_welcome+41,35,5,5,-1,32,"^7Login name: " ); IF ( $login_name == "" ) THEN openPrivTextButton( "register_2b",$left_right_welcome+36,$top_bottom_welcome+41,35,5,5,32,"^3Login name","^3Click to enter",40,update_loginname ); ELSE openPrivTextButton( "register_2b",$left_right_welcome+36,$top_bottom_welcome+41,35,5,5,32,"^3Login name","^3".$login_name,40,update_loginname ); ENDIF openPrivButton( "register_3a",$left_right_welcome+1,$top_bottom_welcome+46,35,5,5,-1,32,"^7Password: " ); IF ( $password == "" ) THEN openPrivTextButton( "register_3b",$left_right_welcome+36,$top_bottom_welcome+46,35,5,5,32,"^3Password","^3Click to enter",40,update_password ); ELSE openPrivTextButton( "register_3b",$left_right_welcome+36,$top_bottom_welcome+46,35,5,5,32,"^3Password","^3".$password,40,update_password ); ENDIF openPrivButton( "registration_check",$left_right_welcome+1,$top_bottom_welcome+61,35,5,5,-1,32,"^3Update account",Update_account ); openPrivButton( "close_admin_reg",$left_right_welcome+36,$top_bottom_welcome+61,35,5,5,-1,32,"^3Close",close_admin_reg ); EndSub Sub Man_reg_next ( $KeyFlags,$id ) FOR ($i=0;$i<$total_rows_displayed;$i=$i+1) closePrivButton( "manage_regs_account_".$i ); closePrivButton( "manage_regs_logon_code_".$i ); closePrivButton( "manage_regs_logon_password_".$i ); closePrivButton( "manage_regs_edit_".$i ); ENDFOR closePrivButton( "manage_regs_next" ); $rows_displayed=0; Manage_registrations( $KeyFlags,$id ); EndSub Sub update_lfs_username ( $lfs_username_value,$text ) ### Collect kfs username which has been entered in registration screen ### $lfs_username=$text; ### End ### SetCurrentPlayerVar( "account_edit","progress" ); Man_reg_edit( $KeyFlags,$id ); EndSub Sub update_loginname ( $loginname_value,$text ) ### Collect login name which has been entered in registration screen ### $login_name=$text; ### End ### SetCurrentPlayerVar( "account_edit","progress" ); Man_reg_edit( $KeyFlags,$id ); EndSub Sub update_password ( $password_value,$text ) ### Collect password which has been entered in registration screen ### $password=$text; ### End ### SetCurrentPlayerVar( "account_edit","progress" ); Man_reg_edit( $KeyFlags,$id ); EndSub Sub Man_reg_close ( $KeyFlags,$id ) closePrivButton( "manage_regs_bg" ); closePrivButton( "manage_regs_title" ); closePrivButton( "manage_regs_subtitle_1" ); closePrivButton( "manage_regs_subtitle_2" ); closePrivButton( "manage_regs_subtitle_3" ); closePrivButton( "manage_regs_subtitle_4" ); FOR ($i=0;$i<$total_rows_displayed;$i=$i+1) closePrivButton( "manage_regs_account_".$i ); closePrivButton( "manage_regs_logon_code_".$i ); closePrivButton( "manage_regs_logon_password_".$i ); closePrivButton( "manage_regs_edit_".$i ); ENDFOR closePrivButton( "manage_regs_next" ); closePrivButton( "manage_regs_close" ); $rows_displayed=0; $total_rows_displayed=0; EndSub Sub register_conf_save ( $KeyFlags,$id ) SetStoredValue( "REGISTER_TEAMNAME", $register_teamname ); SetStoredValue( "REGISTER_OPTION", $register_option ); SetStoredValue( "REGISTER_SHOW_LOGON", $register_show_logon ); SetStoredValue( "REGISTER_JOIN_CHECK", $register_join_check ); SetStoredValue( "REGISTER_EXCLUDE_ADMINS", $register_exclude_admins ); SetStoredValue( "REGISTER_STORE_METHOD", $register_store_method ); SetStoredValue( "REGISTER_ALLOW_DUPLICATES", $register_allow_duplicates ); privMsg ("^7Settings have been saved" ); EndSub Sub Update_account ( $KeyFlags,$id ) SetStoredValue( "logon_username_" . $account_id, $lfs_username ); SetStoredValue( "logon_code_" . $account_id, $login_name ); SetStoredValue( "logon_password_" . $account_id, $password ); closePrivButton("register_bg®ister_title&warning®ister_1a®ister_1b®ister_2a®ister_2b®ister_3a®ister_3b®istration_check&close_admin_reg"); $lfs_username=""; $login_name=""; $password=""; $account_id=""; SetCurrentPlayerVar( "account_edit","" ); PrivMsg ("^7Update account by admin okay"); EndSub Sub register_conf_close ( $KeyFlags,$id ) closePrivButton("register_conf_bg"); closePrivButton("register_conf_title"); closePrivButton("register_conf_teamname_1"); closePrivButton("register_conf_teamname_2"); closePrivButton("register_conf_reg_allowed"); closePrivButton("register_conf_reg_allowed_user"); closePrivButton("register_conf_reg_allowed_admin"); closePrivButton("register_conf_show_logon"); closePrivButton("register_conf_show_logon_yes"); closePrivButton("register_conf_show_logon_no"); closePrivButton("register_conf_join_check"); closePrivButton("register_conf_join_check_yes"); closePrivButton("register_conf_join_check_no"); closePrivButton("register_conf_exclude_admins"); closePrivButton("register_conf_exclude_admins_yes"); closePrivButton("register_conf_exclude_admins_no"); closePrivButton("register_counter_title"); closePrivButton("register_conf_store_method"); closePrivButton("register_conf_store_method_lfs"); closePrivButton("register_conf_store_method_nbr"); closePrivButton("register_conf_allow_duplicates"); closePrivButton("register_conf_allow_duplicates_yes"); closePrivButton("register_conf_allow_duplicates_no"); closePrivButton("register_counter"); closePrivButton("register_conf_save"); closePrivButton("register_conf_close"); EndSub