Git Product home page Git Product logo

da_qbwrapper's Introduction

da_qbwrapper

This script allowes you to use ESX-Ressources in QB-Framework

how to use

  1. download you ESX-Script you want ot use.
  2. replace ESX = exports["es_extended"]:getSharedObject() or TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) to ESX = exports["da_qbwrapper"]:getSharedObject()
  3. Make sure to Start this script before your ESX-Script and after qb-core.
  4. Run your ESX-Script

example header of file

ESX = nil
  while ESX == nil do
    if GetResourceState('es_extended') == 'started' then
      ESX = exports["es_extended"]:getSharedObject()
    elseif GetResourceState('qb-core') == 'started' and GetResourceState('da_qbwrapper') == 'started' then 
      ESX = exports["da_qbwrapper"]:getSharedObject()    
    else
      print('^1[ERROR] You have not started ESX or QB-Core in combination with da_qbwrapper. Make sure to start the scripts before this one! ^7')
      break
  end
end 

Database users => players

IF your script uses the users table of ESX make sure that you replace it with the players table of QB, this won't get replaced! Make sure to replace firstname, lastname etc with json.decode function example for esx_documents/server.lua:

Original:

MySQL.Async.fetchAll("SELECT firstname, lastname, dateofbirth FROM users WHERE identifier = @owner", {['@owner'] = xPlayer.identifier}, function(result)
  if result[1] ~= nil then
      cb_data = result[1]
      cb(cb_data)
  else
      cb(cb_data)
  end
end)

Changed:

MySQL.Async.fetchAll("SELECT charinfo FROM players WHERE citizenid = @owner", {['@owner'] = xPlayer.identifier}, function(result)

  if result[1] ~= nil then
    local charinfo = json.decode(result[1].charinfo)

    cb_data = {
        firstname = charinfo.firstname
        ,lastname = charinfo.lastname
        ,dateofbirth = charinfo.birthdate
    }

    cb(cb_data)
  else
    cb(cb_data)
  end
end)

@fxmanifest of your script

If it uses @es_extended/locale.lua replace it with @da_qbwrapper/locale.lua

Support

IF you have any errors with this script make an issue or concat me directly on Discord.. DaBurnerGermany is the tag you wanna search.

Others

Enjoy! :)

Version

Current is the Version 1.0.0.

See here The Updates if there are any..

da_qbwrapper's People

Contributors

daburnergermany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

yussko

da_qbwrapper's Issues

cant get this to work

trying to use it with esx_gunrange. cant find DaBurnerGermany on discord.

this is the error i am getting

[ script:qb-core] SCRIPT ERROR: error object is not a string

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.