PDA

View Full Version : .NET (C#) - Open Source Cruise Server


Pages : 1 [2]

MariusMM
18th June 2009, 10:01
Ok, good. I'll be more precise then :).

This is the current line of code, that displays the KM/H:

InSim.Send_BTN_CreateButton("^7Speed: " + Convert.ToInt16((MCI.Info[i].Speed * (100f / 32768f)) * 3.6f) + "km/h / 80km/h", Flags.ButtonStyles.ISB_DARK, 5, 30, 0, 106, 169, (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID), 2, false);

This is what you need to do:

InSim.Send_BTN_CreateButton("^7Speed: " + Convert.ToInt16((MCI.Info[i].Speed * (100f / 32768f)) * 3.6f * 0.62) + "mp/h / 80mp/h", Flags.ButtonStyles.ISB_DARK, 5, 30, 0, 106, 169, (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID), 2, false);

E: I haven't tested it, but it should work.

opela
18th June 2009, 12:14
Hy where can I found the full command list? Thx the answer.

MariusMM
18th June 2009, 12:21
Do !help in game ;).

opela
18th June 2009, 12:26
I know but I where found the cop commands? :)

MariusMM
18th June 2009, 12:42
If you dont see them !help, then I guess you need to go though the code and check yourself. I can't now, sorry.

a7x-syn-a7x
18th June 2009, 16:55
Ok, good. I'll be more precise then :).

This is the current line of code, that displays the KM/H:

InSim.Send_BTN_CreateButton("^7Speed: " + Convert.ToInt16((MCI.Info[i].Speed * (100f / 32768f)) * 3.6f) + "km/h / 80km/h", Flags.ButtonStyles.ISB_DARK, 5, 30, 0, 106, 169, (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID), 2, false);

This is what you need to do:

InSim.Send_BTN_CreateButton("^7Speed: " + Convert.ToInt16((MCI.Info[i].Speed * (100f / 32768f)) * 3.6f * 0.62) + "mp/h / 80mp/h", Flags.ButtonStyles.ISB_DARK, 5, 30, 0, 106, 169, (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID), 2, false);

E: I haven't tested it, but it should work.


That hasn't actually changed anything ive found :shrug:

MariusMM
18th June 2009, 16:56
What? You know you have to change every single line, with the new code, and then compile it. Have you dont that?

a7x-syn-a7x
18th June 2009, 16:58
Yeah ive found and replaced every single line in it, and compiled it

MariusMM
18th June 2009, 17:03
Show me a screenshot what you got in game when the insim is running then. Just want to check one thing.

a7x-syn-a7x
18th June 2009, 17:06
Here You Go

MariusMM
18th June 2009, 17:07
Yup, I see. You havent changed it to the code I gave you. At least not in the correct place, as it still show's km/h. I changed that to mp/h.

So it's you who have done something wrong. Try recompile it. :shrug:

binladens
19th June 2009, 12:29
Im still having problems with mci.... can any1 tell me how to use that MCI handling patch thats in this forum im sorta lost in the code :D

Shadowww
19th June 2009, 12:52
Im still having problems with mci.... can any1 tell me how to use that MCI handling patch thats in this forum im sorta lost in the code :D
Priekš kam tev vajag demo cruise serveri? :|

broken
19th June 2009, 13:56
Priekš kam tev vajag demo cruise serveri? :|

1st: If you respect everybody in the forums you would say that in english.
2nd: As far as I understand you are asking something that would offend demo users and/or cruisers.

From these 2 I'd like to tell you 2 things:
1: Have some more respect and courage and write that in english.
2: If you don't want everybody to soon start thinking you are a hypocrite then stop offending cruise servers.

Let me give you one example:
But PLEASE, do not allow demoers to be cadets/cops. :x
Whining about who is cop/cadet in a cruise server....
What he said.

If you want to make just another crapuise server, learn to code. [...]
After which this is how you call cruising.

Shadowww
19th June 2009, 15:15
2nd: As far as I understand you are asking something that would offend demo users and/or cruisers.You, Sir, fail at understanding other languages.

broken
19th June 2009, 15:43
You, Sir, fail at understanding other languages.

Yep, especially at languages I've never heard. ;)

a7x-syn-a7x
19th June 2009, 17:47
I Was wondering if it would be possible to add a command that will swap the speed shown for users e.g !mph would change it to mp/h and vice versa.

Anyone have any idea on how to do this? I know I don't :P

binladens
20th June 2009, 10:42
Whell what he said was " Why Do i need Demo cruise server"

To be honest demo is a start to s2.... now with the crisis bla bla bla.... just sorta dont have the spare money to buy the license and make the goddamn s2 server...

Im just testing this cruise for the moment and got stuck with 8 players limit started searching and the author of this program... wrote to me about the mci limit and explained how it works and then i understoood....

As i said to him... i may understand the most basic things about programming some basic languages not visual c# or insim...... as ive never tried to "remake any visual c# or insim " before this program im learning whats what yet :shrug:

Shadoww as i see ur kinda respected man here :D sort of...:schwitz: :thumb:

So can any1 help me with the mci handling "patch" ish.. and a small explain whats what would be very thankful :smileypul

broken
20th June 2009, 11:22
Whell what he said was " Why Do i need Demo cruise server"

To be honest demo is a start to s2.... now with the crisis bla bla bla.... just sorta dont have the spare money to buy the license and make the goddamn s2 server...

Im just testing this cruise for the moment and got stuck with 8 players limit started searching and the author of this program... wrote to me about the mci limit and explained how it works and then i understoood....

As i said to him... i may understand the most basic things about programming some basic languages not visual c# or insim...... as ive never tried to "remake any visual c# or insim " before this program im learning whats what yet :shrug:

Shadoww as i see ur kinda respected man here :D sort of...:schwitz: :thumb:

So can any1 help me with the mci handling "patch" ish.. and a small explain whats what would be very thankful :smileypul

If you have xfire, add me - ga3ar43. I will help you out with the MCI limit.
If you don't have xfire and you want to get it(it's the only messanger I use) you can download it from http://xfire.com ;)

a7x-syn-a7x
20th June 2009, 12:12
Anyone have any idea what could be causing this problem.

Thanks for the help

binladens
20th June 2009, 12:51
To Broken:

Ok ill download it and install then ill invite u ;)

Done- invited ;)

To a7sx

That error usually appears when some user has 0 cars in cruise ...

a7x-syn-a7x
20th June 2009, 13:11
Ah ok, that'll be why, thanks

a7x-syn-a7x
22nd June 2009, 18:35
I've found a problem in this (might just be mine i dno) but when there is no-one on track and someone joins, that user can use ANY car they want even if they don't own it, and it only seems to pick it up once one user is on the track :S I must of done something wrong, but I dno what.

Or how to fix it, Any one have any idea about how to fix this?

Thanks in advance

Mikjen
22nd June 2009, 23:48
Just tried it on mine, and it didnt do it ?

If i repitted a few times i could drive out of pits, but then it specced me ?

Mick

Azzano62
23rd June 2009, 06:40
no he means you can become like the host with a bit of cheating well sorta cheating some things you have to do to be able to become host anyone can do it as long as they do it in a certain way

if you want to know how to do it and fix it add my msn Azzano62@hotmail.com

jto93
26th June 2009, 21:34
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**

NCN Index and length must refer to a location in the string.
Parameter Name: LengtNCN Can not write data to transport connection: An established connection was aborted by the software on the host.NPL - The index was outside the area. It must be non-negative and less than the size of the collection.
Parameter name: indexi hope someone bother to help me :)
maby i can return you a favour, and host a lfs server :)

Azzano62
26th June 2009, 22:13
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;
}

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")

jto93
26th June 2009, 22:54
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 :smileypul:thumb::nod::thumbsup:

jto93
26th June 2009, 23:40
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 :D

Azzano62
27th June 2009, 04:32
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 :D


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;

jto93
27th June 2009, 09:01
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 :thumb:

Mikjen
29th June 2009, 17:08
Does anyone know a way to fix the cop system,

If 1 cop starts !chase it is fine, it another chase starts it messes up ?

Mick

Corey-McA
7th July 2009, 15:11
hi there i downloaded this insim yesterday but i cant get it too work with the admin password. when i run the insim it runs perfectly but if i set my custon admin password it will say this "index and lengh must refer to a location within the string. Parameter name: lengh". i was wondering if you could help me with this. the insim is good man keep it up. :thumb:

binladens
15th July 2009, 09:51
Still can any1 send me please to email fixed newform file with the mci limit fix (8 players max) i saw the post with the fix did it puted in place but it didnt work for me still as more then kicks out

binladens@gmail.com

sion92
28th July 2009, 19:58
i got it all setup,, when i put the port in it comes up with " insim tcp blind failed " when i try and upload the insim it just comes up with can't connect to the insim host. any help ?

MariusMM
29th July 2009, 14:50
Copy & past the lines from your setup file, you might of messed something up there. (Just change the admin password to some random stuff, w/e.)

sion92
29th July 2009, 18:41
// Example host configuration file
// How to use: LFS /cfg=setup.cfg
// Lines starting with // are ignored
// host name
/host=Testing !
// optional: password
//pass=password
// optional: admin password
//admin=xxxxxx
// optional: InSim port
//insim=29969
// optional: local specified ip address
//ip=92.236.69.245
// a high number below 65536
/port=63392
// demo/s1/s2
/mode=s2
// no/yes/hidden
/usemaster=yes
// BL1/BL1R/BL2, SO1/SO1R/SO2, etc
/track=AS5
// weather
/weather=1
// cars allowed - see README.txt
/cars=ALL
// max guests that can join host
/maxguests=1
// slots reserved for admins (0 to 8)
/adminslots=1
// max cars in a race
/carsmax=5
// max cars (real+ai) on host pc
/carshost=1
// max cars (real+ai) per guest pc
/carsguest=1
// smoothness (3-6) number of car updates per second
/pps=4
// qualifying minutes, 0 for no qualifying
/qual=0
// number of laps, 0 for practice
/laps=0
// if laps not specified: hours
//hours=24
// 0=no/1=low/2=high
/wind=1
// nogfx/invisible
/dedicated=nogfx
// no/yes: can guests vote to kick or ban
/vote=no
// no/yes: can guests select track
/select=no
// no/kick/ban/spec: wrong way drivers
/autokick=no
// no restart within X seconds of race start
/rstmin=60
// no restart within X seconds of race finish
/rstend=30
// no/yes: allow join during race
/midrace=yes
// no/yes: pit stop required
/mustpit=yes
// no/yes: allow car reset
/canreset=no
// no/yes: force cockpit view
/fcv=no
// no/yes: allow wrong way driving
/cruise=yes
// fixed/finish/reverse/random: race start order
/start=finish
// optional: welcome message up to 200 chars
//welcome=Welcomeeeeeee
// optional: text file listing allowed tracks
//tracks=Welcome "TEST"
// optional: message log file
//log=deb.log
// no/yes: network debug
/ndebug=no
// MPR autosave (0=off / 1=manual / 2=auto)
/autosave=2
// MPR folder
/mprdir=mpr
// LYT folder
/lytdir=layout

