// MCI Update
private void MCI_Update(int PLID)
{
try
{
#region ' UniqueID Loader '
int IDX = -1;
for (int i = 0; i < Connections.Count; i++)
{
if (Connections[i].PlayerID == PLID)
{
IDX = i;
break;
}
}
if (IDX == -1)
return;
clsConnection Conn = Connections[IDX];
clsConnection ChaseCon = Connections[GetConnIdx(Connections[IDX].Chasee)];
clsConnection TowCon = Connections[GetConnIdx(Connections[IDX].Towee)];
#endregion
#region ' Cruise '
decimal SpeedMS = (decimal)(((Conn.CompCar.Speed / 32768f) * 100f) / 2);
decimal Speed = (decimal)((Conn.CompCar.Speed * (100f / 32768f)) * 3.6f);
Conn.TotalDistance += Convert.ToInt32(SpeedMS);
Conn.TripMeter += Convert.ToInt32(SpeedMS);
Conn.BonusDistance += Convert.ToInt32(SpeedMS);
Conn.HealthDist += Convert.ToInt32(SpeedMS);
Conn.UpgradeLicence += Convert.ToInt32(SpeedMS);
#endregion
#region ' CompCar Details '
var kmh = Conn.CompCar.Speed / 91;
var mph = Conn.CompCar.Speed / 146;
var direction = Conn.CompCar.Direction / 180;
var node = Conn.CompCar.Node;
var pathx = Conn.CompCar.X / 196608;
var pathy = Conn.CompCar.Y / 196608;
var pathz = Conn.CompCar.Z / 98304;
var angle = Conn.CompCar.AngVel / 30;
string Car = Conn.CurrentCar;
#endregion
#region ' Track B '
switch (TrackName)
{
case "BL1":
#region ' Wrong Exit fines '
{
// Pit EXIT
if (pathx >= -27 && pathx <= -24 && pathy >= 65 && pathy <= 67)
{
if (Conn.ExitZone == 0)
{
if ((!Conn.IsOfficer || !Conn.IsCadet) && !Conn.InChaseProgress)
{
if (direction > 330 || direction < 20)
{
MsgAll("^6»^7 " + Conn.NoColPlyName + " was fined ^1€500 ^7for wrong exit");
MsgPly("^6»^7 Next time you'll be kicked!", Conn.UniqueID);
Conn.Cash -= 500;
Conn.WrongWay += 1;
Conn.ExitZone = 2;
}
if (Conn.WrongWay == 2)
{
MsgPly("^6»^1 You are kicked for using WRONG exit!", Conn.UniqueID);
KickID(Conn.Username);
}
}
}
}
else
{
if (Conn.ExitZone == 2)
{
Conn.ExitZone = 0;
}
}
// Pit ENTRY
if (pathx >= -23 && pathx <= -21 && pathy >= -39 && pathy <= -35)
{
if (Conn.ExitZone == 0)
{
if (direction < 100)
{
MsgAll("^6»^7 " + Conn.NoColPlyName + " was spec & fined ^1€500 ^7for wrong entry");
Conn.Cash -= 500;
SpecID(Conn.PlayerName);
SpecID(Conn.Username);
Conn.WrongWay += 1;
Conn.ExitZone = 1;
}
if (Conn.WrongWay == 2)
{
MsgPly("^6»^7 You are kicked for using WRONG entry!", Conn.UniqueID);
KickID(Conn.Username);
}
}
}
else
{
if (Conn.ExitZone == 1)
{
Conn.ExitZone = 0;
}
}
}
#endregion
break;
}
#endregion
}
catch { }
}
var Conn = Connections[GetConnIdx(MSO.UCID)];
{
if (Conn.IsAdmin == 1 || Conn.IsSuperAdmin == 1)
{
string Announce = Msg.Remove(0, +5);
InSim.Send_BTN_CreateButton("^1Admin Announcement:", Flags.ButtonStyles.ISB_DARK, 20, 50, 50, 75, 190, 255, 2, false);
InSim.Send_BTN_CreateButton("^1" + Announce, Flags.ButtonStyles.ISB_DARK, 11, 150, 70, 25, 192, 255, 2, false);
}
}
var Conn = Connections[GetConnIdx(MSO.UCID)];
if (StrMsg.Length > 1)
{
if (Conn.Username.ToLower() == "heawy" || Conn.IsSuperAdmin == 1)
{
string Message = Msg.Remove(0, 4);
foreach (clsConnection C in Connections)
{
InSim.Send_BTN_CreateButton(Message, Flags.ButtonStyles.ISB_DARK, 15, 109, 55, 46, 10, C.UniqueID, 2, true);
InSim.Send_MST_Message("/rcm ^1 Admin Announcement:");
InSim.Send_MST_Message("/rcm_all");
}
}
else
{
MsgPly("^7Not Authorized", (MSO.UCID));
}
}
else
{
MsgPly("^7Invalid Command.", (MSO.UCID));
}