Skip to content

Commit 487490a

Browse files
committed
Add AggressiveCyclists option
1 parent b9f997e commit 487490a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

BicycleCity/BicycleCity.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class BicycleCity : Script
1010
{
1111
int bikesPercentage;
1212
bool aggressiveDrivers;
13-
int drivingStyle;
13+
bool aggressiveCyclists;
1414
DateTime lastTime;
1515
string[] availableBicycles = { "BMX", "CRUISER", "FIXTER", "SCORCHER", "TRIBIKE", "TRIBIKE2", "TRIBIKE3" };
1616
VehicleDrivingFlags customDrivingStyle = VehicleDrivingFlags.AvoidEmptyVehicles |
@@ -26,10 +26,7 @@ public BicycleCity()
2626
if (bikesPercentage > 100)
2727
bikesPercentage = 100;
2828
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);
3330
lastTime = DateTime.UtcNow;
3431
Tick += OnTick;
3532
}
@@ -52,7 +49,7 @@ void OnTick(object sender, EventArgs e)
5249
{
5350
canChange.Add(vehicle);
5451
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);
5653
}
5754
}
5855
int toChange = (bicycles + canChange.Count) * bikesPercentage / 100 - bicycles;
@@ -77,7 +74,8 @@ void OnTick(object sender, EventArgs e)
7774
newVehicle.MaxSpeed = 10;
7875
canChange[i].Delete();
7976
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);
8179
Function.Call(Hash.SET_PED_KEEP_TASK, driver, true);
8280
driver.MarkAsNoLongerNeeded();
8381
newVehicle.MarkAsNoLongerNeeded();

BicycleCity/BicycleCity.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[Main]
22
BikesPercentage=50
33
AggressiveDrivers=false
4+
AggressiveCyclists=false

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Replace cars by bikes (GTA V mod)
66
- Put `BicycleCity.dll` and `BicycleCity.ini` in the `Scripts` folder
77
- Optionally, edit `BicycleCity.ini`
88
- Change `BikesPercentage` if you want more or less cars replaced by bikes
9-
- Set `AggressiveDrivers` to `true` if you want drivers to overtake cyclists and other slower vehicles
9+
- Set `AggressiveDrivers` to `true` if you want drivers to overtake slower vehicles
10+
- Set `AggressiveCyclists` to `true` if you want cyclists to overtake slower vehicles
1011

1112
## Download
1213
https://github.com/oldnapalm/BicycleCity/releases/latest

0 commit comments

Comments
 (0)