MariusMM
29th July 2009, 18:56
To me that setup looks OK. Could you take a shot of the error messages you get?

sion92
29th July 2009, 19:06
http://img196.imageshack.us/img196/7620/helppnv.jpg (http://img196.imageshack.us/i/helppnv.jpg/)

Bose321
29th July 2009, 19:13
I had this problem aswell, really annoying. I solved it by restarting lfs...

sion92
29th July 2009, 19:14
have restarted the whole pc=P

MariusMM
29th July 2009, 19:28
Hmm, well are you sure you got the correct IP & port?

sion92
29th July 2009, 19:36
// InSim connection settings
InSimSettings Settings = new InSimSettings("127.0.0.1", 29969, 0, Flags.InSimFlags.ISF_MSO_COLS | Flags.InSimFlags.ISF_MCI, '!', 500, "PASSWORD", "insim", 5);

MariusMM
29th July 2009, 19:43
You do know you have to edit the config file?

sion92
29th July 2009, 19:49
it has been.

MariusMM
29th July 2009, 20:03
Just out of interest, could you do /cars=road
and not /cars=ALL ?

sion92
29th July 2009, 20:05
i have changed it. gonna try it..

if you got msn add me ,, king_69er@hotmail.co.uk

Mikjen
30th July 2009, 22:09
did u type /insim 29969 as well, before starting the insim program
?

broken
30th July 2009, 22:18
// How to use: LFS /cfg=setup.cfg
// Lines starting with // are ignored
// host name
/host=Testing !
// optional: password
//pass=password
// optional: admin password
//admin=xxxxxx
// optional: InSim port
//insim=29969
Thanks to Mikjen for making me re-read your setup I can tell you how it has to be done. Look at the end of my post, please. ;)
To me that setup looks OK. Could you take a shot of the error messages you get?
Does it?
What error messages? Isn't it obvious? :P The insim just can't "hear" anything on that port..

did u type /insim 29969 as well, before starting the insim program
?
If you didn't actually ask this I wouldn't go to check over the setup file again, so they should thank you. :)

So how it should actually be done.

// How to use: LFS /cfg=setup.cfg
// Lines starting with // are ignored
// host name
/host=Testing !
// optional: password
//pass=password
// optional: admin password
/admin=xxxxxx
// optional: InSim port
/insim=29969

Do that and if you haven't messed with anything you'll be fine. Once again - If it wasn't Mikjen's reply I wouldn't even check this thread. ;)

PoVo
3rd August 2009, 10:39
1st: If you respect everybody in the forums you would say that in english.
2nd: As far as I understand you are asking something that would offend demo users and/or cruisers.

From these 2 I'd like to tell you 2 things:
1: Have some more respect and courage and write that in english.
2: If you don't want everybody to soon start thinking you are a hypocrite then stop offending cruise servers.

Let me give you one example:

Whining about who is cop/cadet in a cruise server....

After which this is how you call cruising.


Shadows translation to English would be something like: Why do you need a cruise server for Demo.

Or atleast something like that, thats all i can translate by using Lithuanian :D

broken
3rd August 2009, 13:52
19th June 2009, 16:56 #265 -
broken :scratchch

Isn't it the 3th of August today? :scratchch :razz:
I got the answer tho, but anyway, thanks. :)

impresora
3rd August 2009, 16:19
Hello Dispatch ask for my bad English.

Look when I try and fazerr! Addpolice not auturized he says, how can I allow an administrator?

broken
3rd August 2009, 20:34
Hello Dispatch ask for my bad English.

Look when I try and fazerr! Addpolice not auturized he says, how can I allow an administrator?

As far as I understood you want to know how to login as an administrator into your server. Use the server's admin password in this case. It's supposed to be put in the password field right bellow the server name when you join any host. :thumb:

impresora
4th August 2009, 06:26
Friend saw evil.

Methodology as a player or official in myself?

Using! Addpolice username methodology that when he says:


Not autorized


Not autorized with and I know he autorized to get staff

PoVo
5th August 2009, 18:23
Where the Cruise servers LFS_External.exe is located there is a folder called, Users go into the folder and in that there will be a Police folder open that and add your username in the first line where it says Officer = SOMETHING change it to your licence.

Then you will be able to add you friend from LFS.

impresora
6th August 2009, 07:18
But I do like this:


Username: Impresora96


I go to users, groups, police.txt.

I open and then write:

officer = impresora96

write after the game:

! addpolice

E Deois not allow

Mikjen
6th August 2009, 07:54
type !addpolice Username
or !addcadet Username

When u have form.cls open, search for Duogie Lampkin and change the name to ur username

Mick

m0v3ra
7th August 2009, 20:54
Hi all, i change settings in Form1.cs with Microsoft Visual Basic 2008 Express Edition, but no effect in my server... :shrug::shrug::shrug:

I'm sorry for my bad english. :(

MariusMM
7th August 2009, 22:11
Did you compile it properly?

broken
7th August 2009, 22:12
Hi all, i change settings in Form1.cs with Microsoft Visual Basic 2008 Express Edition, but no effect in my server... :shrug::shrug::shrug:

I'm sorry for my bad english. :(

F6 to build your project.

Или казано на Български, натисни F6 за да компилираш(направиш) нов .exe фаил.
(said the same thing in bulgarian, in case you care ;))

AudiBG
7th August 2009, 23:15
Hi all, i change settings in Form1.cs with Microsoft Visual Basic 2008 Express Edition, but no effect in my server... :shrug::shrug::shrug:

I'm sorry for my bad english. :(

WOW! You are bulgarian but there are no any bulgarian cruise servers in the Demo Z version, so u are using S2 with crack ??? :wtf2:

broken
8th August 2009, 10:02
WOW! You are bulgarian but there are no any bulgarian cruise servers in the Demo Z version, so u are using S2 with crack ??? :wtf2:

You can't tell for sure... :shrug:
The server might be private and if you have filtered out private servers you can't see it maybe.. Orr... The host may be hidden. :shrug:
Orrr: He may be doing what you said. :D

m0v3ra
8th August 2009, 11:07
F6 to build your project.

Или казано на Български, натисни F6 за да компилираш(направиш) нов .exe фаил.
(said the same thing in bulgarian, in case you care ;))

Yes i press F6, but no effect...
Bulgarian: Не става нищо човече... Натискам ф6, но нищо не става? :x

m0v3ra
9th August 2009, 00:28
I have 1 more question, how to rob bank? :shrug:

Edit: Help please!!! :(

impresora
9th August 2009, 20:19
I addpolice, and autorize, and then how i use controls for cadet chases?!

ghezzotrox
10th August 2009, 13:00
Why do I get:
"The InSim Interface was unable to connect to the remote InSim host."
When I start LFS_External_Client.exe.


Would be great if someone could help me.

impresora
10th August 2009, 14:38
You need :

- Open bin;

- Open relese;

- Settings;

- Configure;

- And run

ghezzotrox
10th August 2009, 14:45
I got all working now, it starts the cruising InSim too, but, it makes it as a normal race.
I need to somehow put it as Cruise.

MariusMM
10th August 2009, 22:18
Well, Im not fully sure what you mean, but try /cruise=yes as admin in game.

ghezzotrox
11th August 2009, 09:16
Got that working now.
How do I fix the speed thingy? It doesn´t change when I drive.

Maybe offtopic, but is there somehow I can put settings like /cruise=yes and make it training, so it doesn´t start a race?
Or will I have to do that when I logon?

broken
11th August 2009, 09:42
/laps=0 -> Practice

I believe that both /cruise=yes and /laps=0 commands can be put in the cfg file, so every time you run the server they will be set already.
Or other way is to make the insim type them when it connects.

ghezzotrox
11th August 2009, 09:46
I just checked the cfg file a little bit more, and found all settings I need :)
Thanks anyway :P



Anyone knows how to get color in the server name?

mike864
11th August 2009, 10:18
hi
i see that
// Note - do NOT change the settings here. Use the settings.ini file instead!

in form1 .cs


but when a add those things in settings.ini ,,it will

said some things: length

:schwitz:

broken
11th August 2009, 10:35
I just checked the cfg file a little bit more, and found all settings I need :)
Thanks anyway :P



Anyone knows how to get color in the server name?

^0 - Black
^1 - Red
^2 - Green
^3 - Yellow
^4 - Blue?
^5 - Pink?
^6 - Light blue?
^7 - White
^8 - Default
^9 - ??Default?? - don't really know what's the purpose in the 9th color tbh

Where I place ? after the color I'm not 100% sure it's like that but I think it's right anyway. :P

PoVo
11th August 2009, 11:01
It seams you are using wrong track, you can only use, AS5 SO4 BL1 tracks :nod:

BOSCHO
11th August 2009, 21:34
hello
where i can find the pizza mode for this cruise
and how i can know the places of the bank for example without layout?
and last question : is there any more finished mods for this insim ?

Azzano62
11th August 2009, 22:43
hello
where i can find the pizza mode for this cruise

there is no pizza mode people make there own they dont come in the lfs external dougie has posted on here

sion92
12th August 2009, 12:29
i got it running, but i want to change the welcom message for the insim, i have looked through the files but cant seem to find it?
Any ideas?

KuHS
12th August 2009, 12:31
Look at form1, use Search CTRL + F.

broken
12th August 2009, 15:50
Look at form1, use Search CTRL + F.

