The online racing simulator
Got it loaded on my Server now. Great insim btw


Couple of questions,

1. How do you rob the bank
2, How do you close the bank
3. How do you set the speedtrap, (it says trap not set yet)

Thanks
Mick
Mikjen: 3. How do you set the speedtrap, (it says trap not set yet)

first you need stay on duty, and type !settrap SPEEDLIMIT
for example, I want make a speedtrap with 120km/h limit: !settrap 120

Sorry :ashamed:, the others question I can't reply because I wasn't want for my insim.
Thanks Revox, for coming to server and helping how did i know my cop stats was suppose to be ON DUTY


Mick
Couple of questions

1. How do i change the fines for pitting 1500 is a bit high
2. I tried changing the www.yoursite.com in Form.cs using VB but its still the same

Ti
Mick
yea i got the same problem... but when i put !addpolice or !bank it says me Not Authorized i have read the comments but i can't fix it .. help?
For change the pit fine, in packets PLP:
if (Connections[GetConnIdx(Players[GetPlyIdx(PLP.PLID)].UniqueID)].PitOK == 0)
{
InSim.Send_MST_Message("/msg ^1" + Connections[GetConnIdx(Players[GetPlyIdx(PLP.PLID)].UniqueID)].Username + " was fined €1500 for pitting on track");
[B]Connections[GetConnIdx(Players[GetPlyIdx(PLP.PLID)].UniqueID)].Cash -= [U]1500[/U];[/B]
}

For change the web, in the top:
const string Website = "[U][B]www.your.site[/B][/U]";

-
(dougie-lampkin) DELETED by the_angry_angel : Cleaning the thread.
Quote from BOSCHO :yea i got the same problem... but when i put !addpolice or !bank it says me Not Authorized i have read the comments but i can't fix it .. help?

You need modify in groups/police.txt
Officer = username

for example Officer = ReVoX
and you need IN-GAME type !addpolice Username.
Quote :yea i got the same problem... but when i put !addpolice or !bank it says me Not Authorized i have read the comments but i can't fix it .. help?

Have added your name to the police.txt file,

Whilst in game, type !officer YOURNAME and u should be online, i sometimes type !cadet and it does it

Type !officers and it shows ur on duty status


Mick
I really wouldn't advise editing police.txt unless you know what you're doing...it has a particular system of storing names, and it has to be stored like that
-
(ReVoX) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
-
(ReVoX) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
-
(ReVoX) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
-
(dougie-lampkin) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
-
(dougie-lampkin) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
Where can i get the layout ? I want AS5's ,just as a example to understand how it works.thank you...

One more question:

How to defined a drive-lane?

I mean I want ppl drive though a path with the right side.I have checked the code ,and found nothing to define the drive-lane..so pls help me.

PS.......I translated it to simplified-Chinese..it works good in Y20....
Quote from Sheepy1977 :Where can i get the layout ? I want AS5's ,just as a example to understand how it works.thank you...

As I've said, you can't get the layout. It was made privately, so I can't release it.


Quote from Sheepy1977 :How to defined a drive-lane?

I mean I want ppl drive though a path with the right side.I have checked the code ,and found nothing to define the drive-lane..so pls help me.

You can't really do that without a lot of work...InSim allows you to take the XY position of each player, and the current Node of each player. But of course, the tracks aren't all straight lines perpendicular to each other, so using XY would be very hard, and take ages. The Nodes can't split the track in half, they just tell you what "sector" of the track you're in
I just figured out a way to defined a lane.

When a car is in a lane's exit or entry,check the car's angle

.if wrong,the car drive in a wrong side.just like the method that used in checking the direction of pit-lane exit and entry.

Anyway...thank for your code and help!
-
(faster111) DELETED by the_angry_angel : Cleaning the thread.
-
(Mikjen) DELETED by the_angry_angel : Cleaning the thread.
-
(dougie-lampkin) DELETED by the_angry_angel : Cleaning the thread.
-
(Mikjen) DELETED by the_angry_angel : Cleaning the thread.
-
(dougie-lampkin) DELETED by the_angry_angel : Cleaning the thread.
-
(Mikjen) DELETED by the_angry_angel : Cleaning the thread.
-
(dougie-lampkin) DELETED by the_angry_angel : Cleaning the thread.
-
(faster111) DELETED by the_angry_angel : Cleaning the thread.
-
(master_lfs.5101) DELETED by the_angry_angel : Cleaning the thread.
-
(jonny211984) DELETED by the_angry_angel : Cleaning the thread.
-
(dougie-lampkin) DELETED by the_angry_angel : Cleaning the thread.
Quote from dougie-lampkin :Switching to MySQL won't have any effect at all. The only time files are touched is when someone joins the server or leaves the server. They are also backed up every 5 minutes, but again, that's no problem. They're not the problem, it's the MCI array. I did have a look, but it didn't crash for me when I joined a local host 10 times. If it doesn't crash, I can't see what's wrong

