Integration

Integrating the application into your crime and heist resources will unlock the full potential of Cornerstone Scoreboard. To make this easier we have provided several exports and examples below to get you started. Integrating Cornerstone Scoreboard

Example integration into QBX Storerobbery

This example demonstrates how to add Cornerstone Scoreboard's activity cooldowns to an existing script. The supplied resource handles store robberies. Below is a trimmed excerpt of the original code and the changes required to integrate scoreboard exports.

Before

RegisterNetEvent('qbx_storerobbery:server:checkStatus', function()
  local coords = GetEntityCoords(GetPlayerPed(source))
  local closestRegisterIndex = getClosestRegister(coords)
  if not closestRegisterIndex then return end

  local hasLockpick = exports.ox_inventory:Search(source, 'count', 'lockpick') > 0
  local hasAdvanced = exports.ox_inventory:Search(source, 'count', 'advancedlockpick') > 0

  if hasLockpick then
    TriggerClientEvent('qbx_storerobbery:client:initRegisterAttempt', source, false)
  elseif hasAdvanced then
    TriggerClientEvent('qbx_storerobbery:client:initRegisterAttempt', source, true)
  else
    exports.qbx_core:Notify(source, 'You don\'t have the appropriate items', 'error')
  end

  startedRegister[source] = true
  sharedConfig.registers[closestRegisterIndex].robbed = true
end)

After

Last updated