Saying just that is wrong, I think. From his question I think that he doesn't know what exactly to do, and I can bet that he doesn't even have C#, because (I can bet that) he hasn't fully read even the 1st post, and let's not talk about the posts after it that explain what you have to do in order to be able to change the program. Actually it is explained in so much posts in this thread, that it's funny how people keep on asking stuff about it. :D

So once again: Download Visual C# Express Edition(it's easy to use, and please ask google if you don't know where to get it from), open the .sln file or .csproj file and try to find the place in the program that processes new connections (Try to search for NCN). The welcome message should be there, I think.

If you just open form1.cs with notepad I guess questions like "I did it but message didn't appear, what did I do wrong?" will follow, so I hope that's solved too now.

Note: You need Visual C#, not C++ or Basic. Visual C#(aka C sharp). If you open the project with something else you won't be able to build it. If you open it with notepad - you won't be able to build it. If you open only form1 file - ??... Yes, you won't be able to build it. You need to open a file with extension of ".sln", or if that can't be found then ".csproj".

Oh.. To build: Press F6. Saving the project will not update the exe.

Hope this post helped to everyone, but not just "sion92". :shrug:

ghezzotrox
12th August 2009, 15:54
Where do I change that message that comes up when you join a server with this cruise InSim?
It says like "Welcome to [RF]Server" and stuff.

EDIT; And I just tried changing the car prices, compiled it, but the cars got the same price :/

broken
12th August 2009, 17:09
Where do I change that message that comes up when you join a server with this cruise InSim?
It says like "Welcome to [RF]Server" and stuff.

EDIT; And I just tried changing the car prices, compiled it, but the cars got the same price :/

You did this post only to joke with me, didn't you? xD
I'm not gonna repeat myself. :razz:

sion92
12th August 2009, 17:51
Sorry=P i was on 11 not 12;)

ghezzotrox
12th August 2009, 18:57
Nevermind, I just found all stuff :P
A bit tricky to find tho.

MMD_NYD
12th September 2009, 22:25
Where i can get speed limits to all maps?

MariusMM
12th September 2009, 22:38
I'm afraid you need to code them yourself.

MMD_NYD
12th September 2009, 22:53
But i didn't now where is X or Y cordinate, is somewhere a tutorial?

Sorry, for my english language :D

binladens
13th September 2009, 19:58
Hi its me again....

Today started to make the mci handler work again.... and finally did it, but with some problems...

It works- i can connect more than 8 players and nothin bad happens- but, there are 2 failures that kinda pop up in either of versions(tried several times to make it a bit different)

1. It works but doesnt count speed at all just 0 for alll

2. It works, but counts the speed only for the last person who exits from pits, if 1 player drives it shows correct but just as 2nd goes out of pits it shows the first player 2nd players speed and for the second player its total 0

What did i do wrong, couse both times it compiled succesifuly.., sorry mybe just a dum mistake, im kinda only learning c#

markorester
27th September 2009, 16:23
is there any tutorial with the commonds, where are the tickets etc. ?

MMD_NYD
29th September 2009, 11:53
How do I make function, if a player enters in server with the nick !@#$%^&*() automatically kick him ?

Danny LFS
9th October 2009, 20:24
Making demo InSim for a friend using this, and with the immensurable aid of MS Visual C# 2008 Express Edition. I could make some parts on ly own (only demo cars are shown in overlay now) but now I have 2 questions:


How do I make the Insim make other players start with XFG and not UF1?
How do I make a function for cops to see their cop commands with "!chelp"?

PoVo
11th October 2009, 18:46
Making demo InSim for a friend using this, and with the immensurable aid of MS Visual C# 2008 Express Edition. I could make some parts on ly own (only demo cars are shown in overlay now) but now I have 2 questions:


How do I make the Insim make other players start with XFG and not UF1?
How do I make a function for cops to see their cop commands with "!chelp"?


1. In FileInfo.cs there is a thing like NewUser. You got to change the car from UF1 to XFG.
2. In Form.Cs scroll down to find the !help command Copy Paste that, and remove any unecessary lines, and add your ones in.

After that Save and Rebuild the Project (hit F6)

Btw. this is done in Visual Studio Express :nod:

Fire_optikz001
24th October 2009, 00:45
hey can somebody help me with the comp car i really need it :) u can pm it to me if u want. no one will read it but me :)

KIMA
1st November 2009, 22:28
HI Racers, my name is KIMA I from Moscow I love very much greetings LFS and its big admirer. At me the site and 3 servers DRAG, DRIFT, GTR I would like to open still and 4 server that is Cruise.I need the person which Understands in Cruise server is necessary and will write us it completely as we will want also such which there is nobody aren't present.
Certainly it awakes not free of charge. I wish to hear your offers under the price and photos with Cruise server and their full description that they at present can, and as that else it is possible to add in mod.

Yours faithfully KIMA.

Bose321
2nd November 2009, 11:35
HI Racers, my name is KIMA I from Moscow I love very much greetings LFS and its big admirer. At me the site and 3 servers DRAG, DRIFT, GTR I would like to open still and 4 server that is Cruise.I need the person which Understands in Cruise server is necessary and will write us it completely as we will want also such which there is nobody aren't present.
Certainly it awakes not free of charge. I wish to hear your offers under the price and photos with Cruise server and their full description that they at present can, and as that else it is possible to add in mod.

Yours faithfully KIMA.
You can download one here, and try to edit it yourself.

KIMA
2nd November 2009, 14:41
It is impossible to me help if who can, adjust it correctly.

PoVo
3rd November 2009, 20:19
Hey guys, i'm having problems with chasing in my Cruise server. Once i fixed the MCI handler, the chase commands don't work. I just get an 'Engage Error' message, i tried replacing the code of if (ChaseInitiated == 1) to MCI.NumC still no help, when its on Players.Count it works, but only if theres 8 people in the server.

Any ideas, oh and also i tried putting in Connections.Count, still nothing, just engage error, im pretty sure my Detailed Car Information part is correct, as all the Lotto and Shops work for everyone with MCI.NumC set on the tracks part.

Thanks.

PoVo
8th November 2009, 19:37
Sorry for double post, but no one hasn't got any ideas? :eek:

stickylfs
9th November 2009, 11:16
Does anyone knows how to fix the limited 8 player? I want to more people join :Looking_a

gru
10th November 2009, 07:00
read this thread
http://www.lfsforum.net/showthread.php?t=43933

also check MCI handler in modded version
http://www.lfsforum.net/showthread.php?t=47913

basicly U have to loop through MCI.Info array instead of Players list
BTW U dont really need clsPlayer class, it only makes code more complicated.
check modded version (link 2), it stores all info in clsConnection

broken
10th November 2009, 13:55
read this thread
http://www.lfsforum.net/showthread.php?t=43933

also check MCI handler in modded version
http://www.lfsforum.net/showthread.php?t=47913

basicly U have to loop through MCI.Info array instead of Players list
BTW U dont really need clsPlayer class, it only makes code more complicated.
check modded version (link 2), it stores all info in clsConnection
It doesn't make it more complicated, it makes it more readable and easier to get information about a player's car at any point of your work, instead of setting a var, which then you have to check in MCI thread, etc... ;)

But it still isn't something you need to fix the MCI handler. :)

viliux112
10th November 2009, 16:23
can someone add in this server login/register system?:)

Shadowww
10th November 2009, 16:32
Does anyone knows how to fix the limited 8 player? I want to more people join :Looking_aBy coding your own cruise system.

:)

stickylfs
10th November 2009, 17:40
By coding your own cruise system.

:)

I'm not coder.

:)

Shadowww
10th November 2009, 19:18
I'm not coder.

:)Become one.

:)

gru
12th November 2009, 08:02
It doesn't make it more complicated, it makes it more readable and easier to get information about a player's car at any point of your work
im not so sure about it. loop through connections list inside of player list loop is not readable and easier IMO :)
i prefer to store PLID in clsConnection and get whole player object with one method instead of looking for it in 2 lists

...instead of setting a var, which then you have to check in MCI thread, etc...
sure, of course its better to save speed and position on MCI event so U can have it in any point of code, i just dont see advances
in storing this info in 2 classes

viliux112
12th November 2009, 13:08
why my changes doesn't work. i use Microsoft Visual Studio 2008.

stickylfs
12th November 2009, 13:37
Become one.

:)

How.

:)

Bose321
12th November 2009, 13:46
How.

:)

That's not a question, but the answer is : Do some tutorials.

:)

stickylfs
12th November 2009, 13:57
That's not a question, but the answer is : Do some tutorials.

:)

I don't see any tutorial of How to fix the 8 player limit for Non-Coders.

:) -----------------------> Better if we stop writing like this..

Shadowww
12th November 2009, 15:09
I don't see any tutorial of How to fix the 8 player limit for Non-Coders.

:) -----------------------> Better if we stop writing like this..
You do have tutorial how to become coder tho.

:)

broken
12th November 2009, 15:56
im not so sure about it. loop through connections list inside of player list loop is not readable and easier IMO :)
i prefer to store PLID in clsConnection and get whole player object with one method instead of looking for it in 2 lists


sure, of course its better to save speed and position on MCI event so U can have it in any point of code, i just dont see advances
in storing this info in 2 classes

Then why don't you build a method to get a connection id by PLID, and a Player id by UCID? That's quite simple to code. :shrug:

Or if you're lazier you can just make a function to convert a clsConnection to clsPlayer and the opposite(that means like 5 lines of code at max). ;)

PoVo
12th November 2009, 18:47
I don't see any tutorial of How to fix the 8 player limit for Non-Coders.

:) -----------------------> Better if we stop writing like this..


In Visual Studio find //Detailed car information

in there will be a code like for (int blah blah Player.Count)

change the Players.Count into MCI.NumC and also do the same for the tracks (find like AS5 and where it says Players.Count put MCI.NumC into there)

stickylfs
12th November 2009, 19:48
In Visual Studio find //Detailed car information

in there will be a code like for (int blah blah Player.Count)

change the Players.Count into MCI.NumC and also do the same for the tracks (find like AS5 and where it says Players.Count put MCI.NumC into there)

There are 2 things with //Detailed car information :

