The online racing simulator
Searching in All forums
(18 results)
jto93
S2 licensed
Hello, can someone see whats wrong with this bit of code?
Im trying to make a drift insim, all thats left is to finish the point system.
The problem is that its calculating wrong, it does not stop to count points when it should.

Fart=Speed
Vinkel=Angel

if(Fart>30&&Vinkel>10)
{ Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].NewScore = Convert.ToInt32(0 + (Vinkel * Fart) / 50);
}
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalScore =0 + (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalScore + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].NewScore);
if(Fart<30&&Vinkel<10)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalScore = 0;
}

I think the problem is in the TotalScore, but i cant find out what it is..
hope some of you could help me on this

Edit: i found out what it was, it was the NewScore that did not return to 0, it was stuck at the last value.
Last edited by jto93, .
jto93
S2 licensed
Quote from pab :my w xp crashed ive had w 7 installed happy enough the only prob when i try to load my skins from desk top no matter what way i try i cant load to game help please

What are you talking about?

are you really from england? your English is hard to understand
jto93
S2 licensed
Quote from broken :Good work there.. thinking learners are a rare situation here. Especially ones that re-check their code while waiting for replies instead of making someone else do it for them.

Actually, you're the first one that I, personally see. Good luck with your application and keep it up like this.

I'm just so impressed...

ooo, thanks man
jto93
S2 licensed
Hello!

im trying to learn some C# while making this, so dont shoot me

i have managed to copy/paste the code below:
InSim.Send_BTN_CreateButton("^7Drift Angle: " + Convert.ToInt16((MCI.Info[i].Heading * (180f / 16384f)) - (MCI.Info[i].Direction * (180f / 16384f))), Flags.ButtonStyles.ISB_DARK, 5, 30, 0, 64, 171, (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID), 2, false);

what im trying to do is to show drift angle of car. i think its working a bit, but weird numbers suddenly appear. sorry to bother you guys

EDIT: found the problem... stupid me it wasnt 180f / 16384f but 180f / 32768f
jto93
S2 licensed
I have read abit in this thread now, and i'm acctually getting a bit pissed...
I think all the racer's in here are shouting for no reason, i don't care about what people do in LFS, its still the best DRIVING simulator/game that i know about, and im going to cruise, drift and drag as much as i want with my friends!
I acctually find racing quite fun too, but most of the time i get on a server with A*#?s on it that shouts something like "Go the f*#?ing off this server and learn how to drive" JUST because i wasnt as fast as them.

Its not all the racers, but some of the racers are really bitchy..
jto93
S2 licensed
Quote from Azzano62 :ok /* Tow Bits*/ NewConn.isTow = 0; cant be done as you havent added it to the clsplayer you added it to the clsconnection and you dont need NewConn.isTow = 0; at all

you need something like this Connections[GetConnIdx(MSO.UCID)].isTow = 0; instead of NewConn.isTow = 0;

that was'nt the problem, but i got it right thanks for the help
need help with code
jto93
S2 licensed
now i can't go ON DUTY or OFF DUTY towtruck..

Here's the ClsConnections.cs coding:
/// <summary>Holds information of a connected client to the lfs server</summary>
public class clsConnection
{
//stripped un-needed code

protected byte _canbetow;

//stripped un-needed code

// Tow Bits
protected byte _isTow;



/// <summary>Connection Unique ID</summary>
public byte UniqueID
{
get { return _uniqueid; }
set { _uniqueid = value; }
}

/// <summary>
/// Connections username
/// </summary>
public string Username
{
get { return _username; }
set { _username = value; }
}

/// <summary>
/// Connections player name
/// </summary>
public string PlayerName
{
get { return _playername; }
set { _playername = value; }
}

/// <summary>
/// Connection is admin
/// </summary>
public byte IsAdmin
{
get { return _isadmin; }
set { _isadmin = value; }
}

/// <summary>
/// Bit 2 : remote
/// </summary>
//stripped un-needed code
}
public byte CanBeTow
{
get { return _canbetow; }
set { _canbetow = value; }
}
public byte isTow
{
get { return _isTow; }
set { _isTow = value; }
}
//stripped un-needed code

}

here's the NewConn in form1.cs

// Assign values of new connnnection.
clsConnection NewConn = new clsConnection();
NewConn.CanBeTow = FileInfo.GetUserTow(NCN.UName);

//stripped un-needed code


// Tow Bits
NewConn.isTow = 0;

Connections.Add(NewConn);
}

