This still allows them to send messages. I want it to block the message from being sent, but I can't find any solution for this.
private void ButtonClicked(InSim insim, IS_BTC BTC)
{
try
{
insim.Send(new IS_BTC { Text = "Test", BStyle = ButtonStyles.ISB_CLICK | ButtonStyles.ISB_LIGHT, UCID = 0, H = 6, W = 30, T = 30, L = 80, ClickID = 6, ReqI = 6});
if(BTC.ClickID == 6)
{
insim.Send(UCID, 0, "abc123");
}
}
catch { }
}
foreach (CompCar car in MCI.Info)
{
if(car.X == -102 | car.Y == -42)
{
insim.Send("/msg Hello");
}
}
void MsgBox(string MsgStr)
{
try
{
textBox1.Text += " [" + System.DateTime.Now.Hour + ":" + System.DateTime.Now.Minute + "] " + MsgStr + "\r\n";
}
catch { }
}
string Msg = MSO.Msg.Substring(MSO.TextStart, (MSO.Msg.Length - MSO.TextStart));
string[] StrMsg = Msg.Split(' ');
#region ' Box Remove Colors String '
string boxy;
boxy = MSO.Msg;
if (boxy.Contains("^0"))
{
boxy = boxy.Replace("^0", "");
}
if (boxy.Contains("^1"))
{
boxy = boxy.Replace("^1", "");
}
if (boxy.Contains("^2"))
{
boxy = boxy.Replace("^2", "");
}
if (boxy.Contains("^3"))
{
boxy = boxy.Replace("^3", "");
}
if (boxy.Contains("^4"))
{
boxy = boxy.Replace("^4", "");
}
if (boxy.Contains("^5"))
{
boxy = boxy.Replace("^5", "");
}
if (boxy.Contains("^6"))
{
boxy = boxy.Replace("^6", "");
}
if (boxy.Contains("^7"))
{
boxy = boxy.Replace("^7", "");
}
if (boxy.Contains("^8"))
{
boxy = boxy.Replace("^8", "");
}
if (boxy.Contains("| "))
{
boxy = boxy.Replace("| ", "");
}
MsgBox(boxy);
#endregion
private void MCI_CarInformation(InSim insim, IS_MCI MCI)
{
try
{
int idx = 0;
for (int i = 0; i < MCI.NumC; i++)
{
idx = GetConnIdx2(MCI.Info[i].PLID); //They aren't structures so you cant serialize!
Connections[idx].compcar.AngVel = MCI.Info[i].AngVel;
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;
}
for (int i = 0; i < MCI.NumC; i++) //We want everyone to update before checking them.
{
MCI_Update(MCI.Info[i].PLID);
}
}
catch { }
}
public struct CarPack
{
public short AngVel;
public ushort Direction;
public ushort Heading;
public CompCarFlags Info;
public ushort Lap;
public ushort Node;
public ushort Speed;
public byte PLID;
public byte Position;
public int X;
public int Y;
public int Z;
}
public CarPack compcar = new CarPack();
public struct CarPack
{
public int AngVel;
public int Direction;
public int Heading;
public CompCarFlags Info;
public int Lap;
public int Node;
public int Speed;
public int PLID;
public int Position;
public int X;
public int Y;
public int Z;
}