// Detailed car information packet (max 8 per packet)
private void MCI_CarInformation(Packets.IS_MCI MCI)
{
tryAnd

InSim.MCI_Received += new LFS_External.InSim.InSimInterface.MCI_EventHandler (MCI_CarInformation); // Detailed car information packet (max 8 per packet)


EDIT: Nevermind I found.. Ill test thanks!

gru
13th November 2009, 06:53
Then why don't you build a method to get a connection id by PLID, and a Player id by UCID? That's quite simple to code. :shrug:
Or if you're lazier you can just make a function to convert a clsConnection to clsPlayer and the opposite(that means like 5 lines of code at max). ;)
cause thats more operations program has to make
1. loop through Players list to get UCID
2. loop through Connections list to get clsConnection object

if U store PLID in clsConnection U can skip step 1 (and remember that U have to handle MCI event few times per second)
ok, U have powerful PC, it will do job anyway, but still :)

also tell me, how many times U use only clsPlayer?
i bet in most cases U use clsConnection also, so isnt it better to have only one class representing player?

morpha
13th November 2009, 07:26
gru, there can be up to 20 players (= 20 PLIDs) per connection, although limited to 3 in multiplayer mode, it still has to be considered in host-side InSim applications such as a cruise app. Even if you spectate AIs upon receiving the NPL, it'll still send a couple of CompCars for that player, depending on your NLI.

But you're still right, it's a better approach to store the PLIDs of a connection within the same structure as the connection itself because all it takes is 1 to 20 additional bytes of RAM per connection, which is nothing.

You don't have to loop through the players list to obtain the associated UCID though, that's part of the NPL.

gru
13th November 2009, 09:30
You're right, i forgot about AIs, but this system doesn't support it, one PLID per connection

broken
13th November 2009, 12:01
cause thats more operations program has to make
1. loop through Players list to get UCID
2. loop through Connections list to get clsConnection object

if U store PLID in clsConnection U can skip step 1 (and remember that U have to handle MCI event few times per second)
ok, U have powerful PC, it will do job anyway, but still :)

also tell me, how many times U use only clsPlayer?
i bet in most cases U use clsConnection also, so isnt it better to have only one class representing player?
That's one of the things I said - get connection id by PLID (for which you will need to store the PLID in the connection, which is also just 1min of editing), and then I said that if you're lazy you can just waste a 1 or 2 more additional operations, which won't really slow down your PC at all. My PC is not powerful at all, and it still handles my almost 1mb application. :razz:

E: Tbh, I'm not sure that I understand you fully. :D

E2: Take a look at this code and tell me how will it slow down your PC.. :razz:
namespace myApplication
{
class misc
{
static public clsPlayer convertToPlayer(clsConnection C)
{
for (int i = 0; i < Form1.Players.Count; i++)
{
if (Form1.Players[i].UniqueID == C.UniqueID)
{
return Form1.Players[i];
}
}
return null;
}
}
}

gru
13th November 2009, 13:05
ok, lets stop argueing, U use clsPlayer, fine, i joined it with clsConnection, fine too :)

morpha
13th November 2009, 13:34
broken, your implementation loops through the Players, potentially iterating times the number of players - 1, while gru's implementation requires no such computational effort at all. gru's version is faster at the expense of a few bytes of RAM, yours uses less RAM at the expense of a couple of CPU cycles. You won't be able to tell the difference in execution speed, but gru's version is the more efficient one.

broken
13th November 2009, 14:34
ok, lets stop argueing, U use clsPlayer, fine, i joined it with clsConnection, fine too :)
Why didn't you say that earlier, lol... Now I see what you mean... :D

@morpha: Define more efficient. :razz:
It's true that we can argue like this forever lol, but let me ask a simple question: How could it be more efficient when it's just making the list bigger.
Example: My clsConnection list has too much variables, and I can't imagine it having player information in it too. It's going to be a pain to read. Also when I need to go through all players I wouldn't need to check a variable if they have left the pits or not, because I wouldn't even have to deal with the ones spectating.

I don't say that my method is more efficient, but I don't think that there is any place for the word efficiency in here anyway... True, he doesn't have 2 lists to worry about, but I have less variables when I need to deal with something.

Depends on what suits you better really.. :shrug:

Just my opinion. :)

KIMA
13th November 2009, 22:16
Greetings to everything, I have downloaded here this http://www.lfsforum.net/showthread.php?p=1307905#post1307905 Cruise server and at me does not display online of officers.

Also so the shop which does not work to be in 2 pit-lejne

PoVo
13th November 2009, 22:52
Greetings to everything, I have downloaded here this http://www.lfsforum.net/showthread.php?p=1307905#post1307905 Cruise server and at me does not display online of officers.

Also so the shop which does not work to be in 2 pit-lejne

Is track on AS5?

KIMA
13th November 2009, 22:53
Yes, and what a problem in it?

PoVo
14th November 2009, 22:53
Yes, and what a problem in it?
It doesn't display Officers because you havent added any. In Form1.Cs there is a !addofficer command, in there you need to add your username so you could use the command.

viliux112
16th November 2009, 10:57
how to update changes. I change everything how i want but nothing works

Shadowww
16th November 2009, 11:17
how to update changes. I change everything how i want but nothing worksUhm. There's no "nothing works", there's only "I failed to do it correctly so it doesn't works for me".

broken
16th November 2009, 14:17
how to update changes. I change everything how i want but nothing works
http://www.lfsforum.net/showthread.php?p=1236090#post1236090
http://www.lfsforum.net/showthread.php?p=1236090#post1236090
http://www.lfsforum.net/showthread.php?p=1236090#post1236090
http://www.lfsforum.net/showthread.php?p=1236090#post1236090
http://www.lfsforum.net/showthread.php?p=1236090#post1236090

Hope you see it now..

cashielg
26th November 2009, 18:07
hey when ever i tr to start it it says that the password is not the same as host but it is! plz reply soon thnxs

KassadGLA
27th November 2009, 07:47
hey when ever i tr to start it it says that the password is not the same as host but it is! plz reply soon thnxs

be sure that it is the same or edit it in the form1

broken
27th November 2009, 13:05
hey when ever i tr to start it it says that the password is not the same as host but it is! plz reply soon thnxs
A little tip: Just like you wake up in the morning, in a rush for work/school/wherever u go and you need to find your keys for example, you start thinking what did you last do, when did you last see them, which places did you last go, remembering they were with you - The same method can work out good in remembering what changes you last did to the code or the settings file, also reading the first replies from people who had similar issues, to see what they have done wrong might help you(an advantage in front of the situation with the lost keys, where nobody can help you... especially not in the morning, when everyone's in a rush, looking for their keys too).... So... Think of what you changed, read the instructions again ...aaand - don't mind my bullshit

kyler
4th January 2010, 05:50
Hey sorry for the bump but i'm having trouble with the Distance from officer. is there anyway i can make it update so i can do Distance: distance from officer? Well heres my code. Thanks for the help.
//chase button
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsOfficerORCadet == 1)
{
InSim.Send_BTN_CreateButton("^1Condition: " + (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].ChaseCondition), Flags.ButtonStyles.ISB_DARK, 5, 41, 18, 116, 153, (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID), 2, false);
}
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsBeingChased == 1)
{
InSim.Send_BTN_CreateButton("^1Distance: " + (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].DistanceFromOfficer), Flags.ButtonStyles.ISB_DARK, 5, 41, 18, 116, 153, (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID), 2, false);
}
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsBeingChased == 0)
{
InSim.Send_BTN_CreateButton("^2Not Being Chased!", Flags.ButtonStyles.ISB_DARK, 5, 41, 18, 116, 153, (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID), 2, false);
}

Corey-21
27th March 2010, 09:28
when some one comes on the server and sells a uf1 then reconnect they show up as the host and i was wondering if someone could help me so that they cant sell the uf1 heres my code so far