Try removing the try-catch statement, and run the app in debug mode. That'll highlight what line it's stopping at.

Well here let me clarify what he was saying.

I switched to MySql just because it is easier to handle then flat files. Also I was getting annoyed that when a person have no cars it doesn't add them to Connections. (Causing many many problems with collisions from a person ingame not being in Connections)

Now there is a 8 Players limit (not connections).

What happens is when you have 9+ people on the track. you have a line like this

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

loop through MCI 9+ times when it itself has only 8 elements. giving you an index out of bounds of array error.

I fixed this by completely rewriting how you handle MCI. (Also my rewrite makes it run faster :P).
-
(Mikjen) DELETED by the_angry_angel : Cleaning the thread.
-
(ReVoX) DELETED by the_angry_angel : Cleaning the thread.
Quote from elmohellno :What happens is when you have 9+ people on the track. you have a line like this

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

loop through MCI 9+ times when it itself has only 8 elements. giving you an index out of bounds of array error.

I fixed this by completely rewriting how you handle MCI. (Also my rewrite makes it run faster :P).

Could you PM me with the changes you made? I'm curious as to what the problem was. If you don't want the fix to be included in this project in the future though, that's no problem. The PM will stay private


Quote from Mikjen :Ok i downloaded the insim again, then opened it in MX visual c#,

Now when i edit and save and then click Build it says build succesful

So i upload the form1.cs to my dedi, and it still doesnt change anything in LFS,

So close but so far lol

Mick

Do you actually know how to use Visual Studio

You have to upload the exe, why is the source even on the server
-
(Mikjen) DELETED by the_angry_angel : Cleaning the thread.
-
(Mikjen) DELETED by the_angry_angel : Cleaning the thread.
there's a bug that really needs fixing :

When a racer starts a client-host (so not a dedi host), that racer becomes the 'host user' that runs the host. This user cannot be banned or kicked, but the insim application doesn't take this into consideration. When the application tries to ban this user for some reason, it ends up in an infinite banning loop. This loop will not ban or kick the user but it will cause ban statistics to be sent to LFS World. This in turn causes an instant 30day master ban for that user.
So this requires fixing. Mostly because this appears to happen quite frequently.

It's very easy to detect whether a user (a connection) is local or remote. When you get an NCN packet, just look at the Flags byte to determine if a connection is a local one or a remote one. Store this flag with every connection and then when the application tries to ban someone, skip the ban if the user is local. Only allow bans on remote connections.

Thanks
Quote from Mikjen :Does anyone know why the Speed doesnt go up in game, and PIT SAFE is green all the time, the money goes up fine..

I uploaded a new .exe just to make sure i hadnt messed a bit of the code ??

Ta
Mick

You have to use AS5, SO4 or BL1.


Quote from Victor :there's a bug that really needs fixing :

When a racer starts a client-host (so not a dedi host), that racer becomes the 'host user' that runs the host. This user cannot be banned or kicked, but the insim application doesn't take this into consideration. When the application tries to ban this user for some reason, it ends up in an infinite banning loop. This loop will not ban or kick the user but it will cause ban statistics to be sent to LFS World. This in turn causes an instant 30day master ban for that user.
So this requires fixing. Mostly because this appears to happen quite frequently.

It's very easy to detect whether a user (a connection) is local or remote. When you get an NCN packet, just look at the Flags byte to determine if a connection is a local one or a remote one. Store this flag with every connection and then when the application tries to ban someone, skip the ban if the user is local. Only allow bans on remote connections.

Thanks

Didn't think of that Victor, I'll sort it now. Thanks for the heads-up Sorry for any trouble it's been causing at ye're end
Until this is rectified..... Just put into the inSim App if the user is an admin, dont pass the banning function call onto him, just give a message instead if you have to do something to this guy offending and remove what ever it is causing the ban. What is it negative cash or something? A simple if<>Then<>rule will take care of this before the /ban call is executed.

or just blame dougie lol
Actually no, the ppl running this should be using dedi host. SERIOUSLY !
Dougie, it would be most appreciated if you could fix what Victor said. The bug has affected me and now I have a global 30 day ban .
Yes, I assumed that those using this would be on dedi's, I didn't even think of this... The only time a /ban was called was at negative cash, and /kick was only called at spectating.

