Giter Club home page Giter Club logo

qb-phone's Introduction

Installation steps

General Setup

General setup is quite easy, delete your OLD qb-phone if you server havent been running previously then go ahead and run the provided SQL file in your database.

If your server has been running qb-phone previously please update your sql while being carefull and take a backup so you have no data lost.

After the SQL setup you can now drop the resource into your server and start it up while you conduct the next steps.

Employment setup

Setting up employment and multijob can be quite tricky so make sure to reread this if you have any issues... If you already have a multijob system and you do not wish to use this then you can skip this step.

  1. Head over to qb-phone/server/employment.lua and change local FirstStart from false to true like shown below
    local FirstStart = true
  1. Start the script and make sure it's fully done, it can take a while depending on your current playerbase (ensure qb-phone in console or f8)

  2. Head over to qb-phone/server/employment.lua again and change the FirstStart to false

Like so:

    local FirstStart = false
  1. Headover to your qb-core/server/commands.lua and find the follow command 'setjob'

replace the commands with the code below:

QBCore.Commands.Add('setjob', 'Set A Players Job (Admin Only)', { { name = 'id', help = 'Player ID' }, { name = 'job', help = 'Job name' }, { name = 'grade', help = 'Grade' } }, true, function(source, args)
    local Player = QBCore.Functions.GetPlayer(tonumber(args[1]))
    if Player then
        Player.Functions.SetJob(tostring(args[2]), tonumber(args[3]))
        exports['qb-phone']:hireUser(tostring(args[2]), Player.PlayerData.citizenid, tonumber(args[3]))
    else
        TriggerClientEvent('QBCore:Notify', source, Lang:t('error.not_online'), 'error')
    end
end, 'admin')
  1. Now below that add the new command called 'removejob' like shown below
QBCore.Commands.Add('removejob', 'Removes A Players Job (Admin Only)', { { name = 'id', help = 'Player ID' }, { name = 'job', help = 'Job name' } }, true, function(source, args)
    local Player = QBCore.Functions.GetPlayer(tonumber(args[1]))
    if Player then
        if Player.PlayerData.job.name == tostring(args[2]) then
            Player.Functions.SetJob("unemployed", 0)
        end
        exports['qb-phone']:fireUser(tostring(args[2]), Player.PlayerData.citizenid)
    else
        TriggerClientEvent('QBCore:Notify', source, Lang:t('error.not_online'), 'error')
    end
end, 'admin')
  1. If you use qb-cityhall then u have to Find ApplyJob in qb-cityhall/server/main.lua and replace with this one
RegisterNetEvent('qb-cityhall:server:ApplyJob', function(job, cityhallCoords)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    if not Player then return end
    local ped = GetPlayerPed(src)
    local pedCoords = GetEntityCoords(ped)
    local JobInfo = QBCore.Shared.Jobs[job]
    if #(pedCoords - cityhallCoords) >= 20.0 or not availableJobs[job] then
        return DropPlayer(source, "Attempted exploit abuse")
    end
    Player.Functions.SetJob(job, 0)
    exports['qb-phone']:hireUser(job, Player.PlayerData.citizenid, 0)
TriggerClientEvent('QBCore:Notify', src, Lang:t('info.new_job', {job = JobInfo.label}))
end)
  1. Restart your server fully to get the new commands working and also to get the phone fully working.

It should now look like this

QBCore Commands

Crypto Setup

  1. Head over to your qb-core/server/Player.lua
  2. Paste the below code into your metadata if you dont know what is metadata it looks something like this: PlayerData.metadata['inside']

Code to be pasted

    PlayerData.metadata['crypto'] = PlayerData.metadata['crypto'] or {
        ["shung"] = 0,
        ["gne"] = 0,
        ["xcoin"] = 0,
        ["lme"] = 0
    }

It should now all look like this:

Metadata Table

This is pretty much everything to do with setting up the phone. If you encounter any issues please open a issue tab here on Github and I will try to fix them asap.

Contributors

Main Contributors

FjamZoo

GitHub

GitHub

GitHub

MannyOnBrazzers

GitHub

GitHub

GitHub

Other Contributors

uShifty

GitHub

GitHub

iLLeniumStudios

GitHub

GitHub

ChatDisabled

GitHub

Devyn

Thanks to devyn for allowing us to use his original Group Backend code for the phone.

GitHub

ST4LTH

GitHub

Other Other Contributors

DevTheBully

GitHub

JonasDev99

GitHub

Other Other Other Contributors

QBCore

Made the original phone ages ago and it was ok ish so shoutout to them IG

Kakarot

He cured my boredom over at twitch.tv/kakarotqb

amir_expert

Sold a $50 CSS and JS edit pretty poggers

Booya

Reuploaded a $50 CSS and JS edit even more poggers

qb-phone's People

Contributors

mannyonbrazzers avatar dhawgy avatar fjamzoo avatar ushifty avatar theilleniumstudios avatar swompen avatar chainedster avatar ok1ez avatar havix123 avatar chatdisabled avatar st4lth avatar harithmichael avatar elajnabe avatar krnktv avatar anishbplayz avatar jonasdev17 avatar s1lentcodes avatar xviperag avatar impulsefps avatar manliketjb avatar noskills7 avatar nugitv avatar paruthepro avatar siromgitsyou avatar andr3817 avatar

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.