// Detailed car information packet (max 8 per packet)
private void MCI_CarInformation(Packets.IS_MCI MCI)
{
int idx = 0;
for (int i = 0; i < Connections.Count; i++)
{
idx = GetConnIdx2(MCI.Info[i].PLID);
Connections[idx].CompCar.AngVel = MCI.Info[i].AngVel; //They aren't structures so you cant serialize!
Connections[idx].CompCar.Direction = MCI.Info[i].Direction;
Connections[idx].CompCar.Heading = MCI.Info[i].Heading;
Connections[idx].CompCar.Info = MCI.Info[i].Info;
Connections[idx].CompCar.Lap = MCI.Info[i].Lap;
Connections[idx].CompCar.Node = MCI.Info[i].Node;
Connections[idx].CompCar.PLID = MCI.Info[i].PLID;
Connections[idx].CompCar.Position = MCI.Info[i].Position;
Connections[idx].CompCar.Speed = MCI.Info[i].Speed;
Connections[idx].CompCar.X = MCI.Info[i].X;
Connections[idx].CompCar.Y = MCI.Info[i].Y;
Connections[idx].CompCar.Z = MCI.Info[i].Z;
MCI_Update(MCI.Info[i].PLID); //We want everyone to update before checking them.
}
}
int year = DateTime.Now.Year * 365;
int month = DateTime.Now.Month * 30;
int day = DateTime.Now.Day;
int Date = year + month + day;
if ((C.InitialBonus) >= 100) // 100 is the proc, so you can have bars and lines with this
{
C.OLap += 20;
C.OBonus += 2000;
C.InitialBonus = 0;
InSim.Send_MTC_MessageToConnection("^3You've got " + (C.OBonus) + "$ a bonus for " + (C.OLap) + " laps on the track", (C.UniqueID), 0);
C.Cash += (C.OBonus);
if ((C.BDistance) >= 1760) // At 1,76 km you will get +1 bonus proc, you can change it
{
C.BDistance -= 1760;
C.InitialBonus += 1;
}
Conn.BDistance += Convert.ToInt32(SpeedMS); // And dont forget this
}
Error 12 Cannot modify the return value of 'LFS_External_Client.clsPlayer.CompCar' because it is not a variable D:\lfs\lfs_external_csf11\Form1.cs 1947 21 lfs_external_csf11
NCN - Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
NPL - Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index