Skip to content

Module: Vehicle

Аниса edited this page Jun 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 vehicle makes sense, this module comes into the play!

━ APIs

⚠️ Disclaimer:

Syntax #2 should only be used in conjunction w/ thread

━ dbify.vehicle.fetchAll() (Server)

@Objective: Fetches all existing vehicles.
--Syntax #1:
local bool: state = dbify.vehicle.fetchAll(
  table: {
    --These are conditional datas that has to be used for the query
    {string: columnName, ~: columnValue},
  },
  function: callback(table: result, table: arguments),
  ~: ...arguments
)

--Syntax #2:
local table: result, table: arguments = self:await(dbify.vehicle.fetchAll(
  thread: self,
  table: {
    --These are conditional datas that has to be used for the query
    {string: columnName, ~: columnValue},
  },
  ~: ...arguments
))

━ dbify.vehicle.create() (Server)

@Objective: Creates a new vehicle.
--Syntax #1:
local bool: state = dbify.vehicle.create(
  function: callback(int: vehicleID, table: arguments),
  ~: ...arguments
)

--Syntax #2:
local int: vehicleID, table: arguments = self:await(dbify.vehicle.create(
  thread: self,
  ~: ...arguments
))

━ dbify.vehicle.delete() (Server)

@Objective: Deletes an existing vehicle.
--Syntax #1:
local bool: state = dbify.vehicle.delete(
  int: vehicleID,
  function: callback(bool: result, table: arguments),
  ~: ...arguments
)

--Syntax #2:
local bool: result, table: arguments = self:await(dbify.vehicle.delete(
  thread: self,
  int: vehicleID,
  ~: ...arguments
))

━ dbify.vehicle.setData() (Server)

@Objective: Sets vehicle datas of a valid vehicle.
--Syntax #1:
local bool: state = dbify.vehicle.setData(
  int: vehicleID,
  table: {
    --These are columns that has to be updated w/ their respective values
    {string: columnName, ~: columnValue},
    ...
  },
  function: callback(bool: result, table: arguments),
  ~: ...arguments
)

--Syntax #2:
local bool: result, table: arguments = self:await(dbify.vehicle.setData(
  thread: self,
  int: vehicleID,
  table: {
    --These are columns that has to be updated w/ their respective values
    {string: columnName, ~: columnValue},
    ...
  },
  ~: ...arguments
))

━ dbify.vehicle.getData() (Server)

@Objective: Retrieves vehicle datas of a valid vehicle.
--Syntax #1:
local bool: state = dbify.vehicle.getData(
  int: vehicleID,
  table: {
    --These are columns whose values are to be retrieved
    string: columnName,
    ...
  },
  function: callback(table: result, table: arguments),
  ~: ...arguments
)

--Syntax #2:
local table: result, table: arguments = self:await(dbify.vehicle.getData(
  thread: self,
  int: vehicleID,
  table: {
    --These are columns whose values are to be retrieved
    string: columnName,
    ...
  },
  ~: ...arguments
))
Clone this wiki locally