CityRP Documentation Repository

core.libraries.meska.dailybonus.server.init

Metrics-Skill-Achievement Framework (MESKA) The dailybonus-system core functions.

Functions

Servermeska.dailybonus.add(skill, buff, tmp, cb) → integer|nilSource ☍

Adds dailybonus for a skill to the storage.

Parameters

  • skillanyThe skill.
  • buffanyThe buff.
  • tmpanyIf false, store in db. Default: false. @func[opt] cb Callback Function with id as return value.
  • cbany

Returns

  1. integer|nil
Servermeska.dailybonus.get(skill) → integerSource ☍

Gets total buffs of active dailybonuses for a skill.

Parameters

  • skillanyThe skill.

Returns

  1. integerTotal buffs.
Servermeska.dailybonus.getAllActive(skill) → tableSource ☍

Gets all active dailybonuses for a skill.

Parameters

  • skillanyThe skill.

Returns

  1. tableActive dailybonuses.
Servermeska.dailybonus.load(cb) → tableSource ☍

Loads all dailybonuses from DB or storage. @func[opt] cb Callback Function.

Parameters

  • cbany

Returns

  1. table
Servermeska.dailybonus.remove(skill, id, cb) → nilSource ☍

Removes a dailybonus.

Parameters

  • skillanyThe skill.
  • idanyThe id. @func[opt] cb Callback Function.
  • cbany

Returns

  1. nil
Servermeska.dailybonus.syncToClient(ply, cb)Source ☍

Syncs dailybonus to a player.

Parameters

  • plyanyPlayer Entity or nil. @func[opt] cb Callback Function.
  • cbany
Servermeska.dailybonus.syncToClients(cb)Source ☍

Syncs dailybonus to all players. @func[opt] cb Callback Function.

Parameters

  • cbany
Servermeska.dailybonus.update(skill, id, buff, cb) → nilSource ☍

Updates dailybonus.

Parameters

  • skillanyThe skill.
  • idanyThe id.
  • buffanyThe buff. @func[opt] cb Callback Function.
  • cbany

Returns

  1. nil

Tables

Servermeska.dailybonus.storageSource ☍

Fields

Servermeska.dailybonus.cacheKeySource ☍