case "!sell":
if (StrMsg.Length == 2)
{
if (StrMsg[1] == "UF1")
{
InSim.Send_MTC_MessageToConnection("^1You cannot sell a UF1!", MSO.UCID, 0);
}
if (StrMsg[1] == "uf1")
{
InSim.Send_MTC_MessageToConnection("^1You cannot sell a UF1!", MSO.UCID, 0);
}

if (Connections[GetConnIdx(MSO.UCID)].Cars.Contains(StrMsg[1].ToUpper()))
{
if (Dealer.GetCarPrice(StrMsg[1].ToUpper()) > 0)
{
string UserCars = Connections[GetConnIdx(MSO.UCID)].Cars;
int IdxCar = UserCars.IndexOf(StrMsg[1].ToUpper());
try { Connections[GetConnIdx(MSO.UCID)].Cars = Connections[GetConnIdx(MSO.UCID)].Cars.Remove(IdxCar, 4); }
catch { Connections[GetConnIdx(MSO.UCID)].Cars = Connections[GetConnIdx(MSO.UCID)].Cars.Remove(IdxCar, 5); }
Connections[GetConnIdx(MSO.UCID)].Cash += Dealer.GetCarValue(StrMsg[1].ToUpper());
InSim.Send_MST_Message("/msg ^7 " + Connections[GetConnIdx(MSO.UCID)].PlayerName + " ^7sold " + StrMsg[1].ToUpper());
}
else InSim.Send_MTC_MessageToConnection("^1Invalid car selection", MSO.UCID, 0);
}
else InSim.Send_MTC_MessageToConnection("^1You dont own that car", MSO.UCID, 0);
}
else
{
InSim.Send_MTC_MessageToConnection("^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;

thanks alot :)

broken
27th March 2010, 15:53
case "!sell":
if (StrMsg.Length == 2)
{
if (StrMsg[1].ToUpper() == "UF1")
{
InSim.Send_MTC_MessageToConnection("^1Noone wants to buy your old wreck!", MSO.UCID, 0);
return;
}

if (Connections[GetConnIdx(MSO.UCID)].Cars.Contains(StrMsg[1].ToUpper()))
{
if (Dealer.GetCarPrice(StrMsg[1].ToUpper()) > 0)
{
string UserCars = Connections[GetConnIdx(MSO.UCID)].Cars;
int IdxCar = UserCars.IndexOf(StrMsg[1].ToUpper());
try { Connections[GetConnIdx(MSO.UCID)].Cars = Connections[GetConnIdx(MSO.UCID)].Cars.Remove(IdxCar, 4); }
catch { Connections[GetConnIdx(MSO.UCID)].Cars = Connections[GetConnIdx(MSO.UCID)].Cars.Remove(IdxCar, 5); }
Connections[GetConnIdx(MSO.UCID)].Cash += Dealer.GetCarValue(StrMsg[1].ToUpper());
InSim.Send_MST_Message("/msg ^7 " + Connections[GetConnIdx(MSO.UCID)].PlayerName + " ^7sold " + StrMsg[1].ToUpper());
}
else InSim.Send_MTC_MessageToConnection("^1Invalid car selection", MSO.UCID, 0);
}
else InSim.Send_MTC_MessageToConnection("^1You dont own that car", MSO.UCID, 0);
}
else
{
InSim.Send_MTC_MessageToConnection("^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;

Corey-21
27th March 2010, 16:56
case "!sell":
if (StrMsg.Length == 2)
{
if (StrMsg[1].ToUpper() == "UF1")
{
InSim.Send_MTC_MessageToConnection("^1Noone wants to buy your old wreck!", MSO.UCID, 0);
return;
}

if (Connections[GetConnIdx(MSO.UCID)].Cars.Contains(StrMsg[1].ToUpper()))
{
if (Dealer.GetCarPrice(StrMsg[1].ToUpper()) > 0)
{
string UserCars = Connections[GetConnIdx(MSO.UCID)].Cars;
int IdxCar = UserCars.IndexOf(StrMsg[1].ToUpper());
try { Connections[GetConnIdx(MSO.UCID)].Cars = Connections[GetConnIdx(MSO.UCID)].Cars.Remove(IdxCar, 4); }
catch { Connections[GetConnIdx(MSO.UCID)].Cars = Connections[GetConnIdx(MSO.UCID)].Cars.Remove(IdxCar, 5); }
Connections[GetConnIdx(MSO.UCID)].Cash += Dealer.GetCarValue(StrMsg[1].ToUpper());
InSim.Send_MST_Message("/msg ^7 " + Connections[GetConnIdx(MSO.UCID)].PlayerName + " ^7sold " + StrMsg[1].ToUpper());
}
else InSim.Send_MTC_MessageToConnection("^1Invalid car selection", MSO.UCID, 0);
}
else InSim.Send_MTC_MessageToConnection("^1You dont own that car", MSO.UCID, 0);
}
else
{
InSim.Send_MTC_MessageToConnection("^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;

whats that meant to mean?

broken
27th March 2010, 20:15
whats that meant to mean?
It's meant to be the answer of your question. Or more like request. But I don't understand how is that not obvious?

Azzano62
27th March 2010, 21:37
case"!sell":
if (StrMsg.Length == 2)
{
if (StrMsg[1] == "UF1" || "uf1")
{
InSim.Send_MTC_MessageToConnection("^1You cannot sell a UF1!", MSO.UCID, 0);
}
else if (Connections[GetConnIdx(MSO.UCID)].Cars.Contains(StrMsg[1].ToUpper()))
{
if (Dealer.GetCarPrice(StrMsg[1].ToUpper()) > 0)
{
string UserCars = Connections[GetConnIdx(MSO.UCID)].Cars;
int IdxCar = UserCars.IndexOf(StrMsg[1].ToUpper());
try { Connections[GetConnIdx(MSO.UCID)].Cars = Connections[GetConnIdx(MSO.UCID)].Cars.Remove(IdxCar, 4); }
catch { Connections[GetConnIdx(MSO.UCID)].Cars = Connections[GetConnIdx(MSO.UCID)].Cars.Remove(IdxCar, 5); }
Connections[GetConnIdx(MSO.UCID)].Cash += Dealer.GetCarValue(StrMsg[1].ToUpper());
InSim.Send_MST_Message("/msg ^7 " + Connections[GetConnIdx(MSO.UCID)].PlayerName + " ^7sold " + StrMsg[1].ToUpper());
}
else InSim.Send_MTC_MessageToConnection("^1Invalid car selection", MSO.UCID, 0);
}
else InSim.Send_MTC_MessageToConnection("^1You dont own that car", MSO.UCID, 0);
}
else
{
InSim.Send_MTC_MessageToConnection("^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;

Kroncius
7th June 2010, 13:44
Hello, I'am from Lithuania therefore my English is inconsistent.

Should I register / login system which has saved users.

I would be very grateful to her that one of your written code and put here or sent me i am.

Good luck.

broken
7th June 2010, 14:46
Good luck.

No luck. :shrug:

Deja vu.

VirginTrains
23rd June 2010, 09:47
Can i ask for something..

Instead of website on the clock what is the code for KM?

Jos[NL]
27th June 2010, 10:33
Hi , i am using it now and it works fine , but what are the ALL commands for cops and admins ?

thank you

PoVo
30th June 2010, 19:15
All the commands are in the Form1.cs, the list of them are also somewhere in this thread. Please search before asking

skywatcher122
4th July 2010, 21:14
somehow i'm getting used with this C# thing :thumb:

btw I stopped making this since I quit on my team

IIrmantass1525
10th August 2010, 18:46
I have a problem when i drive speed shows 0/80 km/h how to solve it?

PoVo
11th August 2010, 10:48
I have a problem when i drive speed shows 0/80 km/h how to solve it?

In what car is this happening? And track.

skywatcher122
11th August 2010, 13:12
make sure the track of MCI is there for example KY1 or KY3 in case ...: blah blah

broken
11th August 2010, 13:47
@last 2 posts : That should not at all matter if you want to show the speed of a car. Unless you are dumb enough to write it especially for one of the tracks/cars only, of course. :razz:

As for the question: Please provide a little bit more details. Where is the code for this located. Post it here too. Or else, we can't really give you a 100% correct answer. Actually, we can just guess what the solution can be, because how would you answer such a question? It's like asking us 'I lost my mobile, any idea where to find it?', when we don't know what your room and phone look like. Hope you've got the point. :razz:

IIrmantass1525
12th August 2010, 21:37
In what car is this happening? And track.



Car drives but that who shows speed don't moves track AS5

imthebestracerthereis
12th August 2010, 21:39
Silly demo users, AS5 is for S2 users!

broken
13th August 2010, 13:03
Such situations drive me away from trying to give help to demo users... -.-

PoVo
13th August 2010, 13:30
Such situations drive me away from trying to give help to demo users... -.-

HAHA, I told you in MSN, this was gonna happen :D

Thats why I asked, what track/car :D:D:D

I should be admin here tbh, catching 5+ crackers makes me a pro! Joke.

DevilDare
13th August 2010, 15:52
HAHA, I told you in MSN, this was gonna happen :D

Thats why I asked, what track/car :D:D:D

I should be admin here tbh, catching 5+ crackers makes me a pro! Joke.

Hardly a pro. :D

Lithuanian demo users are almost always crackers.

PoVo
13th August 2010, 16:45
Hardly a pro. :D

Lithuanian demo users are almost always crackers.

Shush, I nearly got Mod rights here :D:D:D

skywatcher122
13th August 2010, 17:05
dang AS5 on demo lol :something :rolleyes2:bananalla

Vepr
13th August 2010, 18:07
Hello guys I'm having problem... I can't login into a server with admin and i can't seem to get replace the Uf1 with Xfg

broken
13th August 2010, 18:25
Hello guys I'm having problem... I can't login into a server with admin and i can't seem to get replace the Uf1 with Xfg

Make sure that the admin field in the server config file doesn't have 2 front slashes in front of it, but just 1. Then, you have to enter that pass in the password field when you are about to join the server.

About replacing UF1 with XFG... I guess that's one quite major change in the application, so I can't really give you exact information.

Vepr
13th August 2010, 19:49
well with the one slash it i get an error when starting a server saying something about parameter 2 is invalid :shrug:



For the cars well i tried replacing the uf1 in the fileinfo.cs but it's no use it started the server with that car.

The compiler works since i was able to change the website and the welcome message on the server.

broken
13th August 2010, 20:47
well with the one slash it i get an error when starting a server saying something about parameter 2 is invalid :shrug:

make sure that there actually is an admin password set there
example:

WONT WORK:
//admin=somepass
//admin=
/admin=

SHOULD WORK:
/admin=passgoeshere

Vepr
13th August 2010, 21:25
aha so that means no spaces.. great it worked thanks.. and i downloaded the 1.0.3 and basically started with a fresh fileinfo.cs and it worked. Great mod can't wait to build more on it.

Dygear
20th August 2010, 22:02
Hello guys I'm having problem... I can't login into a server with admin and i can't seem to get replace the Uf1 with Xfg

The UF1 is a demo car?

skywatcher122
21st August 2010, 12:58
The UF1 is a demo car?

probably he got a crack'o jack off

but helps a bit on fileinfo.cs

stickylfs
21st August 2010, 15:12
The UF1 is a demo car?

I think he is asking how to change UF1 to XFG so demo users will be able to play with XFG :tilt:

broken
21st August 2010, 20:44
The UF1 is a demo car?

Come on -.- ..If this guy turns out to be a cracker, I'll seriously quit helping any demo users.. But really, I think he is asking how to do it in the application.. Or at least I really really really do hope so. ;d

skywatcher122
22nd August 2010, 07:13
only works on BL1!! if u use on other tracks the GUI will do something darker

Subsense
31st October 2010, 16:46
Hello.My friend have a cruise server.But the insim aplication is in english but he wants it in bulgarian.I can translate it from english to bulgarian but i dont know what file i need to change.Can you please tell me ?
Thanks.

marcel1
31st October 2010, 16:48
ehhh... Form1?:shy:

Subsense
31st October 2010, 16:49
ehhh... Form1?:shy:
Thank you :)

marcel1
31st October 2010, 18:02
Good Luck! :thumb:
And Happy Halloween :)

polishdrift
7th November 2010, 05:37
Hi!How to change Welcome to the [RF] Server! to own text? and own website

broken
7th November 2010, 09:29
Hi!How to change Welcome to the [RF] Server! to own text? and own website

[...]
However, if you do not understand even basic programming concepts or are unfamiliar with InSim and/or .NET, then this is not for you. In the current state you will need to modify the source in order to get it to work as you wish. There is also no documentation aside from the code itself.
[...]
and with no warranty or support whatsoever! I will try and help you if you ask an intelligent question, but please don't try and use this if you have no C# experience.
[...]
Once again, this is a very large starting block to run your own cruise server. You will need at least basic understanding of programming concepts and what the InSim protocol is and can do, to take it further. There is little documentation aside from the code itself. If you do not heed this and at least try, then you will not get assistance. [...]
Also: http://www.catb.org/esr/faqs/smart-questions.html#intro

What I'm trying to say is this: Try it yourself first. Google about C# tutorials for starters. Then, when you are on something at least slightly bigger than changing text, ask a question.

Subsense
7th November 2010, 15:43
Hi again.I tryed to translate this insim to bulgarian language but when i enter the server ... language is still in english.I put ^C infront every line that can be translated and still nothing.Can you help me ?

broken
7th November 2010, 17:27
When you apply changes to the source, they don't apply to the built exe immediately. You have to build your project again.

And if you didn't have that flag next to your username, I'd probably just tell you to look back in the pages. Just saying. :razz:

Dygear
7th November 2010, 23:46
@Broken: I think he means for every string he found he added a ^C in front of it, expecting the English that is written after the ^C to be translated into bulgarian.

@Subsense: You have to do more then add the ^C to every line in the source code and recompile. You yourself have to translate this into your language, simply just adding ^C to the string will make the game will do this for you.

Subsense
15th November 2010, 10:51
I translated it finally.Afer that i relpaced uf1 with xrg so i can be able to play on demo.But now is my other question. Is there bank or lotary on Bl1 and if yes.Where are they ? Thanks :)

skywatcher122
15th November 2010, 12:15
try to relocate them by using X Y Z Position ;)

Subsense
15th November 2010, 14:44
What file do i need to open to do this ?

skywatcher122
19th November 2010, 12:57
Like the title say. .NET C#. so its made in C#. So you need Visual Studio C# 2010 (express is free):shy:

he means the X Y Z Positioner on the code

Mikko1
19th November 2010, 13:35
he means the X Y Z Positioner on the code


Oh my apoligize:shy:

pyliuxas
23rd December 2010, 15:20
how should i open the bank??

Ziroh
24th December 2010, 01:30
Anyone have the layout for the insim? Track: AS5

PoVo
24th December 2010, 07:45
Anyone have the layout for the insim? Track: AS5

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

:)

Ziroh
24th December 2010, 11:44
buhu.. :schwitz:

Possible to give me the locations of the places then?

skywatcher122
24th December 2010, 14:46
why not try to locate them using X Y Positioner perhaps?

Ziroh
25th December 2010, 16:08
I don't even know what things that have a X and Y loc, i only know that the bank has a location. So if someone could help me, i would say thanks rest of the life!

PoVo
25th December 2010, 18:31
I don't even know what things that have a X and Y loc, i only know that the bank has a location. So if someone could help me, i would say thanks rest of the life!

However, if you do not understand even basic programming concepts or are unfamiliar with InSim and/or .NET, then this is not for you. In the current state you will need to modify the source in order to get it to work as you wish. There is also no documentation aside from the code itself.

.

Ziroh
25th December 2010, 18:35
I know i know.. -.-

PoVo
25th December 2010, 18:37
I know i know.. -.-

Then please stop asking silly questions. Anything as simple as searching for "AS5" in the form1.cs file would show up the track's code, and that SHOULD contain X, Y coordinates for things.

zoom93host
12th January 2011, 15:29
Hi! Can some one help me out ? The problem is that i had started the MVC# 2008 and 2010 then i load the the Form1.cs but when i try to press F6 nothing it is happening. I've try with Visual Tools Studio CMD when i load the file Form1.cs there is write that have many errors ? Can some one else say how to Compile my file ... If some one from Bulgaria can help me it will be the best! And sorry for my bad English ... :S

? Please help :S

manza47
22nd February 2011, 23:08
I finished setting up and translate it to my server and working perfect :thumb:
But I have some questions
How do I add jobs and places of work? example: Brian's House, Pizza, etc. And as I let the players need to buy food to live? (example, Mahz bought a pizza +50 health, etc)
and how to determine the positions of places to build the layout?
:D

manza47
24th February 2011, 01:12
someone help me? :(

broken
24th February 2011, 08:08
Not me. :D

On a more serious note: It's not just like that "Hey, C#, i want SuperMario's House here. Oh, and I want some jobs to it. Like, deliver mushrooms to it from Snoop Dogg's house.". It requires programming. And by looking at your question - A lot of learning before you actually get to the programming part.

davasko
24th February 2011, 14:27
People help me to russian cruise mod! Need mod !HELP
:MY SKYPE adrenaline930!

manza47
24th February 2011, 16:33
that's what I meant, I would see if anyone could help me learn or understand how works the InSim.

MadCatX
24th February 2011, 17:58
that's what I meant, I would see if anyone could help me learn or understand how works the InSim.

It depends on how much do you really want to know and how detailed understanding you'd like to have. InSim, OutSim and OutGague are basically network interfaces that allow external applications to communicate with LFS. OutSim and OutGauge provide output only, InSim also offers the possibility of controlling few things from an external application (restart race, ban users, etc).
The art of InSim programming is to use this to create something like qualifying system, racing safety control, cruise server... Some are easier to code, some are pretty difficult, but the basic approach is always the same 1) get data from LFS 2) process the data in your application 3) tell LFS to do something.

