IS NPL

From LFS Manual
Revision as of 11:20, 10 February 2026 by Bokujishin (talk | contribs) (Created page with "== Introduction == The '''N'''ew '''PL'''ayer packet is sent by LFS when a player joins the race (joins the grid or leaves the pits). It can also be sent as a reply to a In...")
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to navigationJump to search

Introduction

The New PLayer packet is sent by LFS when a player joins the race (joins the grid or leaves the pits). It can also be sent as a reply to a TINY_NPL packet.

IS_NPL packet properties
Type Name Description
byte Size 76
byte Type ISP_NPL
byte ReqI 0 unless this is a reply to an TINY_NPL request
byte PLID player's newly assigned unique id
byte UCID connection's unique id
byte PType bit 0: female / bit 1: AI / bit 2: remote
word Flags player flags
char PName[24] nickname
char Plate[8] number plate - NO ZERO AT END!
char CName[4] car name
char SName[16] skin name - MAX_CAR_TEX_NAME
byte Tyres[4] compounds
byte H_Mass added mass (kg)
byte H_TRes intake restriction
byte Model driver model
byte Pass passengers byte
byte RWAdj low 4 bits: tyre width reduction (rear)
byte FWAdj low 4 bits: tyre width reduction (front)
byte Sp2
byte Sp3
byte SetF setup flags (see below)
byte NumP number in race - ZERO if this is a join request
byte Config configuration (see below)
byte Fuel /showfuel yes: fuel percent / no: 255

Packet Details

Size

The size of the packet is always 70 bytes.

Type

The packet type from the ISP_ enumeration, always ISP_NPL.

ReqI

ReqI is equal to zero, unless the packet is a reply to a TINY_NPL request.

UCID

The connection's unique ID.

PType

Flags for the player:

  • bit 0: female
  • bit 1: AI
  • bit 2: remote

Flags

Player settings and help flags:

#define PIF_LEFTSIDE		1
#define PIF_RESERVED_2		2
#define PIF_RESERVED_4		4
#define PIF_AUTOGEARS		8

#define PIF_SHIFTER			0x10
#define PIF_FLEXIBLE_STEER	0x20
#define PIF_HELP_B			0x40
#define PIF_AXIS_CLUTCH		0x80

#define PIF_INPITS			0x0100
#define PIF_AUTOCLUTCH		0x0200
#define PIF_MOUSE			0x0400
#define PIF_KB_NO_HELP		0x0800

#define PIF_KB_STABILISED	0x1000
#define PIF_CUSTOM_VIEW		0x2000

PName

The player's in-game name.

Plate

The player's number plate (all 8 bytes are used, the last byte is not zero).

CName

The car's name. See IS_SLC#CName for more details.

SName

The player's skin name.

Tyres

The tyre compounds for each wheel (rear left, rear right, front left, front right), from the TYRE_ enumeration.

H_Mass

The added mass in kg.

H_TRes

The intake restriction.

Model

The driver model, which can be changed in the Options > Driver menu. You can use this to enforce the use of helmets, as some models do not wear one.

Pass

The passengers in the car, 2 bits are used for each passenger:

  • Bit 0: front male
  • Bit 1: front female
  • Bit 2: rear left male
  • Bit 3: rear left female
  • Bit 4: rear middle male
  • Bit 5: rear middle female
  • Bit 6: rear right male
  • Bit 7: rear right female

RWAdj

Tyre width reduction (rear tyres). This is only available on some official cars, and works similarly to Config.

FWAdj

Tyre width reduction (front tyres). This is only available on some official cars, and works similarly to Config.

SetF

Setup flags:

  • SETF_SYMM_WHEELS (1): symmetric wheels
  • SETF_TC_ENABLE (2): Traction Control enabled
  • SETF_ABS_ENABLE (4): ABS enabled

NumP

Number of players in race. If the packet is a join request (see IS_ISI#Flags for handling join requests), NumP is zero.

Config

The vehicle's configuration. Each vehicle can allow multiple configurations, and some of them (for official cars) allow changing RWAdj and FWAdj.

Fuel

Shows the fuel the player joined with, if using /showfuel yes, otherwise Fuel is 255.