The online racing simulator
Cruise Distance Check Problem
Here is the code that checks our total distance:
[COLOR=#0000ff][B]if[/B][/COLOR] (NPL.CName == [COLOR=#0000ff]"XRG"[/COLOR] && Connections[[COLOR=#191970][B]GetConnIdx[/B][/COLOR](NPL.UCID)].TotalDistance / [COLOR=#00008b]1000[/COLOR] <= [COLOR=#00008b]199[/COLOR])
{
InSim.[COLOR=#191970][B]Send_MST_Message[/B][/COLOR]([COLOR=#0000ff]"/spec "[/COLOR] + Connections[[COLOR=#191970][B]GetConnIdx[/B][/COLOR](NPL.UCID)].Username);
[COLOR=#0000ff][B]if[/B][/COLOR] (Connections[[COLOR=#191970][B]GetConnIdx[/B][/COLOR](NPL.UCID)].MilesOrKilometers == [COLOR=#00008b]0[/COLOR])
{
InSim.[COLOR=#191970][B]Send_MTC_MessageToConnection[/B][/COLOR]([COLOR=#0000ff]"^6»^7 You need ^1200km ^7to drive a ^1"[/COLOR] + NPL.CName, NPL.UCID, [COLOR=#00008b]0[/COLOR]);
}

I dont understand this:
TotalDistance / [COLOR=#00008b]1000[/COLOR] <= [COLOR=#00008b]199[/COLOR])

The distance should be 1200 km but....
if my total distance is 100 km
100 / 1000 = 0.1 then if 0.1 mean 100 kilometers i have drive 200 000 km?!
Quote : (NPL.CName == "XRG" && Connections[GetConnIdx(NPL.UCID)].TotalDistance / 1000 <= 199)

I think it's this, Probably im wrong:

If the user distance / 1000 is less or the same as 199 , it will say that message.

Note:
Probably im wrong , but i understand it like that

Ex: User distance == 2000/1000 will be 2 KM , So 2 is less than 199, it will say you need 200km for drive the XRG.

2nd Note: You can try removing the /1000 , just using the TotalDistance.
#3 - PoVo
Quote from xhector :Here is the code that checks our total distance:
[COLOR=#0000ff][B]if[/B][/COLOR] (NPL.CName == [COLOR=#0000ff]"XRG"[/COLOR] && Connections[[COLOR=#191970][B]GetConnIdx[/B][/COLOR](NPL.UCID)].TotalDistance / [COLOR=#00008b]1000[/COLOR] <= [COLOR=#00008b]199[/COLOR])
{
InSim.[COLOR=#191970][B]Send_MST_Message[/B][/COLOR]([COLOR=#0000ff]"/spec "[/COLOR] + Connections[[COLOR=#191970][B]GetConnIdx[/B][/COLOR](NPL.UCID)].Username);
[COLOR=#0000ff][B]if[/B][/COLOR] (Connections[[COLOR=#191970][B]GetConnIdx[/B][/COLOR](NPL.UCID)].MilesOrKilometers == [COLOR=#00008b]0[/COLOR])
{
InSim.[COLOR=#191970][B]Send_MTC_MessageToConnection[/B][/COLOR]([COLOR=#0000ff]"^6»^7 You need ^1200km ^7to drive a ^1"[/COLOR] + NPL.CName, NPL.UCID, [COLOR=#00008b]0[/COLOR]);
}

I dont understand this:
TotalDistance / [COLOR=#00008b]1000[/COLOR] <= [COLOR=#00008b]199[/COLOR])

The distance should be 1200 km but....
if my total distance is 100 km
100 / 1000 = 0.1 then if 0.1 mean 100 kilometers i have drive 200 000 km?!

TotalDistance is meters, so if you divide it by 1000 you have it in kilometers. So if your TotalDistance is smaller than 200, you won't be able to drive the car.

If you manually set your TotalDistance in your user's txt file, you need to write it in meters.

1200km = 1200000 meters.
Quote from PoVo :TotalDistance is meters, so if you divide it by 1000 you have it in kilometers. So if your TotalDistance is smaller than 200, you won't be able to drive the car.

If you manually set your TotalDistance in your user's txt file, you need to write it in meters.

1200km = 1200000 meters.

The best ! Thanks.
You help did't help me BUT i was very mistaken i get ^1200 for 1200 kilometers i did't see the ^1 for color hahahaah omg im sooo BLIND!!!!
Anyway THANK ALL VERY MUCH for HELPING....
I'm noob in this c# and insim thing.. im helping myself with documentation for insim and from lfs forum....
#6 - PoVo
But why should it be 1200km if you wrote smaller or equal to 199? That means that you need 200km and not 1200km.

FGED GREDG RDFGDR GSFDG