Anyway, here's the fixed version. v1.0.2 has also been modified to include the fix. If you don't want to start again, please make sure to take a look anyway, and then fix your own version...
Attached files
v1.0.3.rar - 1.2 MB - 2052 views
-
(shaun463) DELETED by the_angry_angel : Cleaning the thread.
-
(Mikjen) DELETED by the_angry_angel : Cleaning the thread.
-
(Victor) DELETED by the_angry_angel : Cleaning the thread.
-
(elmohellno) DELETED by the_angry_angel : Cleaning the thread.
-
(Ca18Slider) DELETED by the_angry_angel : Cleaning the thread.
-
Cant Add Officers, (jackd) DELETED by the_angry_angel : Cleaning the thread.
-
(Evilvan911) DELETED by the_angry_angel : Cleaning the thread.
-
(Mikjen) DELETED by the_angry_angel : Cleaning the thread.
Quote from elmohellno :Ever fix the car renting problem? Just wondering before I spend time fixing.

I don't know what you mean by 'Car renting problem', but there is a little bug I found in LFS_External when I used to use it. I thought It had been fixed, but I just checked and it hasn't. Anyway, Look for the following code in LFS_External....

[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TOC_PlayerCarTakeOver([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Packets[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IS_TOC[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TOC)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2] Players[GetPlyIdx(TOC.OldUCID)].UniqueID = TOC.NewUCID; [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// Update Players[] list[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2] Players[GetPlyIdx(TOC.OldUCID)].PlayerID = TOC.PLID; [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// Update Players[] list[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000] // Your code here[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]}[/SIZE]

Once found, You want to change it to the following....

[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TOC_PlayerCarTakeOver([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Packets[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IS_TOC[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TOC)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2] Players[GetPlyIdx(TOC.PLID)].UniqueID = TOC.NewUCID; [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// Update Players[] list[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2] Players[GetPlyIdx(TOC.PLID)].PlayerName = Connections[GetConnIdx(TOC.NewUCID)].PlayerName; [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// Update Players[] list[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000] // Your code here[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]}[/SIZE]

That should work, Although I don't use LFS_External any more now. So I cant say for sure.

Hope that helps.

[Edit] I'll give T-RonX a little nudge about this when I next catch him, Maybe he can fix it in a future release or something.
Does the playerid change when they take over a vehicle?
-
(dougie-lampkin) DELETED by the_angry_angel : Cleaning the thread.
Quote from dougie-lampkin :I haven't heard of this problem, car taking over is still as LFS_External default in this project...

if you rent more then 1 car, the last person to rent will be effected by everyone that rented before (Fined, money,etc).


lol I rewrote your whole example dougie.

It goes a lot faster if you don't stick 1000 things in MCI receive :P.

I think I'll post an example of how I rewrote the command system in this section later. Anyone interested? It makes it a lot easier to add more commands and keep them organized.
-
(Sheepy1977) DELETED by the_angry_angel : Cleaning the thread.
-
(elmohellno) DELETED by the_angry_angel : Cleaning the thread.
-
(Sheepy1977) DELETED by the_angry_angel : Cleaning the thread.
-
problem with !cadet. (Evilvan911) DELETED by the_angry_angel : Cleaning the thread.
-
(dougie-lampkin) DELETED by the_angry_angel : Cleaning the thread.
-
(Evilvan911) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
-
(ReVoX) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
-
(ReVoX) DELETED by the_angry_angel : Cleaning the thread.
-
(Mikjen) DELETED by the_angry_angel : Cleaning the thread.
-
(ReVoX) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
-
(ReVoX) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
-
(Evilvan911) DELETED by the_angry_angel : Cleaning the thread.
-
(BOSCHO) DELETED by the_angry_angel : Cleaning the thread.
MCI Error
Okay guys i got an error from the LFS_External_Client.exe , a box pop and told me "MCI- L'index se trouve en dehors des limites du tableau." Translated mean "Index goin out of the table limit" or something like that... anyones can help me please thanks you
Quote from Evilvan911 :Okay guys i got an error from the LFS_External_Client.exe , a box pop and told me "MCI- L'index se trouve en dehors des limites du tableau." Translated mean "Index goin out of the table limit" or something like that... anyones can help me please thanks you

People have been reporting this, but it hasn't happened to me. Until it does, I can't fix it. Maybe someone who already fixed it could post an updated version? Shrug

FGED GREDG RDFGDR GSFDG