The online racing simulator
anyone have a fix for it? *bump *
oh yeah of course the code here it is
foreach (clsPlayer Ply in Players)
for (int i = (MCI.Info[0].PLID); i < Players.Count; i++)
{
InSim.Send_BTN_CreateButton((MCI.Info[i].Speed / 145) + "MPH", Flags.ButtonStyles.ISB_DARK, 5, 20, 80, 170, 110, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 111, false);
InSim.Send_BTN_CreateButton((MCI.Info[i].Speed / 91) + "KM/H", Flags.ButtonStyles.ISB_DARK, 5, 20, 85, 170, 112, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 113, false);
InSim.Send_BTN_CreateButton("^1X: " + (MCI.Info[i].X), Flags.ButtonStyles.ISB_DARK, 5, 20, 90, 170, 114, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 115, false);
InSim.Send_BTN_CreateButton("^2Y: " + (MCI.Info[i].Y), Flags.ButtonStyles.ISB_DARK, 5, 20, 95, 170, 116, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 117, false);
InSim.Send_BTN_CreateButton("^7Section: " + (MCI.Info[i].Node), Flags.ButtonStyles.ISB_DARK, 5, 20, 100, 170, 118, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 119, false);
if ((MCI.Info[i].Node >= 136) && (MCI.Info[i].Node <= 188))
InSim.Send_BTN_CreateButton("^2Location: CorkScrew", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 188) && (MCI.Info[i].Node <= 230))
InSim.Send_BTN_CreateButton("^2Location: Sharpe Corner", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 230) && (MCI.Info[i].Node <= 288))
InSim.Send_BTN_CreateButton("^2Location: Vane Lane", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 288) && (MCI.Info[i].Node <= 320))
InSim.Send_BTN_CreateButton("^2Location: The HammerHead", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 320) && (MCI.Info[i].Node <= 360))
InSim.Send_BTN_CreateButton("^2Location: Road 328", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 360) && (MCI.Info[i].Node <= 407))
InSim.Send_BTN_CreateButton("^2Location: Drift Corner", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 407) && (MCI.Info[i].Node <= 491))
InSim.Send_BTN_CreateButton("^2Location: Road 485", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 491) && (MCI.Info[i].Node <= 581))
InSim.Send_BTN_CreateButton("^2Location: The Curves", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 581) && (MCI.Info[i].Node <= 691))
InSim.Send_BTN_CreateButton("^2Location: The Big W", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 0) && (MCI.Info[i].Node <= 34))
InSim.Send_BTN_CreateButton("^2Location: The Big W", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
if ((MCI.Info[i].Node >= 34) && (MCI.Info[i].Node <= 136))
InSim.Send_BTN_CreateButton("^2Location: The Dire Straits", Flags.ButtonStyles.ISB_DARK, 10, 40, 70, 150, 120, MCI.Info[GetConnIdx(Ply.PlayerID)].PLID, 121, false);
}

i tried millions of combinations but it never worked :s
Help, mines absolutely faffed up! I had 2 errors first now its back on 11!
#204 - sun
what are the errors ?

we cant help you unless we know.
post the code up
Quote from sun :what are the errors ?

we cant help you unless we know.

So do you see our point then?
#207 - sun
/me moves my hand really fast over my head and makes a whooshing noise...
I would prefer to send the code by pm.
#210 - sun
Quote from shaun463 :I would prefer to send the code by pm.

yes, actually that would be better because people wont copy your code
but if sun can correct it, anyone could correct it
I think it'd be easier to just find the code sample that he's copy-pasting from.
I want to point out that all of you, each and everyone of you, suck at openness. I would like to also say that the original author, while doing the community good as a whole (I think - Cruise server might not be the best way to do that, but it's a start.), should be commended in one way or another for allowing the sharing of code on this level. I am pretty sure that this was intended to promote the sharing of code, not hinder it and propagate more cruise servers. I mean really what's the point, we have enough of those style servers, and not enough shared though.

Anyway sun fixing two problems in one day, is indeed a day to mark. So good for you sun, keep up the good work.

Quote from dawesdust_12 :I think it'd be easier to just find the code sample that he's copy-pasting from.

Why write code, when you can steal it? The best programmers in the business, will never rewrite code that works and is good already. Why waste your own time? Give him a break, he is improving. He is showing he is willing to do some leg work, encourage this.
i keep getting a problem from this, i have included a screenshot of the debugging problem, could you suggest a place in the code that could be causing it? i have added extra buttons onto the form1 for the admin password and ip address etc

EDIT: when i switched computers it started working :s nevermind about it
Attached images
huh.JPG
I'm editing it so it gives you more options. I will post it up when I'm done to show you
An beginner question. How i can run this. I know /insim=29999, but cant change the admin PW in the insim.
i accidently added a form to my project then deleted it but now i cant debug my project or run it at all, could someone help me?
How i can do, to save the progress ?
Quote from XmaX :How i can do, to save the progress ?

If you check this thread, A few pages back i posted some code that saves the data every 5 minutes.
ahh ok thank you, another question, dont found the answer^^

The command help show all Commands....

but all in line: Commands: !buy, !cash....

How i can do this with more lines?

Commands: !buy - Woth this command you can buy
!cash - .....

? when i onlny press enter after a command is a error
Sorry for my bad english
There is a limit on the number of characers you can put in a message. You'll have to split them up into separate MST or MSX packets (MST cannot exceed 63 characters and MSX cannot exceed 95).
Acutally TAA i think he wants functionanility like the following...

InSim.Send_MTC_MessageToConnection("Line 1", MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("Line 2", MSO.UCID,0);

Quote from mcgas001 :Acutally TAA i think he wants functionanility like the following...

InSim.Send_MTC_MessageToConnection("Line 1", MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("Line 2", MSO.UCID,0);


yee thx it works
Sun has pointed out a flaw in the CruiseTutorial I posted in the other thread, so I'll upload a new version here. I didn't realise when you're sending cash to a player, it is also supposed to be subtracted from your own amount of cash. Also with this in mind I've commented out the part about only allowing admins to send cash, as now the whole process makes more sense to me. I also added an error message to the InSim connection code, so that it advises the user if the connection to InSim has failed for whatever reason, which seems sensible.
Attached files
CruiseTutorial (With Send Command).zip - 45.7 KB - 273 views
Sorry for the questions ...

I added the code to show how many cash you earn (+2...) but i got a error (pic)

2nd question. I want to add the auto save.

I added already this:

System.Timers.Timer BackUp = new System.Timers.Timer(300000);

void BackUp_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
foreach (clsConnection C in Connections)
FileInfo.UpdateUserLeave(C.Username, C.Cash, C.Cars);
}

but where i have add the other?

Greetz, thx XmaX
Attached images
error.JPG

FGED GREDG RDFGDR GSFDG