Skip to content

Module: Vehicle

Аниса edited this page Dec 16, 2022 · 22 revisions

━ What's the Objective?

This module provides a custom vehicle management interface to integrate w/ your resources.

For servers such as DayZ, Roleplay, RPG, Arenas where saving vehicles makes sense, this module comes into the play!

━ APIs

━ dbify.module.vehicle.fetchAll() (Server)

@Objective: Fetches all existing vehicles.
local table: result, table: arguments = dbify.module.vehicle.fetchAll(
  table: {
    --Conditional datas to be used for the query
    {string: columnName, ~: columnValue},
    ...
  },
  bool: isSoloFetch, --Enabling this returns only first row of the retrieved result
  ~: ...arguments
)

━ dbify.module.vehicle.create() (Server)

@Objective: Creates a new vehicle.
local int: vehicleID, table: arguments = dbify.module.vehicle.create(
  ~: ...arguments
)

━ dbify.module.vehicle.delete() (Server)

@Objective: Deletes an existing vehicle.
local bool: result, table: arguments = dbify.module.vehicle.delete(
  int: vehicleID,
  ~: ...arguments
)

━ dbify.module.vehicle.setData() (Server)

@Objective: Sets vehicle datas of a valid vehicle.
local bool: result, table: arguments = dbify.module.vehicle.setData(
  int: vehicleID,
  table: {
    --Columns to be updated w/ their respective values
    {string: columnName, ~: columnValue},
    ...
  },
  ~: ...arguments
)

━ dbify.module.vehicle.getData() (Server)

@Objective: Retrieves vehicle datas of a valid vehicle.
local table: result, table: arguments = dbify.module.vehicle.getData(
  int: vehicleID,
  table: {
    --Columns whose values are to be retrieved
    string: columnName,
    ...
  },
  ~: ...arguments
)