As broken pointed out, to create or modify an InSim app you need at least basic programming knowledge. If you are familiar with C#, python, C or C++ there are few nice (and one pretty bad) tutorial videos that demonstrate how to create a basic InSim app using some of common InSim libraries, namely InSim.NET(Spark), pyinsim and CInsim.

manza47
24th February 2011, 18:10
It is something basic about programming in C#, thanks to this, I could change some things in this InSim. But my problem arose when asked how creating and locate places and jobs in the track :D

MadCatX
24th February 2011, 19:05
You'd have to specify these using X,Y coordinates and then check if player's car is at those coordinates. Perhaps it's not the easiest thing to begin InSim programming with, but nothing you can't sort out using common sense:)

manza47
24th February 2011, 19:53
Thanks, i will use the coordinates proves to me when I insert a speed trap. :thumbsup::thumbsup::thumbsup:

Edit: I tested with the coordinates that gives the place a trap and not get it to work.

these are the coordinates and range but does not work, see:
http://www.ad-images.com/images/asdfasdfpup.jpg

also like to know the meaning of these numbers I've highlighted in red here http://ad-images.com/images/asdrtg54g.jpg

Dygear
24th February 2011, 21:37
I just had a great idea ... Why not just have the program run through an array of cords and see if the client is in that poly.

Psysim
24th February 2011, 23:25
all im going to say is, i think you wanted....

<= -118 and >= -119

I may be wrong, im half asleep... but they are the wrong way around? Oh, and '/ 196608' that you underlined it correct, it belongs there. You are deviding into meters I believe.

MadCatX
25th February 2011, 07:09
Can you post the whole critical section of the code? It's hard to get anything from the screenshot.
Are you sure these coordinates are correct? And the InSim app you use be using it's own coords system different from the one LFS uses?
Why are you dividing with that weird numer? Dividing by 65536 converts to meters, not sure what 196608 is for...

Psysim
25th February 2011, 09:18
65536

I stand corrected. I was never sure which was correctly a meter, but I know the other is used throughout most peoples applications.

Like MadCatX, I also smell more fail code than is being presented....

skywatcher122
25th February 2011, 10:03
X Y Pos x 196608 divided by 65536 thats the meaning of 196608

I hate maths when im developing a insim -.-

E: @psysim: It wasn't fail code its only dividing the correct numbers to get a XY Pos

MadCatX
25th February 2011, 10:35
What's wrong with maths? It makes your programs look all complex and cool:) (ok, probably not)

196608 / 65536 is three, so that app uses just 3 metres precision.

Can you post the whole " if(coords check) { do stuff } " part? I bet you have something wrong with condition.

skywatcher122
25th February 2011, 11:56
probably i have wrong thing on my post probably.

bcuz coding XY Precisions maps are the thing I don't like it

if ((MCI.Info[i].X / 196608) <= -203) && ((MCI.Info[i].Y / 196608) <= -63)

but i assume its dividing the codes inside of it (too bad im not using LFS External anymore im using spark :()

E: it was using 3 meter instance

Psysim
25th February 2011, 19:25
yeah, I knew / 196608 was ok, it was the other bit i was looking at....

It looked like (at the time) he had inverted his '<' and '>' resulting in everywhere but that location. I was half asleep when I was reading it.

manza47
25th February 2011, 20:13
many thanks to all, I made it work, it really is easy, photos: :thumb::thumb::thumb:
http://ad-images.com/images/working1kek.jpg
http://ad-images.com/images/working2.jpg
My problem was simply that did not respect the right order ( (((MCI.Info[i].X / 196608) >= MINOR VALUE) && ((MCI.Info[i].X / 196608) <= HIGHER VALUE) && ((MCI.Info[i].Y / 196608) >= MINOR VALUE) && ((MCI.Info[i].Y / 196608) <= HIGHER VALUE) LOL
Just the only thing I need is to figure out how I can connect the workplace to work properly.

Psysim
25th February 2011, 20:15
And that ^^ was what I was getting at :)


<= -118 and >= -119

I may be wrong, im half asleep... but they are the wrong way around? Oh, and '/ 196608' that you underlined it correct, it belongs there. You are deviding into meters I believe.

Good job... and good luck! :thumbsup:

And as in work place you mean track?

manza47
25th February 2011, 20:23
What do you mean? I do not understand English very well :(

Psysim
25th February 2011, 20:31
Just the only thing I need is to figure out how I can connect the workplace to work properly.

I was asking about this ^^

skywatcher122
25th February 2011, 20:37
in - values

> lower & < higher eg. >= -45 && <= -43

in more than values
> lower & higher eg. >= 43 && <= 45

thats MCI XY doing ^^

manza47
25th February 2011, 21:53
I was asking about this ^^

exact, i haven't a idea how to accomplish the following: in a place gives the order to delivery to another specific place and win cash $$ xD. (For example, sending a package from home "A " to the house "B")

Psysim
25th February 2011, 22:38
exact, i haven't a idea how to accomplish the following: in a place gives the order to delivery to another specific place and win cash $$ xD. (For example, sending a package from home "A " to the house "B")

ok, you wish to set the X and Y co-ords of the job destination?

If that is correct I would assume the 'place' could be maybe a shop? In the MCI class, under the bit that should say 'Switch' and 'TrackName', you should find a destination? It could be on one of the other tracks 'case SOXX:'

Without actually seeing your code, that is as far as I think anyone could help.

MadCatX
26th February 2011, 09:37
exact, i haven't a idea how to accomplish the following: in a place gives the order to delivery to another specific place and win cash $$ xD. (For example, sending a package from home "A " to the house "B")
There is a plenty of ways how to do this, I'd personally prefer this approach.

1) Create a class CPlayersJob with 4 properties - PLID, reward, xPos, yPos. PLID and reward are self-explanatory, xPos and yPos will hold the coordinates of the destination - where the player has to arrive to complete the job.
2) Create a List<CPlayersJob> and when a player gets a job, add a new CPlayersJob object with correct properties to the list.
3) When an MCI packet arrives, iterate through the list of jobs and check if any player has reached his target destination. If he did, give him the reward and remove the job from the list.

