Sub OnLapperStart_Handicap() ### Admin GUI Handicap system #### GlobalVar $server_name; GlobalVar $class_indicator; GlobalVar $number_of_classes; GlobalVar $number_of_cars; 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 = ""; $number_of_cars = ""; $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 ### Add UserName to $user_array together with $number_of_stops ### FOR ($i=1;$i<=32;$i=$i+1) IF ($user_array[$i,9] == "") THEN $pl_name = GetCurrentPlayerVar( "NickName" ); $name_length = strlen( $pl_name ); $class_string = $name_length-1; $class_string_b = $name_length-3; IF ($class_string > 0) THEN $class = $class_indicator . subStr( $pl_name, $class_string ); $class_ind_player = subStr( $pl_name, $class_string_b,2 ); $user_array[$i,9] = $class; # Class player is in #Put 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_indicator_player", $class_ind_player); BREAK; ENDIF ENDIF ENDFOR EndSub Sub OnNewPlayerJoin_Handicap() FOR ($i=1;$i<=32;$i=$i+1) IF ($user_array[$i,1] == GetCurrentPlayerVar( "UserName" ) ) THEN # Check class indicator in playername again, in case player changed name during his stay on the server $pl_name = GetCurrentPlayerVar( "NickName" ); $name_length = strlen( $pl_name ); $class_string = $name_length-1; $class_string_b = $name_length-3; $class = $class_indicator . subStr( $pl_name, $class_string ); $class_ind_player = subStr( $pl_name, $class_string_b,2 ); $user_array[$i,9] = $class; # Class player is in SetCurrentPlayerVar ( "class_indicator_player", $class_ind_player); 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 /1 , /2 , /3 , /4 behind your nickname" ); BREAK; ENDIF IF ($user_array[$i,9] == "^s1" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s2" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s3" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s4" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s5" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s1" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s2" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s3" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s4" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s5" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s1" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s2" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s3" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s4" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s5" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s1" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s2" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s3" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s4" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s5" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 ENDFOR EndSub Sub OnDisConnect_Handicap() # Player event ### Search for UserName in $user_array and erase values when found ### FOR ($i=1;$i<=32;$i=$i+1) IF ($user_array[$i,1] == GetCurrentPlayerVar( "UserName" ) ) THEN $user_array[$i,9] = ""; BREAK; ENDIF ENDFOR ### End ### EndSub Sub Handicap ( $KeyFlags,$id ) $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,142,5,-1,16,""); openPrivButton( "handicap_title",$left_right_handicap+1,$top_bottom_handicap+1,70,5,5,-1,32,"^7Handicap system V1.08" ); 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 == "") THEN openPrivTextButton( "handicap_class_indicator_input",$left_right_handicap+31,$top_bottom_handicap+11,40,5,5,32,"^3Class indicator","^3Click to set",1,config_class_indicator ); ELSE openPrivTextButton( "handicap_class_indicator_input",$left_right_handicap+31,$top_bottom_handicap+11,40,5,5,32,"^3Class indicator","^3".$class_indicator,1,config_class_indicator ); ENDIF */ openPrivButton( "handicap_number_of_classes",$left_right_handicap+1,$top_bottom_handicap+16,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+16,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+16,40,5,5,32,"^3Number of classes (max 5)","^3".$number_of_classes,1,config_number_of_classes ); ENDIF openPrivButton( "handicap_number_of_cars",$left_right_handicap+1,$top_bottom_handicap+21,30,5,5,-1,96,"^7Number of cars: " ); openPrivButton( "handicap_mass_title",$left_right_handicap+101,$top_bottom_handicap+16,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+21,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+16,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+21,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+21,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+21,40,5,5,32,"^3Number of cars (max 4)","^3".$number_of_cars,1,config_number_of_cars ); $top_offset=26; $top_offset_2=26; 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 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_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 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_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 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_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 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_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 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_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 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_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 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_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 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_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 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_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 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_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 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_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 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_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+131,47,5,5,-1,32,"^3Load", handicap_gui_load ); openPrivButton( "handicap_gui_save",$left_right_handicap+94,$top_bottom_handicap+131,47,5,5,-1,32,"^3Save", handicap_gui_save ); openPrivButton( "handicap_gui_clear",$left_right_handicap+1,$top_bottom_handicap+136,47,5,5,-1,32,"^3Clear", handicap_gui_clear ); openPrivButton( "handicap_gui_force",$left_right_handicap+48,$top_bottom_handicap+136,46,5,5,-1,32,"^3Force handicap(s)", handicap_gui_force ); openPrivButton( "handicap_gui_close",$left_right_handicap+94,$top_bottom_handicap+136,47,5,5,-1,32,"^3Close", handicap_gui_close ); EndSub /* Sub config_class_indicator ( $class_indicator_value ) $class_indicator=$class_indicator_value; $indicator_length = strlen( $class_indicator ); Handicap( $KeyFlags,$id ); EndSub */ Sub config_number_of_classes ( $number_of_classes_value ) 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 ($number_of_classes_value > 5) THEN PrivMsg ("^1Given number of classes is too high, value won't be changed"); ELSE IF ($number_of_classes_value == 0) THEN PrivMsg ("^1Given number of classes can't be zero, value won't be changed"); ELSE $number_of_classes=$number_of_classes_value; ENDIF ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_number_of_cars ( $number_of_cars_value ) 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 ($number_of_classes == "") THEN PrivMsg ("^1Number of classes has to be set first, value won't be changed"); ELSE IF ($number_of_cars_value > 4) THEN PrivMsg ("^1Given number of cars is too high, value won't be changed"); ELSE IF ($number_of_cars_value == 0) THEN PrivMsg ("^1Given number of cars can't be zero, value won't be changed"); ELSE $number_of_cars=$number_of_cars_value; ENDIF ENDIF ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_car_1 ($car_1_value) ### 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 ($car_1_value == $car_names[1,$k]) THEN $car_1=$car_1_value; ENDIF ENDFOR IF ($car_1 == "") THEN PrivMsg("^1Car name (Car 1) not found, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_car_2 ($car_2_value) ### 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 ($car_2_value == $car_names[1,$k]) THEN $car_2=$car_2_value; ENDIF ENDFOR IF ($car_2 == "") THEN PrivMsg("^1Car name (Car 2) not found, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_car_3 ($car_3_value) ### 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 ($car_3_value == $car_names[1,$k]) THEN $car_3=$car_3_value; ENDIF ENDFOR IF ($car_3 == "") THEN PrivMsg("^1Car name (Car 3) not found, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_car_4 ($car_4_value) ### 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 ($car_4_value == $car_names[1,$k]) THEN $car_4=$car_4_value; ENDIF ENDFOR IF ($car_4 == "") THEN PrivMsg("^1Car name (Car 4) not found, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_1_1 ($mass_1_1_value) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF ( ToNum( $mass_1_1_value ) > $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( $mass_1_1_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_1_2 ($mass_1_2_value) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF (ToNum( $mass_1_2_value ) > $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( $mass_1_2_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_1_3 ($mass_1_3_value) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF (ToNum( $mass_1_3_value ) > $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( $mass_1_3_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_1_4 ($mass_1_4_value) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF (ToNum( $mass_1_4_value ) > $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( $mass_1_4_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_1_5 ($mass_1_5_value) IF ($car_1 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_1 == $car_names[1,$k]) THEN IF (ToNum( $mass_1_5_value ) > $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( $mass_1_5_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 1 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_2_1 ($mass_2_1_value) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $mass_2_1_value ) > $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( $mass_2_1_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_2_2 ($mass_2_2_value) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $mass_2_2_value ) > $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( $mass_2_2_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_2_3 ($mass_2_3_value) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $mass_2_3_value ) > $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( $mass_2_3_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_2_4 ($mass_2_4_value) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $mass_2_4_value ) > $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( $mass_2_4_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_2_5 ($mass_2_5_value) IF ($car_2 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_2 == $car_names[1,$k]) THEN IF (ToNum( $mass_2_5_value ) > $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( $mass_2_5_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 2 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_3_1 ($mass_3_1_value) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $mass_3_1_value ) > $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( $mass_3_1_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_3_2 ($mass_3_2_value) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $mass_3_2_value ) > $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( $mass_3_2_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_3_3 ($mass_3_3_value) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $mass_3_3_value ) > $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( $mass_3_3_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_3_4 ($mass_3_4_value) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $mass_3_4_value ) > $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( $mass_3_4_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_3_5 ($mass_3_5_value) IF ($car_3 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_3 == $car_names[1,$k]) THEN IF (ToNum( $mass_3_5_value ) > $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( $mass_3_5_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 3 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_4_1 ($mass_4_1_value) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $mass_4_1_value ) > $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( $mass_4_1_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_4_2 ($mass_4_2_value) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $mass_4_2_value ) > $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( $mass_4_2_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_4_3 ($mass_4_3_value) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $mass_4_3_value ) > $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( $mass_4_3_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_4_4 ($mass_4_4_value) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $mass_4_4_value ) > $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( $mass_4_4_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_mass_4_5 ($mass_4_5_value) IF ($car_4 != "") THEN FOR($k=1;$k<=20;$k=$k+1) IF ($car_4 == $car_names[1,$k]) THEN IF (ToNum( $mass_4_5_value ) > $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( $mass_4_5_value ); ENDIF ENDIF ENDFOR ELSE PrivMsg("^1Name of Car 4 isn't set, value won't be changed"); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_1_1 ($intake_1_1_value) IF (ToNum( $intake_1_1_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_1=ToNum( $intake_1_1_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_1_2 ($intake_1_2_value) IF (ToNum( $intake_1_2_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_2=ToNum( $intake_1_2_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_1_3 ($intake_1_3_value) IF (ToNum( $intake_1_3_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_3=ToNum( $intake_1_3_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_1_4 ($intake_1_4_value) IF (ToNum( $intake_1_4_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_4=ToNum( $intake_1_4_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_1_5 ($intake_1_5_value) IF (ToNum( $intake_1_5_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_1_5=ToNum( $intake_1_5_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_2_1 ($intake_2_1_value) IF (ToNum( $intake_2_1_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_1=ToNum( $intake_2_1_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_2_2 ($intake_2_2_value) IF (ToNum( $intake_2_2_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_2=ToNum( $intake_2_2_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_2_3 ($intake_2_3_value) IF (ToNum( $intake_2_3_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_3=ToNum( $intake_2_3_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_2_4 ($intake_2_4_value) IF (ToNum( $intake_2_4_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_4=ToNum( $intake_2_4_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_2_5 ($intake_2_5_value) IF (ToNum( $intake_2_5_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_2_5=ToNum( $intake_2_5_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_3_1 ($intake_3_1_value) IF (ToNum( $intake_3_1_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_1=ToNum( $intake_3_1_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_3_2 ($intake_3_2_value) IF (ToNum( $intake_3_2_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_2=ToNum( $intake_3_2_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_3_3 ($intake_3_3_value) IF (ToNum( $intake_3_3_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_3=ToNum( $intake_3_3_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_3_4 ($intake_3_4_value) IF (ToNum( $intake_3_4_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_4=ToNum( $intake_3_4_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_3_5 ($intake_3_5_value) IF (ToNum( $intake_3_5_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_3_5=ToNum( $intake_3_5_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_4_1 ($intake_4_1_value) IF (ToNum( $intake_4_1_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_1=ToNum( $intake_4_1_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_4_2 ($intake_4_2_value) IF (ToNum( $intake_4_2_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_2=ToNum( $intake_4_2_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_4_3 ($intake_4_3_value) IF (ToNum( $intake_4_3_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_3=ToNum( $intake_4_3_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_4_4 ($intake_4_4_value) IF (ToNum( $intake_4_4_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_4=ToNum( $intake_4_4_value ); ENDIF Handicap( $KeyFlags,$id ); EndSub Sub config_intake_4_5 ($intake_4_5_value) IF (ToNum( $intake_4_5_value ) > 50) THEN PrivMsg ("^1Value can't be above 50, value won't be changed"); ELSE $intake_4_5=ToNum( $intake_4_5_value ); ENDIF Handicap( $KeyFlags,$id ); 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<=$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 $number_of_classes=""; $number_of_cars=""; Handicap( $KeyFlags,$id ); 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,$id ); 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,$id ); EndSub Sub handicap_gui_force( $KeyFlags,$id ) $counter_intake = 0; $counter_mass = 0; FOR ($i=1;$i<=32;$i=$i+1) IF ($user_array[$i,1] == GetCurrentPlayerVar( "UserName" ) ) THEN IF ($user_array[$i,9] == "^s1" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s2" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s3" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s4" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s5" && GetCurrentPlayerVar("Car") == $car_1) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s1" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s2" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s3" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s4" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s5" && GetCurrentPlayerVar("Car") == $car_2) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s1" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s2" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s3" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s4" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s5" && GetCurrentPlayerVar("Car") == $car_3) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s1" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s2" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s3" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s4" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 IF ($user_array[$i,9] == "^s5" && GetCurrentPlayerVar("Car") == $car_4) THEN IF (GetCurrentPlayerVar("P_Tres") < $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 IF (GetCurrentPlayerVar("P_Mass") < $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 ENDFOR 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; $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $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,$id ); privMsg ("^7Handicap settings loaded" ); EndSub Sub handicap_gui_save( $KeyFlags,$id ) $storage_name = "HCS_".$server_name; SetStoredValue( $storage_name . "number_of_classes", $number_of_classes ); SetStoredValue( $storage_name . "number_of_cars", $number_of_cars ); 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"); closePrivButton("handicap_number_of_classes"); closePrivButton("handicap_number_of_classes_input"); closePrivButton("handicap_number_of_cars"); 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