The online racing simulator
DistanceSincePit bug
hey guys i was coding my insim yesterday and when i finish and load the insim its working fine but when i start to test it my bonus is not going back to 0 when i spectate or pit and i loook every in C# and i didnt see anything wrong so pros!! i neeed ur help =)
You basically said nothing more than nothing. Give us some code snippets of where you think the problem comes from. Explain better what this code is supposed to do. And then, eventually, hope on some help. The less info you give, the less the community is able to help you.
ok when i pit the bonus stays where it was at same for when i spectate normaly when i spec or pit it reset to 0 ill some pic
so we are asking for the code not the explanation tho...
#5 - PoVo
facepalm @ skywatcher122 : - D
Well, then reset the DistanceSincePit var when people spectate. And which insim app is this? Because DistanceSincePit is a variable name that I created long back while I was still developing OsC's insim app. And it was pretty buggy, and how could you have gotten it anyway..

Anyway, I'm not going to give you an example in code, because it seems to me that that's the way you like to work. With basic explanations.

hint hint: to be sure that the bonus is always reseted when it has to be, reset it when people leave the pits.
its based on lsc insim

this is for the botton

InSim.Send_BTN_CreateButton("^7Bonus: ^6" + C.DistanceSincePit / 500d + "^6%", Flags.ButtonStyles.ISB_LEFT, 5, 25, 7, 54, 99, C.UniqueID, 2, false);

PLL_PlayerLeavesRace

private void PLL_PlayerLeavesRace(Packets.IS_PLL PLL)
{
try
{
// Your code here

InSim.Send_MST_Message("/msg ^6| " + Connections[GetConnIdx2(PLL.PLID)].PlayerName + " went to spectate");

Connections[GetConnIdx2(PLL.PLID)].PlayerId = 0; // Update Players[] list
// Your code here
}
catch { }
}

// A player goes to the garage (setup screen).

private void PLP_PlayerGoesToGarage(Packets.IS_PLP PLP)
{
try
{
InSim.Send_MST_Message("/msg ^6| " + Connections[GetConnIdx2(PLP.PLID)].PlayerName + " went to pits");

Connections[GetConnIdx2(PLP.PLID)].PlayerId = 0; // Update Players[] list
}
catch { }
}




FGED GREDG RDFGDR GSFDG