Here's the !towon command for on/off duty in form1.cs:
case "!towon":
if (StrMsg.Length == 1)
{
if (Connections[GetConnIdx(MSO.UCID)].CanBeTow == 1)
{
if (Connections[GetConnIdx(MSO.UCID)].isTow == 0)
{
Connections[GetConnIdx(MSO.UCID)].isTow = 1; // 1 = Tow
InSim.Send_MST_Message("/msg ^6|^7 " + Connections[GetConnIdx(MSO.UCID)].Username + " is now ^1ON-DUTY ^7Towtruck");
}
else
{
Connections[GetConnIdx(MSO.UCID)].isTow = 0; // 1 = Tow
InSim.Send_MST_Message("/msg ^6|^7 " + Connections[GetConnIdx(MSO.UCID)].Username + " is now ^2OFF-DUTY ^7Towtruck");
}
}
else
{
InSim.Send_MTC_MessageToConnection("^1Not Authorised!", MSO.UCID, 0);
}
}
else
{
InSim.Send_MTC_MessageToConnection("^6|^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;

hope you or someone else could help me, since i came this long
jto93
S2 licensed
Quote from Azzano62 :here is what i think is wrong:

ok first of all you have if (line.Substring(0, 7) == "TowTruck") well its supposed to be 8 so it should be this if (line.Substring(0, 8) == "TowTruck")

thanks, that worked
Need help with some coding
jto93
S2 licensed
Hey, i have made a towtruck group, but there's a problem..

here is what i think is wrong:

static public byte GetUserTow(string Username)
{
StreamReader Sr = new StreamReader(UserInfo + "\\groups\\tow.txt");

string line = null;
while ((line = Sr.ReadLine()) != null)
{
if (line.Substring(0, 7) == "TowTruck")
{
string[] Msg = line.Split('=');
if (Msg[1].Trim() == Username)
{
Sr.Close();
return 1;
}
}
}
Sr.Close();
return 0;
}

and this is the error messages i get when starting the insim:

All Transelated from Norwegian, so not so good, but u get the clue**

Quote :NCN Index and length must refer to a location in the string.
Parameter Name: Lengt

Quote :NCN Can not write data to transport connection: An established connection was aborted by the software on the host.

Quote :NPL - The index was outside the area. It must be non-negative and less than the size of the collection.
Parameter name: index

i hope someone bother to help me
maby i can return you a favour, and host a lfs server
jto93
S2 licensed
Quote from ryansmith1984 :just noticed that on my d link router settings , when i ass lfs as a persmission o open the potrts , it will not add it to current permissions for some reason

any1 had XP with a D link router?

YES i have and its all good! you probably did something wrong when you did set the portforwardings.

you should go to advanced > viritual servers and there u make a new one.

with the port your LFS dedi is using. set both (TCP and UDO) not TCP or UDP

good luck

BTW: is it wireless or cable? wireless won't work when setting up server only cable
jto93
S2 licensed
how big is your line?
jto93
S2 licensed
cant download, browser can't find site

EDIT: found it on lfs database
Last edited by jto93, .
jto93
S2 licensed
ops yeye, im not going to sell or trade my other account anyway.
jto93
S2 licensed
Thank you! you are the best

tell me if you need any space for your downloads anytime..



regards, Jonatan
jto93
S2 licensed
i went to your server, and drove a lap

but how can i make buttons in lapper? i can't find anything like buttons in lapper.

can u help me?

i have now driven 7-9 laps on your server, and have got PB's in separate cars
Quote :Visit Sin'rs, do hotlaps in 3 separate type of vehicles, and you can get the code for free!

Last edited by jto93, .
jto93
S2 licensed
Quote from sinanju :You mean like my picture?

I call it "DriftMaster".

You can try it yourself by going to my server Sin'rs. Click the DriftMaster button at top of screen and follow simple instructions (yes/no).

It's done in Lapper, but there's nothing to say you can't delete most of the Lapper configuration, and just keep the small part you need.

It's set for only the driver to view if he switches it on, but it would be easy to change the code to make it public viewing - but you'd probably have to compete 1 at a time.

PS Everything in Lapper is buttons. Just some have a clear background, so looks like it's just text directly on the screen.

that is something like im watching out for

is it possible for me to get it? you will get an account

add me on msn if you are interested [email protected]

or send me an email: [email protected]
Drift insim simple
jto93
S2 licensed
Hello!

i want to make a simple drift insim for my team to practice on.

but it should be with buttons so no lfs Lapper.

im wondering if anyone can help me with this.. as i can't code so much.
i want it as they have it in 42D DriftWars that insim is simple (i think) and effective.


i need to know how i can get drift angle and how to show it.
plus points


thanks.

can be paid with an account
FGED GREDG RDFGDR GSFDG