Okay, so I have come across an issue with my code, and I have absolutely no idea why it crashes the game. So, it happens in my "Stolen Vehicle" callouts whenever the callout is accepted. I know that it deals with these lines of the code below:
// Vehicle Info.
var modelName = SuspectVehicle.Model.Name; // The vehicle's model name.
var vColor = SuspectVehicle.PrimaryColor.ToKnownColor(); // The vehicle's known primary color.
var licensePlateNum = SuspectVehicle.LicensePlate; // The vehicle's license plate number.
Game.DisplayNotification("Respond Code 3! The vehicle is a " + vColor + " " + modelName + " with license plate number " + licensePlateNum); // Display's a notification for the player specifying Response type and a description of the suspect vehicle.
Previously the variables above were set as private readonly strings. And I added a ".ToString()" method to the end of it's assigned values. This didn't help at all. So, I switched it to be vars, hoping the program could sort it automatically (I assume that's why the var type exists). I've even moved the vars outside of the "OnCalloutAccepted" method, that didn't help much at all. Here is what the Log says:
Basically, what I am trying to do with this code is display a notification to notify the player of how to respond (Code 2, Code 3, Code 99, etc.), and give a description of the suspect's vehicle. Since, the player will, more times than not need to search for it. I could really use some help for this.
Thanks,
- OfficerohnnyShumway