The online racing simulator
Quote from Lexanom :
if (MSO.Type == UserType.MSO_USER)
{
Msg(MSO.UCID, "sending messages denied");
insim.Send("/kick " + uname);
}

3+ kick = ban

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.
I'm afraid that's not possible.
Hello, I did this button but don't work

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 { }
}

Does anyone know why ? :|
That code as it's written wouldn't even compile, so what's the problem you're having exactly?
Button does not want to appear :/
Quote from ab12 :Button does not want to appear :/

One of the obvious mistakes you're doing is that you're not checking for exceptions. If something goes wrong, your program just ignores the problem and continues.
-
(ab12) DELETED by ab12 : -
Nobody ?
Quote from ab12 :Nobody ?

You need to use your "players" table instead of connections. It's PLID instead of UID Wink
Quote from DarkKostas :
You need to use your "players" table instead of connections. It's PLID instead of UID Wink

Thank you Smile
Hello, please help me a little.
So i have this code but don't work:

foreach (CompCar car in MCI.Info)
{
if(car.X == -102 | car.Y == -42)
{
insim.Send("/msg Hello");
}
}

Quote from ab12 :Hello, please help me a little.
So i have this code but don't work:

foreach (CompCar car in MCI.Info)
{
if(car.X == -102 | car.Y == -42)
{
insim.Send("/msg Hello");
}
}


You'll need to learn programming first before you go into complicated things.
You need to compare if the car is at X AND(&&) Y.
Replace | with &&
Like in iC Source


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

I can't see the messages
Should be "boxy = Msg;" i think.

Or you can just use
MsgBox(StringHelper.StripColors(Msg));

and delete ALL of the "replace" code Wink
Thank you man Smile
Hey i have a problem named "Insim don't update buttons"
I created a new button (clock) but when the time is changed insim don't update the clock in button
-
(LFS Marius LFS) DELETED by LFS Marius LFS
-
(LFS Marius LFS) DELETED by LFS Marius LFS : Solved
Nobody ? Confused
Quote from LFS Marius LFS :Hey i have a problem named "Insim don't update buttons"
I created a new button (clock) but when the time is changed insim don't update the clock in button

It's next to impossible to answer your question when you don't post any code that is supposed to do what you want. You should check that "time changed" event in your application is actually triggered and that you are sending the correct button in the event handler.
Thank you for reply but i solved the problem Smile
Mornin' peeps,

Is this library compatible with visual basic? I prefer not to use C# as I am quite familiar with VB.

Thanks in advance!

~Skoda
Quote from skodaowner :Mornin' peeps,

Is this library compatible with visual basic? I prefer not to use C# as I am quite familiar with VB.

Thanks in advance!

~Skoda

It is .Net, so yes, you can use whatever language you like most.
First post should be clear enough?

"InSim.NET requires .NET Framework 4.5 and is CLS compliant with all .NET languages"
Good morning... i have this code but i have some errors:



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 { }
}


This "MCI_Update(MCI.Info[i].PLID);" is for using heawy's reply (https://www.lfs.net/forum/thread/88537) but i have 5 errors at Direction, Heading, Lap, Node and Speed :|
The error is: Cannot implicitly convert type 'int' to 'ushort'. An explicit conversion exists (are you missing a cast?)
I tried to rename ushort to int (0 errors but the code don't work)

EDIT: here is compcar
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();

I can't be bothered explaining why this is happening, just make everything in CarPack an int and it should work:

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;
}

The code is ultra NOT optimised. The "MCI_Update(MCI.Info[i].PLID);" should be into the first loop, and actually the whole function would be better to be moved at your MCI packet cause now most of your code is dublicated.

FGED GREDG RDFGDR GSFDG