CityRP Documentation Repository

cityrp.teslaCharger

Tesla Charger plugin (shared).

Shared definitions and entity helpers for the Homecharger and Supercharger price UI and owner billing workflow.

Functions

Sharedcityrp.teslaCharger.ApplyEntityShared(ent)Source ☍

Applies shared NetworkVar and price accessors to a charger ENT table.

Parameters

  • enttable
Sharedcityrp.teslaCharger.BasePrice() → numberSource ☍

The configured base recharge cost, as a whole number.

Returns

  1. number
Sharedcityrp.teslaCharger.GetHeading(ent) → stringSource ☍

Menu title for a charger entity.

Parameters

Returns

  1. string
Servercityrp.teslaCharger.InitializePrice(charger)Source ☍

Sets a charger's default price to the configured base cost.

Parameters

Sharedcityrp.teslaCharger.IsCharger(ent) → booleanSource ☍

Whether an entity is a player-owned Tesla charger.

Parameters

  • entEntity|nilThe entity metatable, with CityRP's own additions to Garry's Mod's Entity.

Returns

  1. boolean
Sharedcityrp.teslaCharger.MaxPrice() → numberSource ☍

The maximum price an owner may set, as a whole number.

Returns

  1. number
Servercityrp.teslaCharger.OpenPriceUI(ply, charger)Source ☍

Opens the owner price UI for a charger, if the player may configure it.

Parameters

Tables

Sharedcityrp.teslaCharger.CLASSESSource ☍

Fields

Sharedcityrp.teslaChargerSource ☍
Sharedcityrp.teslaCharger.NET_OPEN_UISource ☍
Sharedcityrp.teslaCharger.NET_SET_PRICESource ☍
Sharedcityrp.teslaCharger.PRICE_MULTIPLIER_MAXSource ☍