This approach can be improved in several ways, i.e. you could use a Dictionary<PLID, CPlayersJob> instead of List to simplify things and speed your program up a bit...
My knowledge of C# is limited though, so there might be few issues I didn't think of.

manza47
26th February 2011, 18:40
Thanks for the info, I'll see what I can do, I hope I was not complicated. :D

MadCatX
26th February 2011, 19:21
Is there something in particular you don't understand or are you just unfamiliar with Object Oriented Programming? I can provide you with some sample code if you'd like, perhaps it could explain better what I had in mind...

manza47
26th February 2011, 19:32
I'm trying but it's more complicated than I thought :( I'm wrong all the code :gnasher:
It would be excellent to give me an example of the code so I can I edit in terms of names and coordinates to prove it works. :thumb:

MadCatX
26th February 2011, 20:41
The code I can provide will certainly need some adjustments, but I hope you'll get the idea behind "Giving player a job and checking if he has completed it"

First is the CPlayersJob class which defines a job. It defines job as a X/Y coords player has to reach and a reward he gets.

class CPlayersJob
{
public int xCoord, yCoord; //Coordinates of the target destination which player has to reach to complete the job
public int plid; //PLID of the player this job is assigned to
public int reward; //How much money the player gets after completing the job
public bool isFinished = false; //Set to "true" when the job is finished

CPlayersJob(int in_xCoord, int in_yCoord, int in_plid, int in_reward)
{
xCoord = in_xCoord;
yCoord = in_yCoord;
plid = in_plid;
reward = in_reward;
}

/** Checks if the player is at the target destination.
Returns "true" if he is, otherwise returns "false".
Input parameters are coordinates of the player's car.
It also marks the job as finished when the target dest. is reached.
*/
bool IsDestinationReached(int in_xCoord, in_yCoord)
{
if((in_xCoord == xCoord) && (in_yCoord == yCoord))
{
isFinished = true;
return true;
}
return false;
}
}


This is a method you'll probably want to call to give player a job. I'd have to have access to the full source of your application to be more specific about it, but I guess you'll figure out how to use it.

/** Call this method to give player a job. This method will add a new CPlayersJob object
to the activeJobs list. "targetX/YCoords" are coordinates of the destination the player
has to reach to complete the job, plid is player's PLID.
*/
void givePlayerAJob()
{
activeJobs.Add(new CPlayersJob(targetXCoord, targetYCoord, plid, reward));
}


And finally the code you'll want to add to your applications main loop (you know what I mean by "main loop", right?).


/*Boatload of other variables and stuff
...
*/

List<CPlayersJob> activeJobs = new List<CPlayersJob>(); //A list of all active jobs

mainLoop()
{
/*Lots of other stuff your application does
...
...
*/

//Check if any player completed his job
foreach(Info i in MCI.Info) //Iterate through all players
{
int plrId = i.PLID; //Get player's PLID
int x = i.X / 196608;
int y = i.Y / 192608;

foreach(job in activeJobs) //Iterate through all currently active jobs
{
if(job.plid == plrId) //Check if a job is assigned to a player we're processing
{
if(job.IsDestinationReached(x, y)) //Check if a player is at the target destination
{
//He is, reward him.
givePlayerAReward(job.reward); //I don't know how your application handles money, so you'll want to change this
}
}
}

//Remove all finished jobs
activeJobs.RemoveAll(JobIsFinished);
}

/** Predicate that checks if a job is finished or not.
You need to have this to make use of "RemoveAll" method provided by List.
*/
private static bool JobIsFinished(CPlayersJob job)
{
if(job.isFinished)
{
return true;
}
return false;
}


I'm nowhere near a C# compiler so I cannot test anything of this. I might be wrong about few things, but I'm sure that other folks on the forum with more C# knowledge will help you out if something doesn't work...

(really, can anyone actually check out this code? I don't want to confuse manza with some s**t I didn't bother to test)

manza47
26th February 2011, 21:21
Woow, it is more difficult than I thought, I changed some parameters of the coordinates, award, and others, but it still fails in some lines. I can not reach completion. :(

MadCatX
26th February 2011, 22:29
Can you post the parts of code that fail to compile and the error messages you get? It should not be that hard to get it working...

manza47
26th February 2011, 23:13
I have returned to rebuild quickly, and it had cleared, this is what I was
Code:
http://www.imagengratis.org/images/aaaaaaa2.jpg
Error:
http://www.imagengratis.org/images/aaaaaa1tg7xt.jpg
:shrug:

I can send your MSN by private message? To improve communication. xD

skywatcher122
27th February 2011, 03:30
ok i just found my old LFS External cruise I made

here's how jobs work out


int House5Dist = ((int)Math.Sqrt(Math.Pow(Conn.CompCar.X - (-12 * 196608), 2) + Math.Pow(Conn.CompCar.Y - (-113 * 196608), 2)) / 65536);
if (House5Dist < 4 && (Conn.CompCar.Speed / 147) <= 3)
{
if (Conn.InHouse5 == 0)
{
#region ' Jobs Completed '
if (Conn.JobFromShop == 1)
{
if (Conn.JobToHouse1 == 1) // Gonsalez
{
InSim.Send_MTC_MessageToConnection("^6»^7 You have picked the wrong house to Deliver!", Conn.UniqueID, 0);

}
if (Conn.JobToHouse2 == 1) // Kayla's
{
InSim.Send_MTC_MessageToConnection("^6»^7 You have picked the wrong house to Deliver!", Conn.UniqueID, 0);
}
if (Conn.JobToHouse3 == 1) // Rodes's
{
InSim.Send_MTC_MessageToConnection("^6»^7 You have picked the wrong house to Deliver!", Conn.UniqueID, 0);
}
if (Conn.JobToHouse4 == 1) // Joana's
{
InSim.Send_MTC_MessageToConnection("^6»^7 You have picked the wrong house to Deliver!", Conn.UniqueID, 0);
}
if (Conn.JobToHouse5 == 1) // Mika's
{
MsgAll("^6»^7 " + Conn.PlayerName + " ^7Completed a ^2Job^7!");
int prize = new Random().Next(100, 300);
MsgAll("^6»^7 " + Conn.PlayerName + " ^7Earns ^2$" + prize + "^7!");
Conn.Cash += prize;
Conn.JobsDone += 1;
Conn.JobFromShop = 0;
Conn.JobToHouse5 = 0;
}
}
#endregion

#region ' Jobs '
if (Conn.IsOfficer == 0 && Conn.IsCadet == 0 && Conn.IsMafia == 0 && Conn.IsTowTruck == 0)
{
if (Conn.IsBeingChased == 0 && Conn.UniqueID != RobberUCID)
{
if (Conn.CurrentCar == "UFR" || Conn.CurrentCar == "XFR" || Conn.CurrentCar == "FXR" || Conn.CurrentCar == "XRR" || Conn.CurrentCar == "FZR" || Conn.CurrentCar == "MRT" || Conn.CurrentCar == "FBM" || Conn.CurrentCar == "FO8" || Conn.CurrentCar == "FOX" || Conn.CurrentCar == "BF1")
{
InSim.Send_MTC_MessageToConnection("^6»^7 Jobs can be done only in Roadcars!", Conn.UniqueID, 0);
}
else if (Conn.JobToHouse1 == 1 || Conn.JobToHouse2 == 1 || Conn.JobToHouse3 == 1 || Conn.JobToHouse4 == 1 || Conn.JobToHouse5 == 1 || Conn.JobToSchool == 1)
{
InSim.Send_MTC_MessageToConnection("^6»^7 You can only do 1 Job at a time!", Conn.UniqueID, 0);
}
else
{
InSim.Send_MTC_MessageToConnection("^1»^2 !job ^7- Escort Mika's Children to KinderGarten!", Conn.UniqueID, 0);
}
}
else
{
InSim.Send_MTC_MessageToConnection("^6»^7 Can't Take a Job whilst Being Chased!", Conn.UniqueID, 0);
}
}
else
{
InSim.Send_MTC_MessageToConnection("^6»^7 Can't take a Job while in Active Duties!", Conn.UniqueID, 0);
}
#endregion

Conn.InHouse5 = 1;
}
}
else if (House5Dist > 14 && Conn.InHouse5 == 1)
{
Conn.InHouse5 = 0;
}
this code is used to be unreleased in LifeStyle Gamers Organization Cruise (known as LsC before the original owner closed it)

E: geez why Cruise server with jobs this is not fun anymore think other features not like this im obsessed with other cruise server with jobs feature :(

manza47
27th February 2011, 04:17
now i understand. correct me if I'm wrong

Editing the coordenates x/y of:

int House5Dist = ((int)Math.Sqrt(Math.Pow(Conn.CompCar.X - (-12 * 196608), 2) + Math.Pow(Conn.CompCar.Y - (-113 * 196608), 2)) / 65536);
if (House5Dist < 4 && (Conn.CompCar.Speed / 147) <= 3)

would have the starting point of the job, only have to define other destinations (defined with coordinates) with names Conn.JobToHouse1, Conn.JobToHouse2, etc?

skywatcher122
27th February 2011, 04:39
Conn.JobToHouse1 or 2 u must make it in clsConnection

and the XY that you pointed must be located

like in the image showing the X Y on my display which we're the car positioned

btw, you should learn it by yourself C# coding is easy and the image showed is not the base your using its a converted spark insim as far as you know ;)

manza47
27th February 2011, 04:45
I tried with the code, but I have 52 identical errors:
The name 'Conn' does not exist in the current context
and 2:
The name 'MsgAll' does not exist in the current context

I do not understand because before the code, register the parameter and does not accept :(

skywatcher122
27th February 2011, 04:50
don't use MsgAll

just change them into InSim.Send_MST....("/msg > blah blah blah");
and move those Conn. into MCI.Info[i]

bcuz your base is too different on this base (http://www.lfsforum.net/showthread.php?t=47913)

E: /endtuts im done from my teaching

manza47
27th February 2011, 05:05
MsgAll FIXED :thumbsup:
but, can you give me an example of Conn. into MCI.Info[i], :shy:

speedboy86
26th April 2011, 19:29
I tried to put spec when wrong way pits but it dont works i tried MSO and also C.playername but till wont work. Can any one help me with this.



// Pit EXIT
if (((MCI.Info[i].X / 196608) <= -203) && ((MCI.Info[i].Y / 196608) >= -65) && ((MCI.Info[i].Y / 196608) <= -45) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone == 0))
{
if (((MCI.Info[i].Direction / 180) < 80) || ((MCI.Info[i].Direction / 180) > 280))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone = 1;
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^1was fined £200 for wrong way out of pits");
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash -= 200;
InSim.Send_MST_Message("/spec " + Connections[GetConnIdx(NPL.UCID)].Username);
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(NPL.UCID)].PlayerName + "^7spectated wrong way pits " + NPL.CName);
}
}
if (((MCI.Info[i].Y / 196608) < -65) || ((MCI.Info[i].Y / 196608) > -45))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone = 0;
}

// Pit ENTRY
if (((MCI.Info[i].X / 196608) <= -203) && ((MCI.Info[i].Y / 196608) >= -158) && ((MCI.Info[i].Y / 196608) <= -145) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone2 == 0))
{
if (((MCI.Info[i].Direction / 180) < 80) || ((MCI.Info[i].Direction / 180) > 280))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone2 = 1;
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^1was fined £200 for wrong way in pits");
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash -= 200;
InSim.Send_MST_Message("/spec " + Connections[GetConnIdx(NPL.UCID)].Username);
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(NPL.UCID)].PlayerName + "^7spectated wrong way pits " + NPL.CName);
}
}
if (((MCI.Info[i].Y / 196608) < -158) || ((MCI.Info[i].Y / 196608) > -145))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone2 = 0;
}

