@@ -10,7 +10,7 @@ public class BicycleCity : Script
10
10
{
11
11
int bikesPercentage ;
12
12
bool aggressiveDrivers ;
13
- int drivingStyle ;
13
+ bool aggressiveCyclists ;
14
14
DateTime lastTime ;
15
15
string [ ] availableBicycles = { "BMX" , "CRUISER" , "FIXTER" , "SCORCHER" , "TRIBIKE" , "TRIBIKE2" , "TRIBIKE3" } ;
16
16
VehicleDrivingFlags customDrivingStyle = VehicleDrivingFlags . AvoidEmptyVehicles |
@@ -26,10 +26,7 @@ public BicycleCity()
26
26
if ( bikesPercentage > 100 )
27
27
bikesPercentage = 100 ;
28
28
aggressiveDrivers = settings . GetValue ( "Main" , "AggressiveDrivers" , false ) ;
29
- if ( aggressiveDrivers )
30
- drivingStyle = ( int ) customDrivingStyle ;
31
- else
32
- drivingStyle = ( int ) DrivingStyle . Normal ;
29
+ aggressiveCyclists = settings . GetValue ( "Main" , "AggressiveCyclists" , false ) ;
33
30
lastTime = DateTime . UtcNow ;
34
31
Tick += OnTick ;
35
32
}
@@ -52,7 +49,7 @@ void OnTick(object sender, EventArgs e)
52
49
{
53
50
canChange . Add ( vehicle ) ;
54
51
if ( aggressiveDrivers )
55
- Function . Call ( Hash . SET_DRIVE_TASK_DRIVING_STYLE , vehicle . Driver , drivingStyle ) ;
52
+ Function . Call ( Hash . SET_DRIVE_TASK_DRIVING_STYLE , vehicle . Driver , ( int ) customDrivingStyle ) ;
56
53
}
57
54
}
58
55
int toChange = ( bicycles + canChange . Count ) * bikesPercentage / 100 - bicycles ;
@@ -77,7 +74,8 @@ void OnTick(object sender, EventArgs e)
77
74
newVehicle . MaxSpeed = 10 ;
78
75
canChange [ i ] . Delete ( ) ;
79
76
driver . SetIntoVehicle ( newVehicle , VehicleSeat . Driver ) ;
80
- Function . Call ( Hash . TASK_VEHICLE_DRIVE_WANDER , driver , newVehicle , ( float ) random . Next ( 4 , 8 ) , drivingStyle ) ;
77
+ Function . Call ( Hash . TASK_VEHICLE_DRIVE_WANDER , driver , newVehicle , ( float ) random . Next ( 4 , 8 ) ,
78
+ aggressiveCyclists ? ( int ) customDrivingStyle : ( int ) DrivingStyle . Normal ) ;
81
79
Function . Call ( Hash . SET_PED_KEEP_TASK , driver , true ) ;
82
80
driver . MarkAsNoLongerNeeded ( ) ;
83
81
newVehicle . MarkAsNoLongerNeeded ( ) ;
0 commit comments