########################## #Options for acceleration# ########################## $AccelerationStartSpeed = 1; # At which speed to start measuring time. In km/h $AccelerationEndSpeed = 100; # At which speed to stop measuring time. In km/h $AccelerationStartSpeedMph = 1; # At which speed to start measuring time. In Mph $AccelerationEndSpeedMph = 60; # At which speed to stop measuring time. In Mph $AccelerationPrivateMaxTime = 20; # Maximum acceleration time in seconds to show message #Message to show to players. #Possible variables to use: #{AccelerationStartSpeed} - Starting speed #{AccelerationEndSpeed} - Ending speed #{AccelerationTime} - Acceleration time achieved from start to end speed #{UnitSpeed} Unit of the Speed of the player connected Event OnAcceleration( $userName ) # Player event $NickName = GetCurrentPlayerVar("NickName"); # Set the vars for the acceleration data $maxAccelerationTimes = 6; # How many possible acceleration times are there? $maxCars = 19; # How many possible acceleration times are there? $accelData[0] = "UF1,1,11,12,13,14,15,16"; $accelData[1] = "XFG,1,9,10,11,12,13,14"; $accelData[2] = "XRG,1,8,9,10,11,12,13"; $accelData[3] = "FXO,1,6,7,8,9,10,11"; $accelData[4] = "RB4,1,6,7,8,9,10,11"; $accelData[5] = "XRT,1,6,7,8,9,10,11"; $accelData[6] = "LX4,1,5,6,7,8,9,10"; $accelData[7] = "MRT,1,5,6,7,8,9,10"; $accelData[8] = "UFR,1,5,6,7,8,9,10"; $accelData[9] = "RAC,1,5,6,7,8,9,10"; $accelData[10] = "FZ5,1,5,6,7,8,9,10"; $accelData[11] = "LX6,1,5,6,7,8,9,10"; $accelData[12] = "FBM,1,5,6,7,8,9,10"; $accelData[13] = "FOX,1,4,5,6,7,8,9"; $accelData[14] = "XFR,1,4,5,6,7,8,9"; $accelData[15] = "XRR,1,4,5,6,7,8,9"; $accelData[16] = "FXR,1,4,5,6,7,8,9"; $accelData[17] = "FZR,1,3,4,5,6,7,8"; $accelData[18] = "FO8,1,3,4,5,6,7,8"; $accelData[19] = "BF1,1,3,4,5,6,7,8"; $PlayerCar = GetCurrentPlayerVar("Car"); $PlayerTime = GetCurrentPlayerVar("AccelerationTime"); FOR ($j=0; $j<=$maxCars;$j=$j+1) IF ( ToNum(IndexOf($accelData[$j], $PlayerCar)) >= 0 ) THEN # globalMsg ("DEBUG: accelData = " . $accelData[$j]); $aData = SplitToArray( $accelData[$j],"," ); dumpVar($aData); # Do the following FOR loop in reverse (counting down), so that the buttons only get created once FOR ( $i=$maxAccelerationTimes; $i >= 1; $i=$i-1) IF( ToNum($PlayerTime) > ToNum( $aData[$i]) ) THEN openPrivButton( "adjective",153,46,44,8,6,6,32,langEngine( "%{main_adjective" . $i ."}%", $NickName ) ); openPrivButton( "acceleration",153,60,44,5,4,5,16,langEngine("%{main_acceleration" . $i ."}%", $PlayerCar, GetCurrentPlayerVar("AccelerationEndSpeed"), GetCurrentPlayerVar("UnitSpeed"),$PlayerTime)); BREAK; # Break the FOR loop ENDIF ENDFOR BREAK; # Break the FOREACH loop ENDIF ENDFOR EndEvent # ACCELERATION MESSAGES Lang "EN" main_acceleration1 = "^3How did you get your ^6{0} ^3to reach%nl%^60 ^3to ^6{1} ^3{2} in ^6{3} ^3seconds?"; main_acceleration2 = "^3Great getting your ^6{0} ^3to reach%nl%^60 ^3to ^6{1} ^3 {2} in ^6{3} ^3seconds!"; main_acceleration3 = "^3Only got your ^6{0} ^3to reach%nl%^60 ^3to ^6{1} ^3 {2} in ^6{3} ^3seconds"; main_acceleration4 = "^3Not good only getting your ^6{0} ^3to reach%nl%^60 ^3to ^6{1} ^3 {2} in ^6{3} ^3seconds"; main_acceleration5 = "^3Only getting your ^6{0} ^3to reach%nl%^60 ^3to ^6{1} ^3 {2} in ^6{3} ^3seconds"; main_acceleration6 = "^3You drive a ^6{0}^3. ^3How did you only manage to reach%nl%^60 ^3to ^6{1} ^3 {2} in ^6{3} ^3seconds?"; main_adjective1 = "^7A M A Z I N G" . "%nl%{0}"; main_adjective2 = "^7I N C R E D I B L E" . "%nl%{0}"; main_adjective3 = "^7A V E R A G E" . "%nl%{0}"; main_adjective4 = "^7P A T H E T I C" . "%nl%{0}"; main_adjective5 = "^7P I T I F U L" . "%nl%{0}"; main_adjective6 = "^7D I S M A L" . "%nl%{0}"; EndLang