The online racing simulator
Searching in All forums
(19 results)
smcsc
Demo licensed
Quote from MadCatX :Run the app from MSVS in debugging mode, it'll show you where in the code you hit this error.

thanks.
smcsc
Demo licensed
I think the error is in code what can I do to fix it?
smcsc
Demo licensed
Now I would start my cruise insim and gave me this error what can I do?

http://img23.imageshack.us/img23/4331/erromv.jpg

i go translate to english the error:

"MSO - Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: Index"
Last edited by smcsc, .
smcsc
Demo licensed
the full code of my bank.


// City Bank
int BankDist = ((int)Math.Sqrt(Math.Pow(Conn.CompCar.X - (-208 * 196608), 2) + Math.Pow(Conn.CompCar.Y - (-70 * 196608), 2)) / 65536);
if (BankDist < 10 && (Conn.CompCar.Speed / 147) <= 3)
{

if (Conn.InBank == 0)
{
// <<Bank Display>>
InSim.Send_BTN_CreateButton("", Flags.ButtonStyles.ISB_DARK, 50, 100, 50, 50, 160, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("", Flags.ButtonStyles.ISB_DARK, 50, 100, 50, 50, 161, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Welcome to City ^6Bank", Flags.ButtonStyles.ISB_LIGHT, 7, 98, 51, 51, 162, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Your bank balance is ^6€" + Conn.BankBalance, Flags.ButtonStyles.ISB_LEFT, 4, 40, 65, 54, 163, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Time until Bonus ^6" + Conn.Timer + "^6 Minute(s)", Flags.ButtonStyles.ISB_LEFT, 4, 40, 69, 54, 164, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^6Insert", "Enter amount to Insert", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 54, 54, 165, Conn.UniqueID, 40, false);
InSim.Send_BTN_CreateButton("^6Withdraw", "Enter amount to Withdraw", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 64, 64, 166, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7CLOSE", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 92, 95, 167, Conn.UniqueID, 2, false);
Conn.InBank = 1;
}
}

else if (BankDist > 14 && Conn.InBank == 1)
{
Conn.InBank = 0;
// <<Bank Display Removal>>
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 160, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 161, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 162, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 163, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 164, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 165, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 166, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 167, Conn.UniqueID);
}

smcsc
Demo licensed
And now what is the problem because the bank does not appear on the screen?

smcsc
Demo licensed
now the error is in X and Y

smcsc
Demo licensed
hello,

i know something about programmation but i need help with health, jobs and settrap.
I am willing to learn even if it takes a long time, MadCatX you help me? Even need help, I'm doing everything to learn. I'm still young so I still have much to learn.
smcsc
Demo licensed
and now?

smcsc
Demo licensed
bronken the peugeot206 is my brother. you have problems?
smcsc
Demo licensed
the error is:



DarkKostas i can´t use that program because i don´t know how i use him.
Last edited by smcsc, .
smcsc
Demo licensed
My problem is the Conn.BustedTime, Conn.PlayerName, (so it's all with conn.). What do I do?
smcsc
Demo licensed
the conn.compcar gives an error


// City Bank
int BankDist = ((int)Math.Sqrt(Math.Pow(Conn.CompCar.X - (296 * 196608), 2) + Math.Pow(Conn.CompCar.Y - (-331 * 196608), 2)) / 65536);
if (BankDist < 4 && (Conn.CompCar.Speed / 147) <= 3)
{

if (Conn.InBank == 0)
{
// <<Bank Display>>
InSim.Send_BTN_CreateButton("", Flags.ButtonStyles.ISB_DARK, 50, 100, 50, 50, 160, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("", Flags.ButtonStyles.ISB_DARK, 50, 100, 50, 50, 161, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Welcome to City ^6Bank", Flags.ButtonStyles.ISB_LIGHT, 7, 98, 51, 51, 162, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Your bank balance is ^6€" + Conn.BankBalance, Flags.ButtonStyles.ISB_LEFT, 4, 40, 65, 54, 163, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Time until Bonus ^6" + Conn.Timer + "^6 Minute(s)", Flags.ButtonStyles.ISB_LEFT, 4, 40, 69, 54, 164, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^6Insert", "Enter amount to Insert", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 54, 54, 165, Conn.UniqueID, 40, false);
InSim.Send_BTN_CreateButton("^6Withdraw", "Enter amount to Withdraw", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 64, 64, 166, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7CLOSE", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 92, 95, 167, Conn.UniqueID, 2, false);
Conn.InBank = 1;
}
}

else if (BankDist > 14 && Conn.InBank == 1)
{
Conn.InBank = 0;
// <<Bank Display Removal>>
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 160, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 161, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 162, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 163, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 164, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 165, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 166, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 167, Conn.UniqueID);
}

what i do?
all conn. gives an error
Last edited by smcsc, .
smcsc
Demo licensed
yes, I am doing the program in microsoft visual studio 2010, what I really wanted was for the counter of health to work with the players, for example starts at 100% and goes down to 99% and continuing up to zero is that I want.
the code is for a cruise insim.
Last edited by smcsc, .
smcsc
Demo licensed
hello again,

What is missing for when players pass by the radar speeding deduct the money directly.


case "!settrap":
if (StrMsg.Length == 2)
{
if (Connections[GetConnIdx(MSO.UCID)].IsOfficerORCadet == 1)
{
try
{
if (Convert.ToInt32(StrMsg[1]) > 0)
{
Connections[GetConnIdx(MSO.UCID)].TrapSpeed = Convert.ToInt32(StrMsg[1]);
TrapUCID = MSO.UCID;
TrapSet = 1;
}
else
{
InSim.Send_MTC_MessageToConnection("^1Trap Error. Speed cannot be 0", MSO.UCID, 0);
}
}
catch
{
InSim.Send_MTC_MessageToConnection("^1Trap Error", MSO.UCID, 0);
}
}
}
if (StrMsg.Length == 1 && TrapSet == 0)
{
if (Connections[GetConnIdx(MSO.UCID)].TrapSpeed > 0)
{
Connections[GetConnIdx(MSO.UCID)].TrapSpeed = 0;
Connections[GetConnIdx(MSO.UCID)].TrapX = 0;
Connections[GetConnIdx(MSO.UCID)].TrapY = 0;
InSim.Send_MTC_MessageToConnection("^6>^1 Trap Removed", MSO.UCID, 0);
}
else
{
InSim.Send_MTC_MessageToConnection("^6>^7 Trap not yet set", MSO.UCID, 0);
}
}
if (StrMsg.Length > 2)
{
InSim.Send_MTC_MessageToConnection("^6>^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;

smcsc
Demo licensed
I only have this code.. can you help me with this ?
what is the problem? Help me
smcsc
Demo licensed
Hi racers,

The code of the health don´t down of 100%, what is the problem ?


// When health < 1% we give Doctors bill
if (C.LastDistanceUpdate != C.TotalDistance)
{
if (C.PlayerName == "host")
{
}
else if (C.Health < 1)
{
InSim.Send_MST_Message("/msg " + C.PlayerName + "^7 paid €500 Doctors Clark!");
C.Health = 100;
C.Cash -= 500;
}
}

smcsc
Demo licensed
but my insim cruise is almost ready, just need jobs, health and licenses.
I'm not able to do that, because it's my first insim liked to help me.
code for health and for licenses
smcsc
Demo licensed
Hi racers again,

Anyone have the code for health and for licenses to insim of me for a cruise?
The licenses is so for example reaches 200 km and can buy xfg XRT. With 1800km passes to cadet. At 5000km is the officer and so on. Also, each license has a name.
Can anyone help me?
i have a problem with my cruise insim
smcsc
Demo licensed
I've been slowly creating a cruise insim but I'm with problems, in creating of locations, such as food, bank, lotto and more. As I do that?

greetings
Sandro Santos
Last edited by smcsc, .
FGED GREDG RDFGDR GSFDG