The online racing simulator
Out of the track and pitlane
Hello,

Sorry for bad english

I want help because i want if one player go out of the track or if him go in pit but him are on track him lost cash !
and one command !tow or !pitlane

Could you help me please
its fairly easy
just look up what to give like
if player pits then cash -500 or so
and
case "!tow"
"/msg, your tow will arrive soon." + "/pit"
cash -500
this is very rough example tho
ok thanks you kiss but i am not realy bigest programer me ^^
I dont see where is player pits

And for tow ?

<?php 
 
              
case "!tow":
InSim.Send_MTC_MessageToConnection("^7your tow will arrive soon " Connections[GetConnIdx(MSO.UCID)].pitMSO.UCID0);
Connections[GetConnIdx(MSO.UCID)].Cash -= 500;
                    break;
?>

But if player are on pitbox him pay 500? or pitbox detected ?
Quote from Kordan59 :ok thanks you kiss but i am not realy bigest programer me ^^
I dont see where is player pits

And for tow ?

<?php 
 
              
case "!tow":
InSim.Send_MTC_MessageToConnection("^7your tow will arrive soon " Connections[GetConnIdx(MSO.UCID)].pitMSO.UCID0);
Connections[GetConnIdx(MSO.UCID)].Cash -= 500;
                    break;
?>

But if player are on pitbox him pay 500? or pitbox detected ?

i dont really understand what you mean, are you dutch or french?
else, post what you mean in your own language.
the .pit aint right soo iirc
here is my code to make you pit on !pitlane

case "!pitlane":
InSim.Send_MTC_MessageToConnection("^3Please stop your car.", MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("^3You will return to pits soon.", MSO.UCID, 0);
InSim.Send_MST_Message("/pitlane " + Connections[GetConnIdx(MSO.UCID)].Username);
break;

then just add your command to take cash.
it works
i tried
i hope i helped alot
ok, this checks i you have enough money to pitlane in the first place:

case "!pitlane":
if (Connections[GetConnIdx(MSO.UCID)].Cash <= -399)
InSim.Send_MTC_MessageToConnection("^3you do not have enough money.", MSO.UCID, 0);
else
{
InSim.Send_MTC_MessageToConnection("^3Please stop your car.", MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("^3You will return to pits soon.", MSO.UCID, 0);
InSim.Send_MST_Message("/pitlane " + Connections[GetConnIdx(MSO.UCID)].Username);
Connections[GetConnIdx(MSO.UCID)].Cash -= 600;
InSim.Send_MST_Message(Connections[GetConnIdx(MSO.UCID)].PlayerName + " got towed back to pits for ^7€600");
}
break;

if you have more then -399 you wont get pitlaned
i did 399, so if you pitlane, you dont get banned (if you have the code to band if cash is less then -1000


EDIT: here is ban code

if (Connections[GetConnIdx(NPL.UCID)].Cash < -1000)
{
InSim.Send_MST_Message("^1" + Connections[GetConnIdx(NPL.UCID)].PlayerName + " ^1has gone bankrupcy, banned for 2 days!");
InSim.Send_MST_Message("/ban " + Connections[GetConnIdx(NPL.UCID)].Username + " 2");
}

Realy thanks kiss me for your help

i am french

But if driver are in pitbox and him use shift+p him lose cash or no ?

because me i want people lost cash if go in pit on track no in pitbox you see

just want one code like ltc or clc you see ?

People go in pit on track lose 500
People are in pitbox go in pit lose 0
People use !tow lost 250
People use !tow but dont have cash lost 250
People have -15.000 ban
well i"m still working on that. for now they dont loose cash if they just go in pit, but i will give you that code soon
You can look at the MCI packets sent. They contain each player's X/Y positions. By finding out out the X/Y position of the pit area, you can see if they're inside it. It's really up to you what you want to do with the information of them being in/out of the pits. You could assign each player a variable (using LFS External's connection list), that has it's value set by deciding where the player is...if you follow me
i'll do a square on the pits, if your in there, then pit is 50€ if not in there then 300€ for ex.
just need to know how to detect when a player pits
uhm, possible with MCI.Info[i].Node?
this nodes no is true, is a example.

if ((MCI.Info[i].Node < 0) && (MCI.Info[i].Node > 10))
{
}
Quote from kiss me :i'll do a square on the pits, if your in there, then pit is 50€ if not in there then 300€ for ex.
just need to know how to detect when a player pits

*e-sigh* I don't know whether to laugh or cry
Quote from kiss me :i'll do a square on the pits, if your in there, then pit is 50€ if not in there then 300€ for ex.
just need to know how to detect when a player pits

yes i want this
Quote from ReVoX :uhm, possible with MCI.Info[i].Node?
this nodes no is true, is a example.

if ((MCI.Info[i].Node < 0) && (MCI.Info[i].Node > 10))
{
}

not unless u want them to have a free pit on the road outside of the pits also. or ANY area in the noes between 0 - 10
From InSim.txt...
struct IS_PLA // Pit LAne
{
byte Size; // 8
byte Type; // ISP_PLA
byte ReqI; // 0
byte PLID; // player's unique id

byte Fact; // pit lane fact (see below)
byte Sp1;
byte Sp2;
byte Sp3;
};

// Pit Lane Facts
enum
{
PITLANE_EXIT, // 0 - left pit lane
PITLANE_ENTER, // 1 - entered pit lane
PITLANE_NO_PURPOSE, // 2 - entered for no purpose
PITLANE_DT, // 3 - entered for drive-through
PITLANE_SG, // 4 - entered for stop-go
PITLANE_NUM
};

struct IS_PIT // PIT stop (stop at pit garage)
{
byte Size; // 24
byte Type; // ISP_PIT
byte ReqI; // 0
byte PLID; // player's unique id

word LapsDone; // laps completed
word Flags; // player flags

byte Sp0;
byte Penalty; // current penalty value (see below)
byte NumStops; // number of pit stops
byte Sp3;

byte Tyres[4]; // tyres changed

unsigned Work; // pit work
unsigned Spare;
};

struct IS_PSF // Pit Stop Finished
{
byte Size; // 12
byte Type; // ISP_PSF
byte ReqI; // 0
byte PLID; // player's unique id

unsigned STime; // stop time (ms)
unsigned Spare;
};

struct IS_PLP // PLayer Pits (go to settings - stays in player list)
{
byte Size; // 4
byte Type; // ISP_PLP
byte ReqI; // 0
byte PLID; // player's unique id
};

It seems to me that with these four packets you can create the feature you are looking for.
@Robbo01: You have reason, this detect the side of the pit and pit.

Making a rectangle with X and Y?
Quote from ReVoX :@Robbo01: You have reason, this detect the side of the pit and pit.

Making a rectangle with X and Y?

ye just use X,Y Co-ordinates to make a rectangle for the pits and if they are in there make it safe pit else Not Safe

FGED GREDG RDFGDR GSFDG