Heiko1
26th April 2011, 19:36
i think use the MCI version not NPL

eg.
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[x].PLID)].UniqueID)].Username

i hope its right because dont have C# editor in here just made it out of my head.


I Hope i could help you.

speedboy86
26th April 2011, 19:50
Nope didont helped.

PS. im still a biginner at coding.

speedboy86
27th April 2011, 17:27
any one else willing to help me with it

broken
27th April 2011, 20:13
I tried to put spec when wrong way pits but it dont works i tried MSO and also C.playername but till wont work. Can any one help me with this.

Please, when you paste code on the forums, indent it appropriately, to a level that is sufficient enough to scan through it well.

Second, please put the code in [CODE] tags, or even better - ones, if the language is compatible enough, which, imo, C# is.

Third - Please try to resolve the issue yourself first. Look at the code around, especially when it's that much. Look for similarities between your and the other code. Then, when such found, look for differences in the problematic place. This one, is very obvious. But I'm not going to fix it for you just like that. Put some effort in it! You'll find more details in the code and after it.

[PHP]// Pit EXIT
if (((MCI.Info[i].X / 196608) <= -203) && ((MCI.Info[i].Y / 196608) >= -65) && ((MCI.Info[i].Y / 196608) <= -45) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone == 0))
{
if (((MCI.Info[i].Direction / 180) < 80) || ((MCI.Info[i].Direction / 180) > 280))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone = 1;
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^1was fined £200 for wrong way out of pits");
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash -= 200;
// Situation 1
InSim.Send_MST_Message("/spec " + Connections[GetConnIdx(NPL.UCID)].Username);
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(NPL.UCID)].PlayerName + "^7spectated wrong way pits " + NPL.CName);
// END of Situation 1
}
}
if (((MCI.Info[i].Y / 196608) < -65) || ((MCI.Info[i].Y / 196608) > -45))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone = 0;
}

// Pit ENTRY
if (((MCI.Info[i].X / 196608) <= -203) && ((MCI.Info[i].Y / 196608) >= -158) && ((MCI.Info[i].Y / 196608) <= -145) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone2 == 0))
{
if (((MCI.Info[i].Direction / 180) < 80) || ((MCI.Info[i].Direction / 180) > 280))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone2 = 1;
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^1was fined £200 for wrong way in pits");
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash -= 200;
// Situation 2
InSim.Send_MST_Message("/spec " + Connections[GetConnIdx(NPL.UCID)].Username);
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(NPL.UCID)].PlayerName + "^7spectated wrong way pits " + NPL.CName);
// END of Situation 2
}
}
if (((MCI.Info[i].Y / 196608) < -158) || ((MCI.Info[i].Y / 196608) > -145))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone2 = 0;
}

Situation 1: Ok, where do you see a variable named NPL being used in the MCI handler? NPL is usually the name of the packet you receive when a player joins the race. You've changed only the text part, expecting the code to be universal. Well, sorry, but it's not. I want you to resolve this yourself, because around 2 or 3 lines above, a message already is being sent, and let me bet - it sends it successfully.

Situation 2: Absolutely the same thing. Right 2 lines above, I see a message, that will be sent successfully.

So, here's the deal. You fix those, and come back showing me how you've done it. If it's correct, I'll help you make your code in that part a lot more readable, and I'll explain what steps I've taken and why.

Dygear
27th April 2011, 23:28
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[x].PLID)].UniqueID)].Username

Holy mother of christ.

bananas111
5th September 2011, 16:29
How get open track nodes?

joordy599
5th September 2011, 16:42
How get open track nodes?

Well you can use it only if you are an S2 Licensed driver

bananas111
5th September 2011, 17:39
Well you can use it only if you are an S2 Licensed driver
:( it very bad :/

PoVo
5th September 2011, 19:36
How get open track nodes?

Crackor!!!!!!!!!!!!!!!!!!!!!!!!111111111111111#

:clapclap:

joordy599
5th September 2011, 20:19
Crackor!!!!!!!!!!!!!!!!!!!!!!!!111111111111111#

:clapclap:

Well povo, did you have a crack for 0.6B?
And i dont know if there a crack for 0.6B :P

PoVo
9th September 2011, 06:23
Well povo, did you have a crack for 0.6B?
And i dont know if there a crack for 0.6B :P

Can't answer that question. Not allowed.

Grum GTI
14th December 2011, 18:25
hi very very noobish quesstion, but ive never coded anything in my life,

what im tryin g to do is customise the insim so it displays my server name etc, i just have no clue as to which file to open and look into
or to which line of code to edit,

sorry about the noobish questions lol cheers

Patel151
14th January 2012, 22:07
Hmm
I Looked On SO4,BL1 And AS5
and i litteraly didnt find any bank or any stores
can someone plz help me out and give me the map of the places or tell me where each location is because me and my friend spent like 30 minutes finding the bank and we didnt find it

logan2611
16th January 2012, 04:06
Cant get it to work with 0.6b.

broken
16th January 2012, 11:31
hi very very noobish quesstion, but ive never coded anything in my life,

what im tryin g to do is customise the insim so it displays my server name etc, i just have no clue as to which file to open and look into
or to which line of code to edit,

sorry about the noobish questions lol cheers

Well, first of all, you will need Visual C# Express (2008 will do the job, but I recommend 2010 for any future projects you may be developing). Second, maybe a bit disappointing, but you need to learn the basics of the language. Just how to write a Hello World! app might be enough. As much as to learn how to find your way around the code in C#. Then, when you finally get to this InSim app., I think everything you've asked for is located in Form1's code. It's a basic search&replace.

And of course - after modifying the source, NEVER FORGET to BUILD (press F6) your solution. :D
If you don't build it, you'll have a changed source, but when you run the .exe you will find the same old stuff. When you have built it, the new .exe will be located in the bin\Release folder.

Cant get it to work with 0.6b.

Have you tried getting it to work with any other version of LFS? There shouldn't be any difference.

Patel151
17th January 2012, 19:45
Hi
I Love the insim
But is it possible if you can just move the Insim HUD into the middle becuase the insim is good but i want the hud in the top in the middle
can u do that plz?

porez
7th February 2012, 14:29
Hello guys.
Could anyone give me an advice how to adjust this code to track's open configuration?

bananas111
16th February 2012, 19:37
Hi,
How to make this message to only that user who has done job?
InSim.Send_MST_Message("/msg ^6|^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^3finish his job for €" + prize);

kdo
16th February 2012, 20:01
InSim.Send_MST_Message("/msg ^6|^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^3finish his job for €" + prize);
to
InSim.Send_MTC_MessageToConnection("message like job finnished for for €" + prize", Conn.UniqueID, 0);

bananas111
17th February 2012, 07:52
InSim.Send_MST_Message("/msg ^6|^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^3finish his job for €" + prize);
to
InSim.Send_MTC_MessageToConnection("message like job finnished for for €" + prize", Conn.UniqueID, 0);
Thanks,
But it's isn't work in current context. When I type it I got error The name 'Conn' does not exist in the current context

Bose321
17th February 2012, 11:32
Thanks,
But it's isn't work in current context. When I type it I got error The name 'Conn' does not exist in the current context
I have no idea about this insim whatsoever, but would this work:

InSim.Send_MTC_MessageToConnection("message like job finnished for for €" + prize", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)], 0);

bananas111
17th February 2012, 12:15
If it possible I think I know how I can do it but can I make this message say not host but that who stop in that placeInSim.Send_MST_Message("!help");

sankkuq
21st April 2012, 11:12
Please note I've added the BSD License (http://en.wikipedia.org/wiki/BSD_License) to this project. It's hard to explain, so take a look at the wikipedia link if you need more info :)

I've updated v1.0.2 to include it also.

Where i can find cmds for this insim ? and map ?