# Handicap system V1.01 03-06-11 -Initial release # # Handicap system V1.02 07-06-11 -Added button to clear the whole form # # Handicap system V1.03 07-06-11 -Given car names are checked if they exist # # -Mass values can't be added when no car is selected # # -Given mass value can't be higher then the maximum of the selected car # # -When car name is changed, values for mass are reset # # Handicap system V1.04 07-06-11 -Added 2 buttons to set all values for mass / intake to zero # # Handicap system V1.05 18-06-11 -Added button to Force handicap(s) # # (Handicap settings of each connected player will be checked # # and if not matching handicap settings, player will be spectated) # # -Expanded the number of classes from 4 to 5 # # -Expanded the numer of cars from 3 to 4 # # -Fixed a bug in Set all mass to zero function # # Handicap system V1.07 20-06-11 -Fixed a bug in the class checking routine # # Handicap system V1.08 03-07-11 -Fixed a bug in the force handicap subroutine # # -Added the option to save values (HCS_[servername]) # # -Added the option to load saved values # # Handicap system V1.09 26-03-13 -Removed all code related to using $user_array # # Handicap system V1.10 24-04-13 -Added StripLFSColor to the playername check routine # # 24-04-13 -Added option to set a manual class indicator # # Handicap system V1.11 21-01-15 -Auto load handicaps on Lapper start (matched to race using Race ID) # # Handicap system V1.12 24-01-15 -Added option to set handicaps for 3 subclasses # # Handicap system V1.12b 25-01-15 -Clear button wasn't clearing restr. class 4 when subclasses was used # # -Classes were also checked when having set subclasses # # -Mass and intake values weren't always converted to numbers # # -Force handicap(s) button wasn't checking subclasses if they were used # # Handicap system V1.12c 26-01-15 -Fixed isue in "OnNewPlayerJoin_Handicap" that cause Lapper to crash # # Handicap system V1.12d 27-01-15 -Re-write of code to detect color in case of subclasses been used # # Handicap system V1.12e 08-03-15 -Fixed two bugs that checked for the wrong value for subclass # # Handicap system V1.13 24-02-17 -Added checks for every P_Tres to see if variable is number # # -Added checks for every P_Mass to see if variable is number # # Handicap system V1.14 08-08-17 -Added checks on saving HCS and set values to 0 if needed # ######################################################################################################################### CatchEvent OnLapperStart() OnLapperStart_Handicap(); EndCatchEvent CatchEvent OnConnect( $userName ) OnConnect_Handicap(); EndCatchEvent CatchEvent OnNewPlayerJoin( $userName ) OnNewPlayerJoin_Handicap(); EndCatchEvent 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 "!hcs": Handicap( $KeyFlags ); BREAK; ENDSWITCH EndCatchEvent Sub OnLapperStart_Handicap() ### Admin GUI Handicap system #### GlobalVar $server_name; GlobalVar $class_indicator; GlobalVar $number_of_classes; GlobalVar $use_subclasses; GlobalVar $number_of_cars; GlobalVar $race_id_handicaps; GlobalVar $car_1; GlobalVar $car_2; GlobalVar $car_3; GlobalVar $car_4; GlobalVar $mass_1_1; GlobalVar $mass_1_2; GlobalVar $mass_1_3; GlobalVar $mass_1_4; GlobalVar $mass_1_5; GlobalVar $mass_2_1; GlobalVar $mass_2_2; GlobalVar $mass_2_3; GlobalVar $mass_2_4; GlobalVar $mass_2_5; GlobalVar $mass_3_1; GlobalVar $mass_3_2; GlobalVar $mass_3_3; GlobalVar $mass_3_4; GlobalVar $mass_3_5; GlobalVar $mass_4_1; GlobalVar $mass_4_2; GlobalVar $mass_4_3; GlobalVar $mass_4_4; GlobalVar $mass_4_5; GlobalVar $intake_1_1; GlobalVar $intake_1_2; GlobalVar $intake_1_3; GlobalVar $intake_1_4; GlobalVar $intake_1_5; GlobalVar $intake_2_1; GlobalVar $intake_2_2; GlobalVar $intake_2_3; GlobalVar $intake_2_4; GlobalVar $intake_2_5; GlobalVar $intake_3_1; GlobalVar $intake_3_2; GlobalVar $intake_3_3; GlobalVar $intake_3_4; GlobalVar $intake_3_5; GlobalVar $intake_4_1; GlobalVar $intake_4_2; GlobalVar $intake_4_3; GlobalVar $intake_4_4; GlobalVar $intake_4_5; $server_name = ""; $class_indicator = "^s"; # ^s is the code to simulate a / $number_of_classes = ""; $use_subclasses = "no"; $number_of_cars = ""; $race_id_handicaps = ""; $car_1 = ""; $car_2 = ""; $car_3 = ""; $car_4 = ""; $mass_1_1 = ""; $mass_1_2 = ""; $mass_1_3 = ""; $mass_1_4 = ""; $mass_1_5 = ""; $mass_2_1 = ""; $mass_2_2 = ""; $mass_2_3 = ""; $mass_2_4 = ""; $mass_2_5 = ""; $mass_3_1 = ""; $mass_3_2 = ""; $mass_3_3 = ""; $mass_3_4 = ""; $mass_3_5 = ""; $mass_4_1 = ""; $mass_4_2 = ""; $mass_4_3 = ""; $mass_4_4 = ""; $mass_4_5 = ""; $intake_1_1 = ""; $intake_1_2 = ""; $intake_1_3 = ""; $intake_1_4 = ""; $intake_1_5 = ""; $intake_2_1 = ""; $intake_2_2 = ""; $intake_2_3 = ""; $intake_2_4 = ""; $intake_2_5 = ""; $intake_3_1 = ""; $intake_3_2 = ""; $intake_3_3 = ""; $intake_3_4 = ""; $intake_3_5 = ""; $intake_4_1 = ""; $intake_4_2 = ""; $intake_4_3 = ""; $intake_4_4 = ""; $intake_4_5 = ""; ### End ### ### Declare arrays with carnames and their maximum added weight ### GlobalVar $car_names; GlobalVar $car_weight; $car_names[1,1] = "UF1"; $car_names[1,2] = "XFG"; $car_names[1,3] = "XRG"; $car_names[1,4] = "LX4"; $car_names[1,5] = "LX6"; $car_names[1,6] = "RB4"; $car_names[1,7] = "FXO"; $car_names[1,8] = "XRT"; $car_names[1,9] = "RAC"; $car_names[1,10] = "FZ5"; $car_names[1,11] = "UFR"; $car_names[1,12] = "XFR"; $car_names[1,13] = "FXR"; $car_names[1,14] = "XRR"; $car_names[1,15] = "FZR"; $car_names[1,16] = "MRT"; $car_names[1,17] = "FBM"; $car_names[1,18] = "FOX"; $car_names[1,19] = "FO8"; $car_names[1,20] = "BF1"; $car_weight[1,1] = 120; $car_weight[1,2] = 190; $car_weight[1,3] = 200; $car_weight[1,4] = 100; $car_weight[1,5] = 110; $car_weight[1,6] = 200; $car_weight[1,7] = 200; $car_weight[1,8] = 200; $car_weight[1,9] = 160; $car_weight[1,10] = 200; $car_weight[1,11] = 120; $car_weight[1,12] = 170; $car_weight[1,13] = 200; $car_weight[1,14] = 200; $car_weight[1,15] = 200; $car_weight[1,16] = 40; $car_weight[1,17] = 90; $car_weight[1,18] = 100; $car_weight[1,19] = 120; $car_weight[1,20] = 110; ### END ### EndSub Sub OnConnect_Handicap() # Player event $pl_name = StripLFSColor( GetCurrentPlayerVar( "NickName" ) ); $pl_name_b = GetCurrentPlayerVar( "NickName" ); $name_length = strlen( $pl_name ); $name_length_b = strlen( $pl_name_b ); $class_string = $name_length-1; $class_string_b = $name_length-3; FOR ($i=0;$i<$name_length_b;$i=$i+1) $j=$i+1; $char_1 = subStr( $pl_name_b, $i, 1 ); $char_2 = subStr( $pl_name_b, $j, 1 ); IF ( $char_1 == "^" && $char_2 == 0 ) THEN $color_to_indicate_subclass="black"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 1 ) THEN $color_to_indicate_subclass="red"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 2 ) THEN $color_to_indicate_subclass="green"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 3 ) THEN $colour_to_indicate_subclass="yellow"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 4 ) THEN $color_to_indicate_subclass="blue"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 5 ) THEN $color_to_indicate_subclass="violet"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 6 ) THEN $color_to_indicate_subclass="cyan"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 7 ) THEN $color_to_indicate_subclass="white"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 9 ) THEN $color_to_indicate_subclass="no_color"; $i=$i+1; ENDIF ENDFOR IF ( $color_to_indicate_subclass != "red" ) THEN IF ( $color_to_indicate_subclass != "blue" ) THEN IF ($color_to_indicate_subclass != "green" ) THEN $color_to_indicate_subclass = "FALSE"; ENDIF ENDIF ENDIF IF ($class_string > 0) THEN $class = $class_indicator . subStr( $pl_name, $class_string ); $class_ind_player = subStr( $pl_name, $class_string_b,2 ); #Put class & class indicator found in playername into a current player var #Putting it into the $user_array isn't working since OnConnect and OnNewPlayerJoin are run simultaneously #Saving it as a uservar and then reading it back in the OnNewPlayerJoin event, isn't working either because of the same reason SetCurrentPlayerVar ( "class_player", $class ); SetCurrentPlayerVar ( "class_indicator_player", $class_ind_player ); SetCurrentPlayerVar ( "color_to_indicate_subclass", $color_to_indicate_subclass ); ENDIF EndSub Sub OnNewPlayerJoin_Handicap() # Check class indicator in playername again, in case player changed name during his stay on the server # This is not put in CatchEvent OnNameChange($userName,$oldNickName,$newNickName) because you can't spectate someone in that event # Which means people can still join the track with a wrong nickname $pl_name = StripLFSColor( GetCurrentPlayerVar( "NickName" ) ); $pl_name_b = GetCurrentPlayerVar( "NickName" ); $name_length = strlen( $pl_name ); $name_length_b = strlen( $pl_name_b ); $class_string = $name_length-1; $class_string_b = $name_length-3; FOR ($i=0;$i<$name_length_b;$i=$i+1) $j=$i+1; $char_1 = subStr( $pl_name_b, $i, 1 ); $char_2 = subStr( $pl_name_b, $j, 1 ); IF ( $char_1 == "^" && $char_2 == 0 ) THEN $color_to_indicate_subclass="black"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 1 ) THEN $color_to_indicate_subclass="red"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 2 ) THEN $color_to_indicate_subclass="green"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 3 ) THEN $colour_to_indicate_subclass="yellow"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 4 ) THEN $color_to_indicate_subclass="blue"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 5 ) THEN $color_to_indicate_subclass="violet"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 6 ) THEN $color_to_indicate_subclass="cyan"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 7 ) THEN $color_to_indicate_subclass="white"; $i=$i+1; ENDIF IF ( $char_1 == "^" && $char_2 == 9 ) THEN $color_to_indicate_subclass="no_color"; $i=$i+1; ENDIF ENDFOR IF ( $color_to_indicate_subclass != "red" ) THEN IF ( $color_to_indicate_subclass != "blue" ) THEN IF ($color_to_indicate_subclass != "green" ) THEN $color_to_indicate_subclass = "FALSE"; ENDIF ENDIF ENDIF IF ($class_string > 0) THEN $class = $class_indicator . subStr( $pl_name, $class_string ); $class_ind_player = subStr( $pl_name, $class_string_b,2 ); SetCurrentPlayerVar ( "class_player", $class ); SetCurrentPlayerVar ( "class_indicator_player", $class_ind_player ); SetCurrentPlayerVar ( "color_to_indicate_subclass", $color_to_indicate_subclass ); ENDIF IF (GetCurrentPlayerVar( "class_indicator_player" ) != $class_indicator) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1You haven't set your class and will..." ); PrivMsg ("^1...therefor not be able to race here" ); PrivMsg ("^3Put ".$class_indicator."1 , ".$class_indicator."2 , ".$class_indicator."3 , ".$class_indicator."4 , ".$class_indicator."5 behind your nickname" ); ENDIF IF ($use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "FALSE") THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1You haven't set a correct subclass color and..." ); PrivMsg ("^1...will therefor not be able to race here" ); PrivMsg ("^3Put your class either in red, blue or green" ); ENDIF ### Check restrictions when subclasses are set to 'yes' AND car_1 is used ### IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "red" && GetCurrentPlayerVar("Car") == $car_1 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set intake restriction to " . $intake_1_1 . "% for " . $car_1 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set added mass to " . $mass_1_1 . "kg for " . $car_1 ); ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "blue" && GetCurrentPlayerVar("Car") == $car_1 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set intake restriction to " . $intake_1_2 . "% for " . $car_1 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set added mass to " . $mass_1_2 . "kg for " . $car_1 ); ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "green" && GetCurrentPlayerVar("Car") == $car_1 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set intake restriction to " . $intake_1_3 . "% for " . $car_1 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set added mass to " . $mass_1_3 . "kg for " . $car_1 ); ENDIF ENDIF ENDIF ### End ### IF ($use_subclasses == "no" && $class == $class_indicator."1" && GetCurrentPlayerVar("Car") == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set intake restriction to " . $intake_1_1 . "% for " . $car_1 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set added mass to " . $mass_1_1 . "kg for " . $car_1 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."2" && GetCurrentPlayerVar("Car") == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set intake restriction to " . $intake_1_2 . "% for " . $car_1 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set added mass to " . $mass_1_2 . "kg for " . $car_1 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."3" && GetCurrentPlayerVar("Car") == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set intake restriction to " . $intake_1_3 . "% for " . $car_1 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set added mass to " . $mass_1_3 . "kg for " . $car_1 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."4" && GetCurrentPlayerVar("Car") == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set intake restriction to " . $intake_1_4 . "% for " . $car_1 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set added mass to " . $mass_1_4 . "kg for " . $car_1 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."5" && GetCurrentPlayerVar("Car") == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set intake restriction to " . $intake_1_5 . "% for " . $car_1 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set added mass to " . $mass_1_5 . "kg for " . $car_1 ); ENDIF ENDIF ENDIF ### Check restrictions when subclasses are set to 'yes' AND car_2 is used ### IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "red" && GetCurrentPlayerVar("Car") == $car_2 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set intake restriction to " . $intake_2_1 . "% for " . $car_2 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set added mass to " . $mass_2_1 . "kg for " . $car_2 ); ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "blue" && GetCurrentPlayerVar("Car") == $car_2 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set intake restriction to " . $intake_2_2 . "% for " . $car_2 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set added mass to " . $mass_2_2 . "kg for " . $car_2 ); ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "green" && GetCurrentPlayerVar("Car") == $car_2 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set intake restriction to " . $intake_2_3 . "% for " . $car_2 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set added mass to " . $mass_2_3 . "kg for " . $car_2 ); ENDIF ENDIF ENDIF ### End ### IF ($use_subclasses == "no" && $class == $class_indicator."1" && GetCurrentPlayerVar("Car") == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set intake restriction to " . $intake_2_1 . "% for " . $car_2 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set added mass to " . $mass_2_1 . "kg for " . $car_2 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."2" && GetCurrentPlayerVar("Car") == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set intake restriction to " . $intake_2_2 . "% for " . $car_2 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set added mass to " . $mass_2_2 . "kg for " . $car_2 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."3" && GetCurrentPlayerVar("Car") == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set intake restriction to " . $intake_2_3 . "% for " . $car_2 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set added mass to " . $mass_2_3 . "kg for " . $car_2 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."4" && GetCurrentPlayerVar("Car") == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set intake restriction to " . $intake_2_4 . "% for " . $car_2 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set added mass to " . $mass_2_4 . "kg for " . $car_2 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."5" && GetCurrentPlayerVar("Car") == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set intake restriction to " . $intake_2_5 . "% for " . $car_2 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set added mass to " . $mass_2_5 . "kg for " . $car_2 ); ENDIF ENDIF ENDIF ### Check restrictions when subclasses are set to 'yes' AND car_3 is used ### IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "red" && GetCurrentPlayerVar("Car") == $car_3 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set intake restriction to " . $intake_3_1 . "% for " . $car_3 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set added mass to " . $mass_3_1 . "kg for " . $car_3 ); ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "blue" && GetCurrentPlayerVar("Car") == $car_3 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set intake restriction to " . $intake_3_2 . "% for " . $car_3 ); ENDIF ENDIF IF ( ToNum((GetCurrentPlayerVar("P_Mass") < $mass_3_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set added mass to " . $mass_3_2 . "kg for " . $car_3 ); ENDIF ENDIF IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "green" && GetCurrentPlayerVar("Car") == $car_3 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set intake restriction to " . $intake_3_3 . "% for " . $car_3 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set added mass to " . $mass_3_3 . "kg for " . $car_3 ); ENDIF ENDIF ENDIF ### End ### IF ($use_subclasses == "no" && $class == $class_indicator."1" && GetCurrentPlayerVar("Car") == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set intake restriction to " . $intake_3_1 . "% for " . $car_3 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set added mass to " . $mass_3_1 . "kg for " . $car_3 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."2" && GetCurrentPlayerVar("Car") == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set intake restriction to " . $intake_3_2 . "% for " . $car_3 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set added mass to " . $mass_3_2 . "kg for " . $car_3 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."3" && GetCurrentPlayerVar("Car") == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set intake restriction to " . $intake_3_3 . "% for " . $car_3 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set added mass to " . $mass_3_3 . "kg for " . $car_3 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."4" && GetCurrentPlayerVar("Car") == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set intake restriction to " . $intake_3_4 . "% for " . $car_3 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set added mass to " . $mass_3_4 . "kg for " . $car_3 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."5" && GetCurrentPlayerVar("Car") == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set intake restriction to " . $intake_3_5 . "% for " . $car_3 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set added mass to " . $mass_3_5 . "kg for " . $car_3 ); ENDIF ENDIF ENDIF ### Check restrictions when subclasses are set to 'yes' AND car_4 is used ### IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "red" && GetCurrentPlayerVar("Car") == $car_4 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set intake restriction to " . $intake_4_1 . "% for " . $car_4 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set added mass to " . $mass_4_1 . "kg for " . $car_4 ); ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "blue" && GetCurrentPlayerVar("Car") == $car_4 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set intake restriction to " . $intake_4_2 . "% for " . $car_4 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set added mass to " . $mass_4_2 . "kg for " . $car_4 ); ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetCurrentPlayerVar( "color_to_indicate_subclass" ) == "green" && GetCurrentPlayerVar("Car") == $car_4 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set intake restriction to " . $intake_4_3 . "% for " . $car_4 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set added mass to " . $mass_4_3 . "kg for " . $car_4 ); ENDIF ENDIF ENDIF ### End ### IF ($use_subclasses == "no" && $class == $class_indicator."1" && GetCurrentPlayerVar("Car") == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set intake restriction to " . $intake_4_1 . "% for " . $car_4 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set added mass to " . $mass_4_1 . "kg for " . $car_4 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."2" && GetCurrentPlayerVar("Car") == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set intake restriction to " . $intake_4_2 . "% for " . $car_4 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set added mass to " . $mass_4_2 . "kg for " . $car_4 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."3" && GetCurrentPlayerVar("Car") == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set intake restriction to " . $intake_4_3 . "% for " . $car_4 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set added mass to " . $mass_4_3 . "kg for " . $car_4 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."4" && GetCurrentPlayerVar("Car") == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set intake restriction to " . $intake_4_4 . "% for " . $car_4 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set added mass to " . $mass_4_4 . "kg for " . $car_4 ); ENDIF ENDIF ENDIF IF ($use_subclasses == "no" && $class == $class_indicator."5" && GetCurrentPlayerVar("Car") == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set intake restriction to " . $intake_4_5 . "% for " . $car_4 ); ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set added mass to " . $mass_4_5 . "kg for " . $car_4 ); ENDIF ENDIF ENDIF EndSub Sub Handicap ( $KeyFlags ) $server_name = getLapperVar( "HostName" ); ### Set initial values for left/right and top/bottom coordinates ### $left_right_handicap = 1; $top_bottom_handicap = 30; ### End ### openPrivButton( "handicap_gui_bg",$left_right_handicap,$top_bottom_handicap,142,152,5,-1,16,""); openPrivButton( "handicap_title",$left_right_handicap+1,$top_bottom_handicap+1,70,5,5,-1,32,"^7Handicap system V1.14" ); openPrivButton( "handicap_server_name",$left_right_handicap+71,$top_bottom_handicap+1,70,5,5,-1,32,"^7Server name: " . $server_name ); openPrivButton( "handicap_class_indicator",$left_right_handicap+1,$top_bottom_handicap+11,30,5,5,-1,96,"^7Class indicator: " ); #openPrivButton( "handicap_class_indicator_input",$left_right_handicap+31,$top_bottom_handicap+11,40,5,5,-1,32,"^7" . $class_indicator ); IF ( $class_indicator == "^s") #simulate: / THEN openPrivButton( "handicap_class_indicator_input_1",$left_right_handicap+31,$top_bottom_handicap+11,10,5,5,-1,32,"^2".$class_indicator,config_class_indicator_fws ); ELSE openPrivButton( "handicap_class_indicator_input_1",$left_right_handicap+31,$top_bottom_handicap+11,10,5,5,-1,32,"^3/",config_class_indicator_fws ); ENDIF IF ( $class_indicator == "^v") #simulate: | THEN openPrivButton( "handicap_class_indicator_input_2",$left_right_handicap+41,$top_bottom_handicap+11,10,5,5,-1,32,"^2".$class_indicator,config_class_indicator_pipe ); ELSE openPrivButton( "handicap_class_indicator_input_2",$left_right_handicap+41,$top_bottom_handicap+11,10,5,5,-1,32,"^3|",config_class_indicator_pipe ); ENDIF IF ( $class_indicator != "^s" && $class_indicator != "^v" && $class_indicator != "" ) THEN openPrivTextButton( "handicap_class_indicator_input_3",$left_right_handicap+51,$top_bottom_handicap+11,20,5,5,32,"^2Class indicator","^2".$class_indicator,3,config_class_indicator ); ELSE openPrivTextButton( "handicap_class_indicator_input_3",$left_right_handicap+51,$top_bottom_handicap+11,20,5,5,32,"^3Class indicator","^3Click to set",3,config_class_indicator ); ENDIF openPrivButton( "handicap_use_subclasses",$left_right_handicap+1,$top_bottom_handicap+16,30,5,5,-1,96,"^7Use subclasses: " ); IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_use_subclasses_no",$left_right_handicap+31,$top_bottom_handicap+16,20,5,5,-1,32,"^2[^3No^2]" ); openPrivButton( "handicap_use_subclasses_yes",$left_right_handicap+51,$top_bottom_handicap+16,20,5,5,-1,32,"^3Yes",set_subclass ); ELSE openPrivButton( "handicap_use_subclasses_no",$left_right_handicap+31,$top_bottom_handicap+16,20,5,5,-1,32,"^3No",set_subclass ); openPrivButton( "handicap_use_subclasses_yes",$left_right_handicap+51,$top_bottom_handicap+16,20,5,5,-1,32,"^2[^3Yes^2]" ); ENDIF IF ( $use_subclasses != "yes" ) THEN openPrivButton( "handicap_number_of_classes",$left_right_handicap+1,$top_bottom_handicap+21,30,5,5,-1,96,"^7Number of classes: " ); IF ( $number_of_classes == "" ) THEN openPrivTextButton( "handicap_number_of_classes_input",$left_right_handicap+31,$top_bottom_handicap+21,40,5,5,32,"^3Number of classes (max 5)","^3Click to set",1,config_number_of_classes ); ELSE openPrivTextButton( "handicap_number_of_classes_input",$left_right_handicap+31,$top_bottom_handicap+21,40,5,5,32,"^3Number of classes (max 5)","^3".$number_of_classes,1,config_number_of_classes ); ENDIF ENDIF openPrivButton( "handicap_number_of_cars",$left_right_handicap+1,$top_bottom_handicap+26,30,5,5,-1,96,"^7Number of cars: " ); openPrivButton( "handicap_race_id",$left_right_handicap+1,$top_bottom_handicap+31,30,5,5,-1,96,"^7Race ID: " ); IF ( $race_id_handicaps == "") THEN openPrivTextButton( "handicap_race_id_input",$left_right_handicap+31,$top_bottom_handicap+31,40,5,5,32,"^3Race ID to use handicaps for","^3Click to set",5,config_handicap_race_id ); ELSE openPrivTextButton( "handicap_race_id_input",$left_right_handicap+31,$top_bottom_handicap+31,40,5,5,32,"^3Race ID to use handicaps for","^3".$race_id_handicaps,5,config_handicap_race_id ); ENDIF openPrivButton( "handicap_mass_title",$left_right_handicap+101,$top_bottom_handicap+26,20,5,5,-1,32,"^7Mass (kg)" ); IF ($number_of_classes != "" && $number_of_cars != "") THEN openPrivButton( "handicap_mass_zero",$left_right_handicap+101,$top_bottom_handicap+31,20,5,5,-1,32,"^3Set all to 0",mass_all_to_zero ); ENDIF openPrivButton( "handicap_intake_title",$left_right_handicap+121,$top_bottom_handicap+26,20,5,5,-1,32,"^7Intake (%)" ); IF ($number_of_classes != "" && $number_of_cars != "") THEN openPrivButton( "handicap_intake_zero",$left_right_handicap+121,$top_bottom_handicap+31,20,5,5,-1,32,"^3Set all to 0",intake_all_to_zero ); ENDIF IF ( $number_of_cars == "") THEN openPrivTextButton( "handicap_number_of_cars_input",$left_right_handicap+31,$top_bottom_handicap+26,40,5,5,32,"^3Number of cars (max 4)","^3Click to set",1,config_number_of_cars ); ELSE openPrivTextButton( "handicap_number_of_cars_input",$left_right_handicap+31,$top_bottom_handicap+26,40,5,5,32,"^3Number of cars (max 4)","^3".$number_of_cars,1,config_number_of_cars ); $top_offset=36; $top_offset_2=36; FOR ($i=1;$i<=$number_of_cars;$i=$i+1) $config_name="config_car_" . $i; openPrivButton( "handicap_car_" . $i,$left_right_handicap+1,$top_bottom_handicap+$top_offset,30,5,5,-1,96,"^7Car " . $i . ": " ); IF ($i == 1) THEN IF ($car_1 == "") THEN openPrivTextButton( "handicap_input_car_" . $i,$left_right_handicap+31,$top_bottom_handicap+$top_offset,40,5,5,32,"^3Short name of car " . $i,"^3Click to set",3,$config_name ); ELSE openPrivTextButton( "handicap_input_car_" . $i,$left_right_handicap+31,$top_bottom_handicap+$top_offset,40,5,5,32,"^3Short name of car " . $i,"^3".$car_1,3,$config_name ); ENDIF FOR ($j=1;$j<=$number_of_classes;$j=$j+1) IF ($j == 1) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^1red^7: " ); ENDIF $config_name_2="config_mass_1_" . $j; $config_name_3="config_intake_1_" . $j; IF ($mass_1_1 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_1_1,3,$config_name_2 ); ENDIF IF ($intake_1_1 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_1_1,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 2) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^4blue^7: " ); ENDIF $config_name_2="config_mass_1_" . $j; $config_name_3="config_intake_1_" . $j; IF ($mass_1_2 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_1_2,3,$config_name_2 ); ENDIF IF ($intake_1_2 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_1_2,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 3) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^2green^7: " ); ENDIF $config_name_2="config_mass_1_" . $j; $config_name_3="config_intake_1_" . $j; IF ($mass_1_3 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_1_3,3,$config_name_2 ); ENDIF IF ($intake_1_3 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_1_3,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 4) THEN openPrivButton( "handicap_restiction_class_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); $config_name_2="config_mass_1_" . $j; $config_name_3="config_intake_1_" . $j; IF ($mass_1_4 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_1_4,3,$config_name_2 ); ENDIF IF ($intake_1_4 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_1_4,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 5) THEN openPrivButton( "handicap_restiction_class_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); $config_name_2="config_mass_1_" . $j; $config_name_3="config_intake_1_" . $j; IF ($mass_1_5 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_1_5,3,$config_name_2 ); ENDIF IF ($intake_1_5 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_1_5,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF ENDFOR ENDIF IF ($i == 2) THEN IF ($car_2 == "") THEN openPrivTextButton( "handicap_input_car_" . $i,$left_right_handicap+31,$top_bottom_handicap+$top_offset,40,5,5,32,"^3Short name of car " . $i,"^3Click to set",3,$config_name ); ELSE openPrivTextButton( "handicap_input_car_" . $i,$left_right_handicap+31,$top_bottom_handicap+$top_offset,40,5,5,32,"^3Short name of car " . $i,"^3".$car_2,3,$config_name ); ENDIF FOR ($j=1;$j<=$number_of_classes;$j=$j+1) IF ($j == 1) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_b_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_b_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^1red^7: " ); ENDIF $config_name_2="config_mass_2_" . $j; $config_name_3="config_intake_2_" . $j; IF ($mass_2_1 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_2_1,3,$config_name_2 ); ENDIF IF ($intake_2_1 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_2_1,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 2) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_b_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_b_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^4blue^7: " ); ENDIF $config_name_2="config_mass_2_" . $j; $config_name_3="config_intake_2_" . $j; IF ($mass_2_2 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_2_2,3,$config_name_2 ); ENDIF IF ($intake_2_2 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_2_2,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 3) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_b_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_b_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^2green^7: " ); ENDIF $config_name_2="config_mass_2_" . $j; $config_name_3="config_intake_2_" . $j; IF ($mass_2_3 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_2_3,3,$config_name_2 ); ENDIF IF ($intake_2_3 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_2_3,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 4) THEN openPrivButton( "handicap_restiction_class_b_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); $config_name_2="config_mass_2_" . $j; $config_name_3="config_intake_2_" . $j; IF ($mass_2_4 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_2_4,3,$config_name_2 ); ENDIF IF ($intake_2_4 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_2_4,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 5) THEN openPrivButton( "handicap_restiction_class_b_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); $config_name_2="config_mass_2_" . $j; $config_name_3="config_intake_2_" . $j; IF ($mass_2_5== "") THEN openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_b_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_2_5,3,$config_name_2 ); ENDIF IF ($intake_2_5 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_b_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_2_5,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF ENDFOR ENDIF IF ($i == 3) THEN IF ($car_3 == "") THEN openPrivTextButton( "handicap_input_car_" . $i,$left_right_handicap+31,$top_bottom_handicap+$top_offset,40,5,5,32,"^3Short name of car " . $i,"^3Click to set",3,$config_name ); ELSE openPrivTextButton( "handicap_input_car_" . $i,$left_right_handicap+31,$top_bottom_handicap+$top_offset,40,5,5,32,"^3Short name of car " . $i,"^3".$car_3,3,$config_name ); ENDIF FOR ($j=1;$j<=$number_of_classes;$j=$j+1) IF ($j == 1) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_c_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_c_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^1red^7: " ); ENDIF $config_name_2="config_mass_3_" . $j; $config_name_3="config_intake_3_" . $j; IF ($mass_3_1 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_3_1,3,$config_name_2 ); ENDIF IF ($intake_3_1 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_3_1,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 2) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_c_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_c_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^4blue^7: " ); ENDIF $config_name_2="config_mass_3_" . $j; $config_name_3="config_intake_3_" . $j; IF ($mass_3_2 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_3_2,3,$config_name_2 ); ENDIF IF ($intake_3_2 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_3_2,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 3) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_c_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_c_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^2green^7: " ); ENDIF $config_name_2="config_mass_3_" . $j; $config_name_3="config_intake_3_" . $j; IF ($mass_3_3 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_3_3,3,$config_name_2 ); ENDIF IF ($intake_3_3 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_3_3,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 4) THEN openPrivButton( "handicap_restiction_class_c_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); $config_name_2="config_mass_3_" . $j; $config_name_3="config_intake_3_" . $j; IF ($mass_3_4 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_3_4,3,$config_name_2 ); ENDIF IF ($intake_3_4 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_3_4,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 5) THEN openPrivButton( "handicap_restiction_class_c_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); $config_name_2="config_mass_3_" . $j; $config_name_3="config_intake_3_" . $j; IF ($mass_3_5 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_c_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_3_5,3,$config_name_2 ); ENDIF IF ($intake_3_5 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_c_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_3_5,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF ENDFOR ENDIF IF ($i == 4) THEN IF ($car_4 == "") THEN openPrivTextButton( "handicap_input_car_" . $i,$left_right_handicap+31,$top_bottom_handicap+$top_offset,40,5,5,32,"^3Short name of car " . $i,"^3Click to set",3,$config_name ); ELSE openPrivTextButton( "handicap_input_car_" . $i,$left_right_handicap+31,$top_bottom_handicap+$top_offset,40,5,5,32,"^3Short name of car " . $i,"^3".$car_4,3,$config_name ); ENDIF FOR ($j=1;$j<=$number_of_classes;$j=$j+1) IF ($j == 1) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_d_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_d_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^1red^7: " ); ENDIF $config_name_2="config_mass_4_" . $j; $config_name_3="config_intake_4_" . $j; IF ($mass_4_1 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_4_1,3,$config_name_2 ); ENDIF IF ($intake_4_1 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_4_1,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 2) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_d_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_d_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^4blue^7: " ); ENDIF $config_name_2="config_mass_4_" . $j; $config_name_3="config_intake_4_" . $j; IF ($mass_4_2 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_4_2,3,$config_name_2 ); ENDIF IF ($intake_4_2 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_4_2,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 3) THEN IF ( $use_subclasses == "no" ) THEN openPrivButton( "handicap_restiction_class_d_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); ELSE openPrivButton( "handicap_restiction_class_d_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restr. subclass ^2green^7: " ); ENDIF $config_name_2="config_mass_4_" . $j; $config_name_3="config_intake_4_" . $j; IF ($mass_4_3 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_4_3,3,$config_name_2 ); ENDIF IF ($intake_4_3 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_4_3,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 4) THEN openPrivButton( "handicap_restiction_class_d_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); $config_name_2="config_mass_4_" . $j; $config_name_3="config_intake_4_" . $j; IF ($mass_4_4 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_4_4,3,$config_name_2 ); ENDIF IF ($intake_4_4 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_4_4,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF IF ($j == 5) THEN openPrivButton( "handicap_restiction_class_d_" . $j,$left_right_handicap+71,$top_bottom_handicap+$top_offset_2,30,5,5,-1,96,"^7Restriction class " . $j . ": " ); $config_name_2="config_mass_4_" . $j; $config_name_3="config_intake_4_" . $j; IF ($mass_4_5 == "") THEN openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3Click to set",3,$config_name_2 ); ELSE openPrivTextButton( "handicap_mass_restiction_class_d_" . $j,$left_right_handicap+101,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Mass car " . $i . " - class " . $j,"^3".$mass_4_5,3,$config_name_2 ); ENDIF IF ($intake_4_5 == "") THEN openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3Click to set",2,$config_name_3 ); ELSE openPrivTextButton( "handicap_intake_restiction_class_d_" . $j,$left_right_handicap+121,$top_bottom_handicap+$top_offset_2,20,5,5,32,"^3Intake car " . $i . " - class " . $j,"^3".$intake_4_5,2,$config_name_3 ); ENDIF $top_offset_2=$top_offset_2+5; ENDIF ENDFOR ENDIF $top_offset=$top_offset+$number_of_classes*5; ENDFOR ENDIF openPrivButton( "handicap_gui_load",$left_right_handicap+1,$top_bottom_handicap+141,47,5,5,-1,32,"^3Load", handicap_gui_load ); openPrivButton( "handicap_gui_save",$left_right_handicap+94,$top_bottom_handicap+141,47,5,5,-1,32,"^3Save", handicap_gui_save ); openPrivButton( "handicap_gui_clear",$left_right_handicap+1,$top_bottom_handicap+146,47,5,5,-1,32,"^3Clear", handicap_gui_clear ); openPrivButton( "handicap_gui_force",$left_right_handicap+48,$top_bottom_handicap+146,46,5,5,-1,32,"^3Force handicap(s)", handicap_gui_force ); openPrivButton( "handicap_gui_close",$left_right_handicap+94,$top_bottom_handicap+146,47,5,5,-1,32,"^3Close", handicap_gui_close ); EndSub Sub config_class_indicator_fws ( $KeyFlag , $id ) $class_indicator="^s"; # simulate: / $indicator_length = strlen( $class_indicator ); Handicap( $KeyFlags ); EndSub Sub config_class_indicator_pipe ( $KeyFlag , $id ) $class_indicator="^v"; # simulate: | $indicator_length = strlen( $class_indicator ); Handicap( $KeyFlags ); EndSub Sub config_class_indicator ( $class_indicator_value,$text ) IF ( $text == "/" ) THEN $class_indicator="^s"; # simulate: / ELSE IF ( $text == "|" ) THEN $class_indicator="^v"; # simulate: | ELSE $class_indicator=$text; ENDIF ENDIF $indicator_length = strlen( $class_indicator ); Handicap( $KeyFlags ); EndSub Sub config_number_of_classes ( $number_of_classes_value,$text ) IF ($number_of_classes != "") THEN FOR ($i=1;$i<=$number_of_cars;$i=$i+1) closePrivButton("handicap_car_" . $i); closePrivButton("handicap_input_car_" . $i); IF ($i == 1) THEN $car_1=""; $mass_1_1 = ""; $mass_1_2 = ""; $mass_1_3 = ""; $mass_1_4 = ""; $mass_1_5 = ""; $intake_1_1 = ""; $intake_1_2 = ""; $intake_1_3 = ""; $intake_1_4 = ""; $intake_1_5 = ""; ENDIF IF ($i == 2) THEN $car_2=""; $mass_2_1 = ""; $mass_2_2 = ""; $mass_2_3 = ""; $mass_2_4 = ""; $mass_2_5 = ""; $intake_2_1 = ""; $intake_2_2 = ""; $intake_2_3 = ""; $intake_2_4 = ""; $intake_2_5 = ""; ENDIF IF ($i == 3) THEN $car_3=""; $mass_3_1 = ""; $mass_3_2 = ""; $mass_3_3 = ""; $mass_3_4 = ""; $mass_3_5 = ""; $intake_3_1 = ""; $intake_3_2 = ""; $intake_3_3 = ""; $intake_3_4 = ""; $intake_3_5 = ""; ENDIF IF ($i == 4) THEN $car_4=""; $mass_4_1 = ""; $mass_4_2 = ""; $mass_4_3 = ""; $mass_4_4 = ""; $mass_4_5 = ""; $intake_4_1 = ""; $intake_4_2 = ""; $intake_4_3 = ""; $intake_4_4 = ""; $intake_4_5 = ""; ENDIF ENDFOR FOR ($j=1;$j<=$number_of_classes;$j=$j+1) closePrivButton("handicap_restiction_class_" . $j); closePrivButton("handicap_mass_restiction_class_" . $j); closePrivButton("handicap_intake_restiction_class_" . $j); closePrivButton("handicap_restiction_class_b_" . $j); closePrivButton("handicap_mass_restiction_class_b_" . $j); closePrivButton("handicap_intake_restiction_class_b_" . $j); closePrivButton("handicap_restiction_class_c_" . $j); closePrivButton("handicap_mass_restiction_class_c_" . $j); closePrivButton("handicap_intake_restiction_class_c_" . $j); closePrivButton("handicap_restiction_class_d_" . $j); closePrivButton("handicap_mass_restiction_class_d_" . $j); closePrivButton("handicap_intake_restiction_class_d_" . $j); ENDFOR ENDIF IF ($text > 5) THEN PrivMsg ("^1Given number of classes is too high, value won't be changed"); ELSE IF ($text == 0) THEN PrivMsg ("^1Given number of classes can't be zero, value won't be changed"); ELSE $number_of_classes=$text; ENDIF ENDIF Handicap( $KeyFlags ); EndSub Sub set_subclass ( $KeyFlags, $id ) IF ( $id == "handicap_use_subclasses_yes" ) THEN $use_subclasses = "yes"; $number_of_classes = 3; closePrivButton("handicap_number_of_classes"); closePrivButton("handicap_number_of_classes_input"); ELSE $use_subclasses = "no"; ENDIF Handicap( $KeyFlags ); EndSub Sub config_number_of_cars ( $number_of_cars_value,$text ) IF ($number_of_cars != "") THEN FOR ($i=1;$i<=$number_of_cars;$i=$i+1) closePrivButton("handicap_car_" . $i); closePrivButton("handicap_input_car_" . $i); IF ($i == 1) THEN $car_1=""; $mass_1_1 = ""; $mass_1_2 = ""; $mass_1_3 = ""; $mass_1_4 = ""; $mass_1_5= ""; $intake_1_1 = ""; $intake_1_2 = ""; $intake_1_3 = ""; $intake_1_4 = ""; $intake_1_5 = ""; ENDIF IF ($i == 2) THEN $car_2=""; $mass_2_1 = ""; $mass_2_2 = ""; $mass_2_3 = ""; $mass_2_4 = ""; $mass_2_5 = ""; $intake_2_1 = ""; $intake_2_2 = ""; $intake_2_3 = ""; $intake_2_4 = ""; $intake_2_5 = ""; ENDIF IF ($i == 3) THEN $car_3=""; $mass_3_1 = ""; $mass_3_2 = ""; $mass_3_3 = ""; $mass_3_4 = ""; $mass_3_5 = ""; $intake_3_1 = ""; $intake_3_2 = ""; $intake_3_3 = ""; $intake_3_4 = ""; $intake_3_5 = ""; ENDIF IF ($i == 4) THEN $car_4=""; $mass_4_1 = ""; $mass_4_2 = ""; $mass_4_3 = ""; $mass_4_4 = ""; $mass_4_5 = ""; $intake_4_1 = ""; $intake_4_2 = ""; $intake_4_3 = ""; $intake_4_4 = ""; $intake_4_5 = ""; ENDIF ENDFOR FOR ($j=1;$j<=$number_of_classes;$j=$j+1) closePrivButton("handicap_restiction_class_" . $j); closePrivButton("handicap_mass_restiction_class_" . $j); closePrivButton("handicap_intake_restiction_class_" . $j); closePrivButton("handicap_restiction_class_b_" . $j); closePrivButton("handicap_mass_restiction_class_b_" . $j); closePrivButton("handicap_intake_restiction_class_b_" . $j); closePrivButton("handicap_restiction_class_c_" . $j); closePrivButton("handicap_mass_restiction_class_c_" . $j); closePrivButton("handicap_intake_restiction_class_c_" . $j); closePrivButton("handicap_restiction_class_d_" . $j); closePrivButton("handicap_mass_restiction_class_d_" . $j); closePrivButton("handicap_intake_restiction_class_d_" . $j); ENDFOR ENDIF IF ($text == "") THEN PrivMsg ("^1Number of classes has to be set first, value won't be changed"); ELSE IF ($text > 4) THEN PrivMsg ("^1Given number of cars is too high, value won't be changed"); ELSE IF ($text == 0) THEN PrivMsg ("^1Given number of cars can't be zero, value won't be changed"); ELSE $number_of_cars=$text; ENDIF ENDIF ENDIF Handicap( $KeyFlags ); EndSub Sub config_car_1 ($car_1_value,$text) ### Delete value $car_1 in order to able to check wether it is in the car_names array or not $car_1=""; ### END ### ### Delete all values for mass related to car 1, otherwise and incorrect value for the chose car can left behind $mass_1_1 = ""; $mass_1_2 = ""; $mass_1_3 = ""; $mass_1_4 = ""; $mass_1_5 = ""; ### END ### FOR($k=1;$k<=20;$k=$k+1) IF ($text == $car_names[1,$k]) THEN $car_1=$text; ENDIF ENDFOR IF ($car_1 == "") THEN PrivMsg("^1Car name (Car 1) not found, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_car_2 ($car_2_value,$text) ### Delete value $car_2 in order to able to check wether it is in the car_names array or not $car_2=""; ### END ### ### Delete all values for mass related to car 2, otherwise and incorrect value for the chose car can left behind $mass_2_1 = ""; $mass_2_2 = ""; $mass_2_3 = ""; $mass_2_4 = ""; $mass_2_5 = ""; ### END ### FOR($k=1;$k<=20;$k=$k+1) IF ($text == $car_names[1,$k]) THEN $car_2=$text; ENDIF ENDFOR IF ($car_2 == "") THEN PrivMsg("^1Car name (Car 2) not found, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_car_3 ($car_3_value,$text) ### Delete value $car_3 in order to able to check wether it is in the car_names array or not $car_3=""; ### END ### ### Delete all values for mass related to car 3, otherwise and incorrect value for the chose car can left behind $mass_3_1 = ""; $mass_3_2 = ""; $mass_3_3 = ""; $mass_3_4 = ""; $mass_3_5 = ""; ### END ### FOR($k=1;$k<=20;$k=$k+1) IF ($text == $car_names[1,$k]) THEN $car_3=$text; ENDIF ENDFOR IF ($car_3 == "") THEN PrivMsg("^1Car name (Car 3) not found, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_car_4 ($car_4_value,$text) ### Delete value $car_4 in order to able to check wether it is in the car_names array or not $car_4=""; ### END ### ### Delete all values for mass related to car 3, otherwise and incorrect value for the chose car can left behind $mass_4_1 = ""; $mass_4_2 = ""; $mass_4_3 = ""; $mass_4_4 = ""; $mass_4_5 = ""; ### END ### FOR($k=1;$k<=20;$k=$k+1) IF ($text == $car_names[1,$k]) THEN $car_4=$text; ENDIF ENDFOR IF ($car_4 == "") THEN PrivMsg("^1Car name (Car 4) not found, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_1_1 ($mass_1_1_value,$text) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF ( ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_1_1=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_1_2 ($mass_1_2_value,$text) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_1_2=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_1_3 ($mass_1_3_value,$text) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_1_3=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_1_4 ($mass_1_4_value,$text) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_1_4=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_1_5 ($mass_1_5_value,$text) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_1_5=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_2_1 ($mass_2_1_value,$text) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_2_1=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_2_2 ($mass_2_2_value,$text) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_2_2=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_2_3 ($mass_2_3_value,$text) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_2_3=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_2_4 ($mass_2_4_value,$text) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_2_4=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_2_5 ($mass_2_5_value,$text) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_2_5=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_3_1 ($mass_3_1_value,$text) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_3_1=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_3_2 ($mass_3_2_value,$text) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_3_2=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_3_3 ($mass_3_3_value,$text) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_3_3=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_3_4 ($mass_3_4_value,$text) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_3_4=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_3_5 ($mass_3_5_value,$text) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_3_5=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_4_1 ($mass_4_1_value,$text) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_4_1=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_4_2 ($mass_4_2_value,$text) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_4_2=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_4_3 ($mass_4_3_value,$text) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_4_3=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_4_4 ($mass_4_4_value,$text) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_4_4=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_mass_4_5 ($mass_4_5_value,$text) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $text ) > $car_weight[1,$k]) THEN PrivMsg ("^1Value can't be above " . $car_weight[1,$k] . ", value won't be changed"); ELSE $mass_4_5=ToNum( $text ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_1_1 ($intake_1_1_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_1=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_1_2 ($intake_1_2_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_2=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_1_3 ($intake_1_3_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_3=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_1_4 ($intake_1_4_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_4=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_1_5 ($intake_1_5_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_5=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_2_1 ($intake_2_1_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_1=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_2_2 ($intake_2_2_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_2=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_2_3 ($intake_2_3_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_3=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_2_4 ($intake_2_4_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_4=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_2_5 ($intake_2_5_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_5=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_3_1 ($intake_3_1_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_1=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_3_2 ($intake_3_2_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_2=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_3_3 ($intake_3_3_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_3=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_3_4 ($intake_3_4_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_4=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_3_5 ($intake_3_5_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_5=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_4_1 ($intake_4_1_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_1=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_4_2 ($intake_4_2_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_2=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_4_3 ($intake_4_3_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_3=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_4_4 ($intake_4_4_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_4=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_intake_4_5 ($intake_4_5_value,$text) IF (ToNum( $text ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_5=ToNum( $text ); ENDIF Handicap( $KeyFlags ); EndSub Sub config_handicap_race_id ($race_id_handicaps_value,$text) $race_id_handicaps=ToNum( $text ); Handicap( $KeyFlags ); Endsub Sub handicap_gui_clear( $KeyFlags,$id) FOR ($i=1;$i<=$number_of_cars;$i=$i+1) closePrivButton("handicap_car_" . $i); closePrivButton("handicap_input_car_" . $i); IF ($i == 1) THEN $car_1=""; $mass_1_1 = ""; $mass_1_2 = ""; $mass_1_3 = ""; $mass_1_4 = ""; $mass_1_5 = ""; $intake_1_1 = ""; $intake_1_2 = ""; $intake_1_3 = ""; $intake_1_4 = ""; $intake_1_5 = ""; ENDIF IF ($i == 2) THEN $car_2=""; $mass_2_1 = ""; $mass_2_2 = ""; $mass_2_3 = ""; $mass_2_4 = ""; $mass_2_5 = ""; $intake_2_1 = ""; $intake_2_2 = ""; $intake_2_3 = ""; $intake_2_4 = ""; $intake_2_5 = ""; ENDIF IF ($i == 3) THEN $car_3=""; $mass_3_1 = ""; $mass_3_2 = ""; $mass_3_3 = ""; $mass_3_4 = ""; $mass_3_5 = ""; $intake_3_1 = ""; $intake_3_2 = ""; $intake_3_3 = ""; $intake_3_4 = ""; $intake_3_5 = ""; ENDIF IF ($i == 4) THEN $car_4=""; $mass_4_1 = ""; $mass_4_2 = ""; $mass_4_3 = ""; $mass_4_4 = ""; $mass_4_5 = ""; $intake_4_1 = ""; $intake_4_2 = ""; $intake_4_3 = ""; $intake_4_4 = ""; $intake_4_5 = ""; ENDIF ENDFOR FOR ($j=1;$j<=4;$j=$j+1) closePrivButton("handicap_restiction_class_" . $j); closePrivButton("handicap_mass_restiction_class_" . $j); closePrivButton("handicap_intake_restiction_class_" . $j); closePrivButton("handicap_restiction_class_b_" . $j); closePrivButton("handicap_mass_restiction_class_b_" . $j); closePrivButton("handicap_intake_restiction_class_b_" . $j); closePrivButton("handicap_restiction_class_c_" . $j); closePrivButton("handicap_mass_restiction_class_c_" . $j); closePrivButton("handicap_intake_restiction_class_c_" . $j); closePrivButton("handicap_restiction_class_d_" . $j); closePrivButton("handicap_mass_restiction_class_d_" . $j); closePrivButton("handicap_intake_restiction_class_d_" . $j); ENDFOR $use_subclasses="no"; $number_of_classes=""; $number_of_cars=""; $race_id_handicaps=""; Handicap( $KeyFlags ); EndSub Sub mass_all_to_zero( $KeyFlags,$id ) $error=0; IF ($number_of_cars == 1) THEN IF ($car_1 == "") THEN PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); $error=$error+1; ENDIF ENDIF IF ($number_of_cars == 2) THEN IF ($car_1 == "") THEN PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); $error=$error+1; ENDIF IF ($car_2 == "") THEN PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); $error=$error+1; ENDIF ENDIF IF ($number_of_cars == 3) THEN IF ($car_1 == "") THEN PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); $error=$error+1; ENDIF IF ($car_2 == "") THEN PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); $error=$error+1; ENDIF IF ($car_3 == "") THEN PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); $error=$error+1; ENDIF ENDIF IF ($number_of_cars == 4) THEN IF ($car_1 == "") THEN PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); $error=$error+1; ENDIF IF ($car_2 == "") THEN PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); $error=$error+1; ENDIF IF ($car_3 == "") THEN PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); $error=$error+1; ENDIF IF ($car_4 == "") THEN PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); $error=$error+1; ENDIF ENDIF IF ($error == 0) THEN $mass_1_1 = 0; $mass_1_2 = 0; $mass_1_3 = 0; $mass_1_4 = 0; $mass_1_5 = 0; $mass_2_1 = 0; $mass_2_2 = 0; $mass_2_3 = 0; $mass_2_4 = 0; $mass_2_5 = 0; $mass_3_1 = 0; $mass_3_2 = 0; $mass_3_3 = 0; $mass_3_4 = 0; $mass_3_5 = 0; $mass_4_1 = 0; $mass_4_2 = 0; $mass_4_3 = 0; $mass_4_4 = 0; $mass_4_5 = 0; ENDIF Handicap( $KeyFlags ); EndSub Sub intake_all_to_zero( $KeyFlags,$id ) $intake_1_1 = 0; $intake_1_2 = 0; $intake_1_3 = 0; $intake_1_4 = 0; $intake_1_5 = 0; $intake_2_1 = 0; $intake_2_2 = 0; $intake_2_3 = 0; $intake_2_4 = 0; $intake_2_5 = 0; $intake_3_1 = 0; $intake_3_2 = 0; $intake_3_3 = 0; $intake_3_4 = 0; $intake_3_5 = 0; $intake_4_1 = 0; $intake_4_2 = 0; $intake_4_3 = 0; $intake_4_4 = 0; $intake_4_5 = 0; Handicap( $KeyFlags ); EndSub Sub handicap_gui_force( $KeyFlags,$id ) $counter_intake = 0; $counter_mass = 0; $mList = GetListOfPlayers("N"); $mCount = arrayCount( $mList ); $plyNum=0; WHILE ($plyNum < $mCount) $uName = $mList[$plyNum]; ### Check restrictions when subclasses are set to 'yes' AND car_1 is used ### IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "red" && GetPlayerVar( $uName,"Car" ) == $car_1 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set intake restriction to " . $intake_1_1 . "% for " . $car_1 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set added mass to " . $mass_1_1 . "kg for " . $car_1 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "blue" && GetPlayerVar( $uName,"Car" ) == $car_1 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set intake restriction to " . $intake_1_2 . "% for " . $car_1 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set added mass to " . $mass_1_2 . "kg for " . $car_1 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "green" && GetPlayerVar( $uName,"Car" ) == $car_1 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set intake restriction to " . $intake_1_3 . "% for " . $car_1 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set added mass to " . $mass_1_3 . "kg for " . $car_1 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF ### End ### ### Check restrictions when subclasses are set to 'yes' AND car_2 is used ### IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "red" && GetPlayerVar( $uName,"Car" ) == $car_2 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set intake restriction to " . $intake_2_1 . "% for " . $car_2 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set added mass to " . $mass_2_1 . "kg for " . $car_2 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "blue" && GetPlayerVar( $uName,"Car" ) == $car_2 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set intake restriction to " . $intake_2_2 . "% for " . $car_2 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set added mass to " . $mass_2_2 . "kg for " . $car_2 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "green" && GetPlayerVar( $uName,"Car" ) == $car_2 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set intake restriction to " . $intake_2_3 . "% for " . $car_2 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set added mass to " . $mass_2_3 . "kg for " . $car_2 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF ### End ### ### Check restrictions when subclasses are set to 'yes' AND car_3 is used ### IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "red" && GetPlayerVar( $uName,"Car" ) == $car_3 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set intake restriction to " . $intake_3_1 . "% for " . $car_3 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set added mass to " . $mass_3_1 . "kg for " . $car_3 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "blue" && GetPlayerVar( $uName,"Car" ) == $car_3 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set intake restriction to " . $intake_3_2 . "% for " . $car_3 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set added mass to " . $mass_3_2 . "kg for " . $car_3 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "green" && GetPlayerVar( $uName,"Car" ) == $car_3 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set intake restriction to " . $intake_3_3 . "% for " . $car_3 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set added mass to " . $mass_3_3 . "kg for " . $car_3 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF ### End ### ### Check restrictions when subclasses are set to 'yes' AND car_4 is used ### IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "red" && GetPlayerVar( $uName,"Car" ) == $car_4 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set intake restriction to " . $intake_4_1 . "% for " . $car_4 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass red, set added mass to " . $mass_4_1 . "kg for " . $car_4 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "blue" && GetPlayerVar( $uName,"Car" ) == $car_4 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set intake restriction to " . $intake_4_2 . "% for " . $car_4 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass blue, set added mass to " . $mass_4_2 . "kg for " . $car_4 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "yes" && GetPlayerVar( $uName,"color_to_indicate_subclass" ) == "green" && GetPlayerVar( $uName,"Car" ) == $car_4 ) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set intake restriction to " . $intake_4_3 . "% for " . $car_4 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_43)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Subclass green, set added mass to " . $mass_4_3 . "kg for " . $car_4 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF ### End ### IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."1" && GetPlayerVar( $uName,"Car" ) == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set intake restriction to " . $intake_1_1 . "% for " . $car_1 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set added mass to " . $mass_1_1 . "kg for " . $car_1 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."2" && GetPlayerVar( $uName,"Car" ) == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set intake restriction to " . $intake_1_2 . "% for " . $car_1 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set added mass to " . $mass_1_2 . "kg for " . $car_1 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."3" && GetPlayerVar( $uName,"Car" ) == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set intake restriction to " . $intake_1_3 . "% for " . $car_1 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set added mass to " . $mass_1_3 . "kg for " . $car_1 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."4" && GetPlayerVar( $uName,"Car" ) == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set intake restriction to " . $intake_1_4 . "% for " . $car_1 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set added mass to " . $mass_1_4 . "kg for " . $car_1 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."5" && GetPlayerVar( $uName,"Car" ) == $car_1) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_1_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set intake restriction to " . $intake_1_5 . "% for " . $car_1 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_1_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set added mass to " . $mass_1_5 . "kg for " . $car_1 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."1" && GetPlayerVar( $uName,"Car" ) == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set intake restriction to " . $intake_2_1 . "% for " . $car_2 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set added mass to " . $mass_2_1 . "kg for " . $car_2 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."2" && GetPlayerVar( $uName,"Car" ) == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set intake restriction to " . $intake_2_2 . "% for " . $car_2 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set added mass to " . $mass_2_2 . "kg for " . $car_2 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."3" && GetPlayerVar( $uName,"Car" ) == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set intake restriction to " . $intake_2_3 . "% for " . $car_2 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set added mass to " . $mass_2_3 . "kg for " . $car_2 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."4" && GetPlayerVar( $uName,"Car" ) == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set intake restriction to " . $intake_2_4 . "% for " . $car_2 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set added mass to " . $mass_2_4 . "kg for " . $car_2 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."5" && GetPlayerVar( $uName,"Car" ) == $car_2) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_2_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set intake restriction to " . $intake_2_5 . "% for " . $car_2 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_2_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set added mass to " . $mass_2_5 . "kg for " . $car_2 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."1" && GetPlayerVar( $uName,"Car" ) == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set intake restriction to " . $intake_3_1 . "% for " . $car_3 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set added mass to " . $mass_3_1 . "kg for " . $car_3 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."2" && GetPlayerVar( $uName,"Car" ) == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set intake restriction to " . $intake_3_2 . "% for " . $car_3 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set added mass to " . $mass_3_2 . "kg for " . $car_3 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."3" && GetPlayerVar( $uName,"Car" ) == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set intake restriction to " . $intake_3_3 . "% for " . $car_3 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set added mass to " . $mass_3_3 . "kg for " . $car_3 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."4" && GetPlayerVar( $uName,"Car" ) == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set intake restriction to " . $intake_3_4 . "% for " . $car_3 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set added mass to " . $mass_3_4 . "kg for " . $car_3 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."5" && GetPlayerVar( $uName,"Car" ) == $car_3) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_3_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set intake restriction to " . $intake_3_5 . "% for " . $car_3 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_3_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set added mass to " . $mass_3_5 . "kg for " . $car_3 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."1" && GetPlayerVar( $uName,"Car" ) == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set intake restriction to " . $intake_4_1 . "% for " . $car_4 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_1)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 1, you need to set added mass to " . $mass_4_1 . "kg for " . $car_4 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."2" && GetPlayerVar( $uName,"Car" ) == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set intake restriction to " . $intake_4_2 . "% for " . $car_4 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_2)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 2, you need to set added mass to " . $mass_4_2 . "kg for " . $car_4 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."3" && GetPlayerVar( $uName,"Car" ) == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set intake restriction to " . $intake_4_3 . "% for " . $car_4 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_3)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 3, you need to set added mass to " . $mass_4_3 . "kg for " . $car_4 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."4" && GetPlayerVar( $uName,"Car" ) == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set intake restriction to " . $intake_4_4 . "% for " . $car_4 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_4)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 4, you need to set added mass to " . $mass_4_4 . "kg for " . $car_4 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF IF ( $use_subclasses == "no" && GetPlayerVar( $uName,"class_player" ) == $class_indicator."5" && GetPlayerVar( $uName,"Car" ) == $car_4) THEN IF ( GetCurrentPlayerVar("P_Tres") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Tres")) < ToNum($intake_4_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set intake restriction to " . $intake_4_5 . "% for " . $car_4 ); $counter_intake=$counter_intake+1; ENDIF ENDIF IF ( GetCurrentPlayerVar("P_Mass") != "" ) THEN IF ( ToNum(GetCurrentPlayerVar("P_Mass")) < ToNum($mass_4_5)) THEN cmdLFS("/spec " . GetCurrentPlayerVar("NickName") ); PrivMsg ("^1Class 5, you need to set added mass to " . $mass_4_5 . "kg for " . $car_4 ); $counter_mass=$counter_mass+1; ENDIF ENDIF ENDIF $plyNum=$plyNum+1; ENDWHILE IF ($counter_intake != 0) THEN globalMsg ("^1ADMIN forced " . $counter_intake . " car(s) from track, for..."); globalMsg ("^1...not having the right intake restriction"); globalMsg (" "); ELSE globalMsg ("^3ADMIN hasn't forced any cars from track..."); globalMsg ("^3...for not having the right intake restriction"); globalMsg (" "); ENDIF IF ($counter_mass != 0) THEN globalMsg ("^1ADMIN forced " . $counter_mass . " car(s) from track, for..."); globalMsg ("^1...not having the right amount of added mass"); ELSE globalMsg ("^3ADMIN hasn't forced any cars from track...."); globalMsg ("^3...for not having the right amount of added mass"); ENDIF EndSub Sub handicap_gui_load( $KeyFlags,$id ) handicap_gui_clear( $KeyFlags,$id); $storage_name = "HCS_".$server_name; $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $use_subclasses = GetStoredValue( $storage_name . "use_subclasses" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); handicap_gui_close( $KeyFlags,$id ); Handicap( $KeyFlags ); privMsg ("^7Handicap settings loaded" ); EndSub Sub handicap_gui_save( $KeyFlags,$id ) ### If car 1 is set, check if mass and/or intake hasn't been set and if so, set them to 0 ### ### This will avoid errors being logged because of values not having been set ### IF ($car_1 != "") THEN IF ($mass_1_1 == "") THEN $mass_1_1=0; ENDIF IF ($intake_1_1 == "") THEN $intake_1_1=0; ENDIF IF ($mass_1_2 == "") THEN $mass_1_2=0; ENDIF IF ($intake_1_2 == "") THEN $intake_1_2=0; ENDIF IF ($mass_1_3 == "") THEN $mass_1_3=0; ENDIF IF ($intake_1_3 == "") THEN $intake_1_3=0; ENDIF IF ($mass_1_4 == "") THEN $mass_1_4=0; ENDIF IF ($intake_1_4 == "") THEN $intake_1_4=0; ENDIF IF ($mass_1_5 == "") THEN $mass_1_5=0; ENDIF IF ($intake_1_5 == "") THEN $intake_1_5=0; ENDIF ENDIF IF ($car_2 != "") THEN IF ($mass_2_1 == "") THEN $mass_2_1=0; ENDIF IF ($intake_2_1 == "") THEN $intake_2_1=0; ENDIF IF ($mass_2_2 == "") THEN $mass_2_2=0; ENDIF IF ($intake_2_2 == "") THEN $intake_2_2=0; ENDIF IF ($mass_2_3 == "") THEN $mass_2_3=0; ENDIF IF ($intake_2_3 == "") THEN $intake_2_3=0; ENDIF IF ($mass_2_4 == "") THEN $mass_2_4=0; ENDIF IF ($intake_2_4 == "") THEN $intake_2_4=0; ENDIF IF ($mass_2_5 == "") THEN $mass_2_5=0; ENDIF IF ($intake_2_5 == "") THEN $intake_2_5=0; ENDIF ENDIF IF ($car_3 != "") THEN IF ($mass_3_1 == "") THEN $mass_3_1=0; ENDIF IF ($intake_3_1 == "") THEN $intake_3_1=0; ENDIF IF ($mass_3_2 == "") THEN $mass_3_2=0; ENDIF IF ($intake_3_2 == "") THEN $intake_3_2=0; ENDIF IF ($mass_3_3 == "") THEN $mass_3_3=0; ENDIF IF ($intake_3_3 == "") THEN $intake_3_3=0; ENDIF IF ($mass_3_4 == "") THEN $mass_3_4=0; ENDIF IF ($intake_3_4 == "") THEN $intake_3_4=0; ENDIF IF ($mass_3_5 == "") THEN $mass_3_5=0; ENDIF IF ($intake_3_5 == "") THEN $intake_3_5=0; ENDIF ENDIF IF ($car_4 != "") THEN IF ($mass_4_1 == "") THEN $mass_4_1=0; ENDIF IF ($intake_4_1 == "") THEN $intake_4_1=0; ENDIF IF ($mass_4_2 == "") THEN $mass_4_2=0; ENDIF IF ($intake_4_2 == "") THEN $intake_4_2=0; ENDIF IF ($mass_4_3 == "") THEN $mass_4_3=0; ENDIF IF ($intake_4_3 == "") THEN $intake_4_3=0; ENDIF IF ($mass_4_4 == "") THEN $mass_4_4=0; ENDIF IF ($intake_4_4 == "") THEN $intake_4_4=0; ENDIF IF ($mass_4_5 == "") THEN $mass_4_5=0; ENDIF IF ($intake_4_5 == "") THEN $intake_4_5=0; ENDIF ENDIF ### End ### $storage_name = "HCS_".$server_name; SetStoredValue( $storage_name . "class_indicator", $class_indicator ); SetStoredValue( $storage_name . "use_subclasses", $use_subclasses ); SetStoredValue( $storage_name . "number_of_classes", $number_of_classes ); SetStoredValue( $storage_name . "number_of_cars", $number_of_cars ); SetStoredValue( $storage_name . "race_id", $race_id_handicaps ); SetStoredValue( $storage_name . "car_1", $car_1 ); SetStoredValue( $storage_name . "car_2", $car_2 ); SetStoredValue( $storage_name . "car_3", $car_3 ); SetStoredValue( $storage_name . "car_4", $car_4 ); SetStoredValue( $storage_name . "mass_1_1", $mass_1_1 ); SetStoredValue( $storage_name . "mass_1_2", $mass_1_2 ); SetStoredValue( $storage_name . "mass_1_3", $mass_1_3 ); SetStoredValue( $storage_name . "mass_1_4", $mass_1_4 ); SetStoredValue( $storage_name . "mass_1_5", $mass_1_5 ); SetStoredValue( $storage_name . "mass_2_1", $mass_2_1 ); SetStoredValue( $storage_name . "mass_2_2", $mass_2_2 ); SetStoredValue( $storage_name . "mass_2_3", $mass_2_3 ); SetStoredValue( $storage_name . "mass_2_4", $mass_2_4 ); SetStoredValue( $storage_name . "mass_2_5", $mass_2_5 ); SetStoredValue( $storage_name . "mass_3_1", $mass_3_1 ); SetStoredValue( $storage_name . "mass_3_2", $mass_3_2 ); SetStoredValue( $storage_name . "mass_3_3", $mass_3_3 ); SetStoredValue( $storage_name . "mass_3_4", $mass_3_4 ); SetStoredValue( $storage_name . "mass_3_5", $mass_3_5 ); SetStoredValue( $storage_name . "mass_4_1", $mass_4_1 ); SetStoredValue( $storage_name . "mass_4_2", $mass_4_2 ); SetStoredValue( $storage_name . "mass_4_3", $mass_4_3 ); SetStoredValue( $storage_name . "mass_4_4", $mass_4_4 ); SetStoredValue( $storage_name . "mass_4_5", $mass_4_5 ); SetStoredValue( $storage_name . "intake_1_1", $intake_1_1 ); SetStoredValue( $storage_name . "intake_1_2", $intake_1_2 ); SetStoredValue( $storage_name . "intake_1_3", $intake_1_3 ); SetStoredValue( $storage_name . "intake_1_4", $intake_1_4 ); SetStoredValue( $storage_name . "intake_1_5", $intake_1_5 ); SetStoredValue( $storage_name . "intake_2_1", $intake_2_1 ); SetStoredValue( $storage_name . "intake_2_2", $intake_2_2 ); SetStoredValue( $storage_name . "intake_2_3", $intake_2_3 ); SetStoredValue( $storage_name . "intake_2_4", $intake_2_4 ); SetStoredValue( $storage_name . "intake_2_5", $intake_2_5 ); SetStoredValue( $storage_name . "intake_3_1", $intake_3_1 ); SetStoredValue( $storage_name . "intake_3_2", $intake_3_2 ); SetStoredValue( $storage_name . "intake_3_3", $intake_3_3 ); SetStoredValue( $storage_name . "intake_3_4", $intake_3_4 ); SetStoredValue( $storage_name . "intake_3_5", $intake_3_5 ); SetStoredValue( $storage_name . "intake_4_1", $intake_4_1 ); SetStoredValue( $storage_name . "intake_4_2", $intake_4_2 ); SetStoredValue( $storage_name . "intake_4_3", $intake_4_3 ); SetStoredValue( $storage_name . "intake_4_4", $intake_4_4 ); SetStoredValue( $storage_name . "intake_4_5", $intake_4_5 ); privMsg ("^7Handicap settings saved" ); EndSub Sub handicap_gui_close( $KeyFlags,$id ) closePrivButton("handicap_gui_bg"); closePrivButton("handicap_title"); closePrivButton("handicap_server_name"); closePrivButton("handicap_class_indicator"); closePrivButton("handicap_class_indicator_input_1"); closePrivButton("handicap_class_indicator_input_2"); closePrivButton("handicap_class_indicator_input_3"); closePrivButton("handicap_use_subclasses"); closePrivButton("handicap_use_subclasses_no"); closePrivButton("handicap_use_subclasses_yes"); closePrivButton("handicap_number_of_classes"); closePrivButton("handicap_number_of_classes_input"); closePrivButton("handicap_number_of_cars"); closePrivButton("handicap_race_id"); closePrivButton("handicap_race_id_input"); closePrivButton("handicap_mass_title"); closePrivButton("handicap_mass_zero"); closePrivButton("handicap_intake_title"); closePrivButton("handicap_intake_zero"); closePrivButton("handicap_number_of_cars_input"); FOR ($i=1;$i<=$number_of_cars;$i=$i+1) closePrivButton("handicap_car_" . $i); closePrivButton("handicap_input_car_" . $i); ENDFOR FOR ($j=1;$j<=$number_of_classes;$j=$j+1) closePrivButton("handicap_restiction_class_" . $j); closePrivButton("handicap_mass_restiction_class_" . $j); closePrivButton("handicap_intake_restiction_class_" . $j); closePrivButton("handicap_restiction_class_b_" . $j); closePrivButton("handicap_mass_restiction_class_b_" . $j); closePrivButton("handicap_intake_restiction_class_b_" . $j); closePrivButton("handicap_restiction_class_c_" . $j); closePrivButton("handicap_mass_restiction_class_c_" . $j); closePrivButton("handicap_intake_restiction_class_c_" . $j); closePrivButton("handicap_restiction_class_d_" . $j); closePrivButton("handicap_mass_restiction_class_d_" . $j); closePrivButton("handicap_intake_restiction_class_d_" . $j); ENDFOR closePrivButton ("handicap_gui_load"); closePrivButton ("handicap_gui_save"); closePrivButton ("handicap_gui_clear"); closePrivButton ("handicap_gui_force"); closePrivButton ("handicap_gui_close"); EndSub