Module core.metatables.sv_vehicle

Serverside Vehicle Metatable.

Module Overview

Functions

vMeta:lock(emote) Lock a vehicle.
vMeta:unlock(emote) Unlock a vehicle.
vMeta:TurnOn(emote) Turn on a vehicle.
vMeta:TurnOff(emote) Turn off a vehicle.
vMeta:SetHP(hp[, If=true]) Set the vehicle's new HP.
vMeta:_AddHP(hp[, If=true]) Add HP to a vehicle.
vMeta:AddHP(hp[, If=true]) Adds HP to a vehicle and runs appropriate actions (disabling the vehicle on 0 HP)
This is a high level interface, so clamps HP in the 0 - 100 range.

Functions

vMeta:lock(emote)
Lock a vehicle.

Parameters:

  • emote Add notification, sound and lockdelay if true
vMeta:unlock(emote)
Unlock a vehicle.

Parameters:

  • emote Add notification, sound and unlockdelay if true
vMeta:TurnOn(emote)
Turn on a vehicle.

Parameters:

  • emote Determine if player should emote the action or not.
vMeta:TurnOff(emote)
Turn off a vehicle.

Parameters:

  • emote Determine if player should emote the action or not.
vMeta:SetHP(hp[, If=true])
Set the vehicle's new HP.
This is a low level interface, so does not clamp HP in the 0 - 100 range.

Parameters:

  • hp int New health.
  • If bool the HP should be saved in the DB. (default true)

Returns:

    int New HP
vMeta:_AddHP(hp[, If=true])
Add HP to a vehicle.
This is a higher level interface, so clamps HP in the 0 - 100 range.

Parameters:

  • hp int Health to add.
  • If bool the HP should be saved in the DB. (default true)

Returns:

    int New HP
vMeta:AddHP(hp[, If=true])
Adds HP to a vehicle and runs appropriate actions (disabling the vehicle on 0 HP)
This is a high level interface, so clamps HP in the 0 - 100 range.

Parameters:

  • hp int Health to add.
  • If bool the HP should be saved in the DB. (default true)

Returns:

  1. int New HP
  2. bool If the vehicle is stopping
  3. bool If the vehicle is starting