The online racing simulator
Just change the i to something else (everywhere you wanted that i), another variable is already named 'i'

Also, the for loop itself is fubbered. It's aim is to cycle through each player, so there's no point defining it as a player
well i changed it, but like u said, still not fixed
just found it,
its doubled,
its their twice, deleting 1 line fixed it
Which is basically what I said...why doesn't anyone read my highly informative posts
well, i've been setting up my !pitlane thing, (did it for someone else, but use it too)
the pitlane isnt much of a use since they can just pit.
so, how do i found out if they pit?
is it like to detect the /pitlane command or so?
i haven't figured it out...
thanks
When someone pits (shift+p), a PLP packet is sent. But don't take my word for it! Wait for someone else to reply, or check insim.txt
well, copied this code afaik i'm missing some code to make it work
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);
}

this is just to make the speed appear,
alltho, any button i make with MCI, doesnt appear, no error
the loop is wrong? try with this, change

for (int i = (MCI.Info[0].PLID); i < Players.Count; i++)
{

for (int i = 0; i < Players.Count; i++)
{

Other problem possible is wrong ID
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID

You can't put a for loop inside a foreach loop like that. Well, you can hypothetically, but it's utterly pointless. A foreach loop is a sophisticated for loop, nothing more. Get rid of the foreach loop, the for loop is much handier for cycling through MCI packets received...

It isn't displaying buttons because you're not sending it to the right ID. Actually, you're trying to send it to a PLID there, which won't work. You need to send it to a UCID...C# doesn't see a problem with the code (it doesn't care who you're sending it to...), so it doesn't give an error. Also, change "int i = (MCI.Info[0].PLID)" to "int i = 0". Setting it to a PLID will cause lots of problems when you have more than one player in the server...

Basically, try and learn C# before asking for help with copied code...then you can write your own non-copied code [OT] Reminds me of the time I copied my neighbour's Irish assignment, only to get a lower mark than him...The teacher said his grammar was better Damn lazy Irish teachers... [/OT]

E: Damn I'm slow today :/
well, all fixed, allso got 'streetnames'
tomorrow ill do, that if speed += 120
then something wil happen...
but i'm tired
ok, i'm helping bose with a bit of code.
for cop system, for now we have, if the number of players is greater then 2 and smaller then 4 then buttons
button 1
button 2
button 3
button 4
what we need and wont go, is: number of buttons = number of connections.
how could we do this?
the buttons show the playernames + speed, and when clicked on something happens, but that works
just number of buttons = number of connections wont go, is this possible or do we need a new system
byte ButtonID = 5; // Replace 5 with whatever you want the ID of the first button to be...
byte ButtonX = 20; // Or whatever you want the first button to be...

for (int i = 0; i < Players.Count; i++)
{
// Make a new button here, with ButtonX as the X value, and ButtonID as the UniqueID...
ButtonID++;
ButtonX += 6; //Replace 6 with the height of each button + 1
}

That's what I would recommend, maybe have that in a timer or something, so it updates every couple of seconds or whatever...
strange but true, it works for one player, doesnt add buttons, and its all done right

if (Players[GetPlyIdx(MCI.Info[i].PLID)].PlayerName.Contains("Officer"))
{
byte ButtonID = 2; // Replace 5 with whatever you want the ID of the first button to be...
byte ButtonX = 20; // Or whatever you want the first button to be...

{

InSim.Send_BTN_CreateButton("" + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[1].PLID)].UniqueID)].PlayerName + " ^7speed : ^3" + (MCI.Info[i].Speed / 91), Flags.ButtonStyles.ISB_DARK, 6, 30, 163, 5, 200, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 2, false);
ButtonID++;
ButtonX += 6; //Replace 6 with the height of each button + 1
InSim.Send_BTN_CreateButton("" + Connections.Count, Flags.ButtonStyles.ISB_DARK, 6, 20, 100, 5, 120, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 2, false);
}

what is the X value?
X is how far across the screen the button is...


"Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[1].PLID)].UniqueID)].PlayerName" is your problem...replace 1 with i and try it then...The reason it's not displaying is because you're either sending it to the wrong ID, which is fine in the example, or because the button ID is wrong. If you're using the cruise tutorial, buttons 1 - 4 are used IIRC. Try it with 10 or something, assuming you have no buttons added yourself...

Also, you can't do the .PlayerName check without making another for loop inside that one...

You also have to use the ButtonX and ButtonID values in the button...like this:

InSim.Send_BTN_CreateButton("" + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[1].PLID)].UniqueID)].PlayerName + " ^7speed : ^3" + (MCI.Info[i].Speed / 91), Flags.ButtonStyles.ISB_DARK, 6, 30, 163, ButtonX, ButtonID, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 2, false);

Quote from dougie-lampkin :X is how far across the screen the button is...


"Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[1].PLID)].UniqueID)].PlayerName" is your problem...replace 1 with i and try it then...The reason it's not displaying is because you're either sending it to the wrong ID, which is fine in the example, or because the button ID is wrong. If you're using the cruise tutorial, buttons 1 - 4 are used IIRC. Try it with 10 or something, assuming you have no buttons added yourself...

Also, you can't do the .PlayerName check without making another for loop inside that one...

okay thanks, let me try

well i have this:
if (Players[GetPlyIdx(MCI.Info[i].PLID)].PlayerName.Contains("Officer"))
{
byte ButtonID = 200; // Replace 5 with whatever you want the ID of the first button to be...
byte ButtonX = 26; // Or whatever you want the first button to be...

{

InSim.Send_BTN_CreateButton("" + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^7speed : ^3" + (MCI.Info[i].Speed / 91), Flags.ButtonStyles.ISB_DARK, 6, 30, 163, 5, 200, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 2, false);
ButtonID++;
ButtonX += 6; //Replace 6 with the height of each button + 1
//InSim.Send_BTN_CreateButton("^7Knoppen^1 " + ButtonX, Flags.ButtonStyles.ISB_DARK, 5, 26, 26, 26, 200, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 2, false);
}

}

wont work :/
what do you mean?
all money goes to 0
or its not saved?
the thing for bose, still doesnt work :s
Quote from racing.xz :It's not saves

there is a code here, wich saves every 5 minutes, search, its here
Quote from racing.xz :and one more problem where in witch file I need to paste a code for example !tow comand

did you find the code for tow?
then just put it with the rest of yoyr code, wich says : case "!help" :
i think it's not possible, because they don't use usernames
if its patch y18, they do
Quote from racing.xz :and one more problem where in witch file I need to paste a code for example !tow comand

open form1.cs
anyone idea's about the officer thing me and 'kiss me' are trying?

FGED GREDG RDFGDR GSFDG