Skip to content

five-on-it / packages/sim/src/mods / buyMod

Function: buyMod() ​

buyMod(sim, car, client, service): ModOffer | undefined

Defined in: packages/sim/src/mods.ts:456

Buys the upgrade an input's service asks for (MOD_SHOP) for the car car the player client is at the wheel of in a garage: when the car has it not already, and the client has its price in Cash, which is taken. Records a mod event (weapon the offer's index in the shop, length its price). Returns the offer bought, or nothing.

Parameters ​

sim ​

SimWorld

car ​

number

client ​

number

service ​

number

Returns ​

ModOffer | undefined