Giter VIP home page Giter VIP logo

qb-core's People

Contributors

asaayu avatar berkiebb avatar chatdisabled avatar d4isdavid avatar darknight2590 avatar demo4889 avatar developer-bear avatar dogsmoker avatar evanillaa avatar ghzgarage avatar goncalocarvalho95 avatar hakos47 avatar idrisdose avatar ihyajb avatar itsanobrainer avatar jellyton255 avatar kamuikody avatar kierwin1987 avatar kywan avatar liamdormon avatar lionh34rt avatar mycroft-studios avatar notaestheticallyducko avatar r0adra93 avatar s33g avatar tasooneasia avatar theilleniumstudios avatar tom-osborne avatar tonybynmp4 avatar z3rio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qb-core's Issues

I wanted to give a suggestion for shared.lua

The file is divided into a number of files Why
Ease of modification and access to what you need
Ease of tracking errors
create folder name shared
and put this file in shared folder

vehicles.lua
jobs.lua
weapons.lua
shared.lua -- for item
I think the issue of the amendment is very important
shared file 4554 line big file

I hope the suggestion will be of interest
It will be a wonderful modification to the project

qb-vehicleshop

If purchased a car and (DID NOT MOD it) car color will keep change constantly when pulling it from garage.

Unless you mod anything at bennys then color will be saved.

Latest QB-Core
Latest QB-Vehicleshop

Whitelist with rockstar licenses

Qb is not compatible with steam now so how to get rockstar license if u are a normal player that want to register the whitelist

BUG: sql file doesnt create the playeritems table

when loading into my server I get the following message
```[qb-core] An error happens for query "SELECT * FROM playeritems WHERE `citizenid` = '****' : []": ER_NO_SUCH_TABLE: Table 'mooseh_fivem.playeritems' doesn't exist``

I checked the SQL file and it doesn't create the playeritems table, making for a bad install from the get go.

Failed to load script server/player.lua

I'm having issues with qb-core an dnot sure how to fix it. This is with the latest update to the core files.

[ c-scripting-core] Creating script environments for qb-core
[ script:qb-core] Error loading script server/player.lua in resource qb-core: @qb-core/server/player.lua:640: attempt to call a nil [ script:qb-core] stack traceback:
[ c-scripting-core] Failed to load script server/player.lua.
[ citizen-server-impl] citizen-server-impl] Started resource qb-core

new pull

QBCore.RequestId = 0

QBCore.Functions.GetPlayerData = function(cb)
    if cb ~= nil then
        cb(QBCore.PlayerData)
    else
        return QBCore.PlayerData
    end
end

QBCore.Functions.DrawText = function(x, y, width, height, scale, r, g, b, a, text)
	SetTextFont(4)
    SetTextProportional(0)
    SetTextScale(scale, scale)
    SetTextColour(r, g, b, a)
    SetTextDropShadow(0, 0, 0, 0,255)
    SetTextEdge(2, 0, 0, 0, 255)
    SetTextDropShadow()
    SetTextOutline()
    SetTextEntry("STRING")
    AddTextComponentString(text)
    DrawText(x - width/2, y - height/2 + 0.005)
end

QBCore.Functions.DrawText3D = function(x, y, z, text)
	SetTextScale(0.35, 0.35)
    SetTextFont(4)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 215)
    SetTextEntry("STRING")
    SetTextCentre(true)
    AddTextComponentString(text)
    SetDrawOrigin(x,y,z, 0)
    DrawText(0.0, 0.0)
    local factor = (string.len(text)) / 370
    DrawRect(0.0, 0.0+0.0125, 0.017+ factor, 0.03, 0, 0, 0, 75)
    ClearDrawOrigin()
end

QBCore.Functions.GetCoords = function(entity)
    local coords = GetEntityCoords(entity, false)
    local heading = GetEntityHeading(entity)
    return {
        x = coords.x,
        y = coords.y,
        z = coords.z,
        a = heading
    }
end

QBCore.Functions.SpawnVehicle = function(model, cb, coords, isnetworked)
    local model = (type(model)=="number" and model or GetHashKey(model))
    local coords = coords ~= nil and coords or QBCore.Functions.GetCoords(GetPlayerPed(-1))
    local isnetworked = isnetworked ~= nil and isnetworked or true

    RequestModel(model)
    while not HasModelLoaded(model) do
        Citizen.Wait(10)
    end

    local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.a, isnetworked, false)
    local netid = NetworkGetNetworkIdFromEntity(veh)

	SetVehicleHasBeenOwnedByPlayer(vehicle,  true)
	SetNetworkIdCanMigrate(netid, true)
    SetVehicleNeedsToBeHotwired(veh, false)
    SetVehRadioStation(veh, "OFF")

	SetModelAsNoLongerNeeded(model)
	
	TriggerEvent("debug", 'QBCore: Spawn ' .. model .. ' (' .. (isnetworked and 'Networked' or 'Local') .. ')', 'normal')

    if cb ~= nil then
        cb(veh)
    end
end

QBCore.Functions.DeleteVehicle = function(vehicle)
	TriggerEvent("debug", 'QBCore: Delete Vehicle', 'error')
    SetEntityAsMissionEntity(vehicle, true, true)
    DeleteVehicle(vehicle)
end

QBCore.Functions.Notify = function(text, textype, length) -- [text] = message, [type] = primary | error | success, [length] = time till fadeout.
    local ttype = textype ~= nil and textype or "primary"
    local length = length ~= nil and length or 5000
    SendNUIMessage({
        action = "show",
        type = ttype,
        length = length,
        text = text,
    })
end

QBCore.Functions.TriggerCallback = function(name, cb, ...)
	QBCore.ServerCallbacks[name] = cb
	TriggerServerEvent("QBCore:Server:TriggerCallback", name, ...)
	TriggerEvent("debug", 'QBCore: Trigger Callback "' .. name .. '"', 'normal')
end

QBCore.Functions.EnumerateEntities = function(initFunc, moveFunc, disposeFunc)
	return coroutine.wrap(function()
		local iter, id = initFunc()
		if not id or id == 0 then
			disposeFunc(iter)
			return
		end

		local enum = {handle = iter, destructor = disposeFunc}
		setmetatable(enum, entityEnumerator)

		local next = true
		repeat
		coroutine.yield(id)
		next, id = moveFunc(iter)
		until not next

		enum.destructor, enum.handle = nil, nil
		disposeFunc(iter)
    end)
end

QBCore.Functions.GetVehicles = function()
    local vehicles = {}
	for vehicle in QBCore.Functions.EnumerateEntities(FindFirstVehicle, FindNextVehicle, EndFindVehicle) do
		table.insert(vehicles, vehicle)
	end
	return vehicles
end

QBCore.Functions.GetPeds = function(ignoreList)
    local ignoreList = ignoreList or {}
	local peds       = {}
	for ped in QBCore.Functions.EnumerateEntities(FindFirstPed, FindNextPed, EndFindPed) do
		local found = false

        for j=1, #ignoreList, 1 do
			if ignoreList[j] == ped then
				found = true
			end
		end

		if not found then
			table.insert(peds, ped)
		end
	end

	return peds
end

QBCore.Functions.GetPlayers = function()
    local players = {}
    for _, player in ipairs(GetActivePlayers()) do
        local ped = GetPlayerPed(player)
        if DoesEntityExist(ped) then
            table.insert(players, player)
        end
    end
    return players
end

QBCore.Functions.GetClosestVehicle = function(coords)
	
	local vehicles        = QBCore.Functions.GetVehicles()
	local closestDistance = -1
	local closestVehicle  = -1
	local coords          = coords

	if coords == nil then
		local playerPed = PlayerPedId()
		coords = GetEntityCoords(playerPed)
	end
	for i=1, #vehicles, 1 do
		local vehicleCoords = GetEntityCoords(vehicles[i])
		local distance      = GetDistanceBetweenCoords(vehicleCoords, coords.x, coords.y, coords.z, true)

		if closestDistance == -1 or closestDistance > distance then
			closestVehicle  = vehicles[i]
			closestDistance = distance
		end
	end

	TriggerEvent("debug", 'QBCore: Closest Vehicle Distance ' .. closestDistance, 'normal')

	return closestVehicle
end

QBCore.Functions.GetClosestPed = function(coords, ignoreList)
	local ignoreList      = ignoreList or {}
	local peds            = QBCore.Functions.GetPeds(ignoreList)
	local closestDistance = -1
    local closestPed      = -1
    
    if coords == nil then
        coords = GetEntityCoords(GetPlayerPed(-1))
    end

	for i=1, #peds, 1 do
		local pedCoords = GetEntityCoords(peds[i])
		local distance  = GetDistanceBetweenCoords(pedCoords, coords.x, coords.y, coords.z, true)

		if closestDistance == -1 or closestDistance > distance then
			closestPed      = peds[i]
			closestDistance = distance
		end
	end

	TriggerEvent("debug", 'QBCore: Closest Ped Distance ' .. closestDistance, 'normal')

	return closestPed, closestDistance
end


QBCore.Functions.GetClosestPlayer = function(coords)
	if coords == nil then
        coords = GetEntityCoords(GetPlayerPed(-1))
	end
	
	local closestPlayers = QBCore.Functions.GetPlayersFromCoords(coords)
    local closestDistance = -1
    local closestPlayer = -1

    for i=1, #closestPlayers, 1 do
        if closestPlayers[i] ~= PlayerId() and closestPlayers[i] ~= -1 then
            local pos = GetEntityCoords(GetPlayerPed(closestPlayers[i]))
            local distance = GetDistanceBetweenCoords(pos.x, pos.y, pos.z, coords.x, coords.y, coords.z, true)

            if closestDistance == -1 or closestDistance > distance then
                closestPlayer = closestPlayers[i]
                closestDistance = distance
            end
        end
	end

	TriggerEvent("debug", 'QBCore: Closest Player Distance ' .. closestDistance, 'normal')

	return closestPlayer, closestDistance
end

QBCore.Functions.GetPlayersFromCoords = function(coords, distance)
    local players = QBCore.Functions.GetPlayers()
    local closePlayers = {}

    if coords == nil then
		coords = GetEntityCoords(GetPlayerPed(-1))
    end
    if distance == nil then
        distance = 5.0
    end
    for _, player in pairs(players) do
		local target = GetPlayerPed(player)
		local targetCoords = GetEntityCoords(target)
		local targetdistance = GetDistanceBetweenCoords(targetCoords, coords.x, coords.y, coords.z, true)
		if targetdistance <= distance then
			table.insert(closePlayers, player)
		end
    end
    
    return closePlayers
end

QBCore.Functions.HasItem = function(source, cb, item)
	local retval = false
	QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
		if result then
			retval = true
		end
		return retval
	end, item)
	return retval
end

QBCore.Functions.Progressbar = function(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel)
    exports['progressbar']:Progress({
        name = name:lower(),
        duration = duration,
        label = label,
        useWhileDead = useWhileDead,
        canCancel = canCancel,
        controlDisables = disableControls,
        animation = animation,
        prop = prop,
        propTwo = propTwo,
    }, function(cancelled)
        if not cancelled then
            if onFinish ~= nil then
                onFinish()
            end
        else
            if onCancel ~= nil then
                onCancel()
            end
        end
    end)
end

QBCore.Functions.GetVehicleProperties = function(vehicle)
	local color1, color2               = GetVehicleColours(vehicle)
	local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
	
	return {

		model             = GetEntityModel(vehicle),

		plate             = GetVehicleNumberPlateText(vehicle),
		plateIndex        = GetVehicleNumberPlateTextIndex(vehicle),

		health            = GetEntityHealth(vehicle),
		dirtLevel         = GetVehicleDirtLevel(vehicle),

		color1            = color1,
		color2            = color2,

		pearlescentColor  = pearlescentColor,
		wheelColor        = wheelColor,

		wheels            = GetVehicleWheelType(vehicle),
		windowTint        = GetVehicleWindowTint(vehicle),

		neonEnabled       = {
			IsVehicleNeonLightEnabled(vehicle, 0),
			IsVehicleNeonLightEnabled(vehicle, 1),
			IsVehicleNeonLightEnabled(vehicle, 2),
			IsVehicleNeonLightEnabled(vehicle, 3)
		},

		extras            = {
			
		},

		neonColor         = table.pack(GetVehicleNeonLightsColour(vehicle)),
		tyreSmokeColor    = table.pack(GetVehicleTyreSmokeColor(vehicle)),

		modSpoilers       = GetVehicleMod(vehicle, 0),
		modFrontBumper    = GetVehicleMod(vehicle, 1),
		modRearBumper     = GetVehicleMod(vehicle, 2),
		modSideSkirt      = GetVehicleMod(vehicle, 3),
		modExhaust        = GetVehicleMod(vehicle, 4),
		modFrame          = GetVehicleMod(vehicle, 5),
		modGrille         = GetVehicleMod(vehicle, 6),
		modHood           = GetVehicleMod(vehicle, 7),
		modFender         = GetVehicleMod(vehicle, 8),
		modRightFender    = GetVehicleMod(vehicle, 9),
		modRoof           = GetVehicleMod(vehicle, 10),

		modEngine         = GetVehicleMod(vehicle, 11),
		modBrakes         = GetVehicleMod(vehicle, 12),
		modTransmission   = GetVehicleMod(vehicle, 13),
		modHorns          = GetVehicleMod(vehicle, 14),
		modSuspension     = GetVehicleMod(vehicle, 15),
		modArmor          = GetVehicleMod(vehicle, 16),

		modTurbo          = IsToggleModOn(vehicle, 18),
		modSmokeEnabled   = IsToggleModOn(vehicle, 20),
		modXenon          = IsToggleModOn(vehicle, 22),

		modFrontWheels    = GetVehicleMod(vehicle, 23),
		modBackWheels     = GetVehicleMod(vehicle, 24),

		modPlateHolder    = GetVehicleMod(vehicle, 25),
		modVanityPlate    = GetVehicleMod(vehicle, 26),
		modTrimA          = GetVehicleMod(vehicle, 27),
		modOrnaments      = GetVehicleMod(vehicle, 28),
		modDashboard      = GetVehicleMod(vehicle, 29),
		modDial           = GetVehicleMod(vehicle, 30),
		modDoorSpeaker    = GetVehicleMod(vehicle, 31),
		modSeats          = GetVehicleMod(vehicle, 32),
		modSteeringWheel  = GetVehicleMod(vehicle, 33),
		modShifterLeavers = GetVehicleMod(vehicle, 34),
		modAPlate         = GetVehicleMod(vehicle, 35),
		modSpeakers       = GetVehicleMod(vehicle, 36),
		modTrunk          = GetVehicleMod(vehicle, 37),
		modHydrolic       = GetVehicleMod(vehicle, 38),
		modEngineBlock    = GetVehicleMod(vehicle, 39),
		modAirFilter      = GetVehicleMod(vehicle, 40),
		modStruts         = GetVehicleMod(vehicle, 41),
		modArchCover      = GetVehicleMod(vehicle, 42),
		modAerials        = GetVehicleMod(vehicle, 43),
		modTrimB          = GetVehicleMod(vehicle, 44),
		modTank           = GetVehicleMod(vehicle, 45),
		modWindows        = GetVehicleMod(vehicle, 46),
		modLivery         = GetVehicleMod(vehicle, 48),
		modCustomTyres	  = GetVehicleModVariation(vehicle, 23)
	}
end

QBCore.Functions.SetVehicleProperties = function(vehicle, props)
	if not DoesEntityExist(vehicle) or not props or type(props) ~= 'table' then
		return false
	end

	SetVehicleModKit(vehicle, 0)

	if props.plate ~= nil then
		SetVehicleNumberPlateText(vehicle, props.plate)
	end

	if props.plateIndex ~= nil then
		SetVehicleNumberPlateTextIndex(vehicle, props.plateIndex)
	end

	if props.health ~= nil then
		SetEntityHealth(vehicle, props.health)
	end

	if props.dirtLevel ~= nil then
		SetVehicleDirtLevel(vehicle, props.dirtLevel)
	end

	if props.color1 ~= nil then
		local color1, color2 = GetVehicleColours(vehicle)
		SetVehicleColours(vehicle, props.color1, color2)
	end

	if props.color2 ~= nil then
		local color1, color2 = GetVehicleColours(vehicle)
		SetVehicleColours(vehicle, color1, props.color2)
	end

	if props.pearlescentColor ~= nil then
		local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
		SetVehicleExtraColours(vehicle, props.pearlescentColor, wheelColor)
	end

	if props.wheelColor ~= nil then
		local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
		SetVehicleExtraColours(vehicle, pearlescentColor, props.wheelColor)
	end

	if props.wheels ~= nil then
		SetVehicleWheelType(vehicle, props.wheels)
	end

	if props.windowTint ~= nil then
		SetVehicleWindowTint(vehicle, props.windowTint)
	end

	if props.neonEnabled ~= nil then
		SetVehicleNeonLightEnabled(vehicle, 0, props.neonEnabled[1])
		SetVehicleNeonLightEnabled(vehicle, 1, props.neonEnabled[2])
		SetVehicleNeonLightEnabled(vehicle, 2, props.neonEnabled[3])
		SetVehicleNeonLightEnabled(vehicle, 3, props.neonEnabled[4])
	end

	if props.neonColor ~= nil then
		SetVehicleNeonLightsColour(vehicle, props.neonColor[1], props.neonColor[2], props.neonColor[3])
	end

	if props.modSmokeEnabled ~= nil then
		ToggleVehicleMod(vehicle, 20, true)
	end

	if props.tyreSmokeColor ~= nil then
		SetVehicleTyreSmokeColor(vehicle, props.tyreSmokeColor[1], props.tyreSmokeColor[2], props.tyreSmokeColor[3])
	end

	if props.modSpoilers ~= nil then
		SetVehicleMod(vehicle, 0, props.modSpoilers, false)
	end

	if props.modFrontBumper ~= nil then
		SetVehicleMod(vehicle, 1, props.modFrontBumper, false)
	end

	if props.modRearBumper ~= nil then
		SetVehicleMod(vehicle, 2, props.modRearBumper, false)
	end

	if props.modSideSkirt ~= nil then
		SetVehicleMod(vehicle, 3, props.modSideSkirt, false)
	end

	if props.modExhaust ~= nil then
		SetVehicleMod(vehicle, 4, props.modExhaust, false)
	end

	if props.modFrame ~= nil then
		SetVehicleMod(vehicle, 5, props.modFrame, false)
	end

	if props.modGrille ~= nil then
		SetVehicleMod(vehicle, 6, props.modGrille, false)
	end

	if props.modHood ~= nil then
		SetVehicleMod(vehicle, 7, props.modHood, false)
	end

	if props.modFender ~= nil then
		SetVehicleMod(vehicle, 8, props.modFender, false)
	end

	if props.modRightFender ~= nil then
		SetVehicleMod(vehicle, 9, props.modRightFender, false)
	end

	if props.modRoof ~= nil then
		SetVehicleMod(vehicle, 10, props.modRoof, false)
	end

	if props.modEngine ~= nil then
		SetVehicleMod(vehicle, 11, props.modEngine, false)
	end

	if props.modBrakes ~= nil then
		SetVehicleMod(vehicle, 12, props.modBrakes, false)
	end

	if props.modTransmission ~= nil then
		SetVehicleMod(vehicle, 13, props.modTransmission, false)
	end

	if props.modHorns ~= nil then
		SetVehicleMod(vehicle, 14, props.modHorns, false)
	end

	if props.modSuspension ~= nil then
		SetVehicleMod(vehicle, 15, props.modSuspension, false)
	end

	if props.modArmor ~= nil then
		SetVehicleMod(vehicle, 16, props.modArmor, false)
	end

	if props.modTurbo ~= nil then
		ToggleVehicleMod(vehicle,  18, props.modTurbo)
	end

	if props.modXenon ~= nil then
		ToggleVehicleMod(vehicle,  22, props.modXenon)
	end

	if props.modFrontWheels ~= nil then
		SetVehicleMod(vehicle, 23, props.modFrontWheels, false)
	end

	if props.modBackWheels ~= nil then
		SetVehicleMod(vehicle, 24, props.modBackWheels, false)
	end

	if props.modPlateHolder ~= nil then
		SetVehicleMod(vehicle, 25, props.modPlateHolder, false)
	end

	if props.modVanityPlate ~= nil then
		SetVehicleMod(vehicle, 26, props.modVanityPlate, false)
	end

	if props.modTrimA ~= nil then
		SetVehicleMod(vehicle, 27, props.modTrimA, false)
	end

	if props.modOrnaments ~= nil then
		SetVehicleMod(vehicle, 28, props.modOrnaments, false)
	end

	if props.modDashboard ~= nil then
		SetVehicleMod(vehicle, 29, props.modDashboard, false)
	end

	if props.modDial ~= nil then
		SetVehicleMod(vehicle, 30, props.modDial, false)
	end

	if props.modDoorSpeaker ~= nil then
		SetVehicleMod(vehicle, 31, props.modDoorSpeaker, false)
	end

	if props.modSeats ~= nil then
		SetVehicleMod(vehicle, 32, props.modSeats, false)
	end

	if props.modSteeringWheel ~= nil then
		SetVehicleMod(vehicle, 33, props.modSteeringWheel, false)
	end

	if props.modShifterLeavers ~= nil then
		SetVehicleMod(vehicle, 34, props.modShifterLeavers, false)
	end

	if props.modAPlate ~= nil then
		SetVehicleMod(vehicle, 35, props.modAPlate, false)
	end

	if props.modSpeakers ~= nil then
		SetVehicleMod(vehicle, 36, props.modSpeakers, false)
	end

	if props.modTrunk ~= nil then
		SetVehicleMod(vehicle, 37, props.modTrunk, false)
	end

	if props.modHydrolic ~= nil then
		SetVehicleMod(vehicle, 38, props.modHydrolic, false)
	end

	if props.modEngineBlock ~= nil then
		SetVehicleMod(vehicle, 39, props.modEngineBlock, false)
	end

	if props.modAirFilter ~= nil then
		SetVehicleMod(vehicle, 40, props.modAirFilter, false)
	end

	if props.modStruts ~= nil then
		SetVehicleMod(vehicle, 41, props.modStruts, false)
	end

	if props.modArchCover ~= nil then
		SetVehicleMod(vehicle, 42, props.modArchCover, false)
	end

	if props.modAerials ~= nil then
		SetVehicleMod(vehicle, 43, props.modAerials, false)
	end

	if props.modTrimB ~= nil then
		SetVehicleMod(vehicle, 44, props.modTrimB, false)
	end

	if props.modTank ~= nil then
		SetVehicleMod(vehicle, 45, props.modTank, false)
	end

	if props.modWindows ~= nil then
		SetVehicleMod(vehicle, 46, props.modWindows, false)
	end

	if props.modCustomTyres ~= nil and props.modCustomTyres then 
		SetVehicleMod(vehicle, 23, props.modCustomTyres, true)
	end

	if props.modLivery ~= nil then
		SetVehicleMod(vehicle, 48, props.modLivery, false)
	end

	return true
end```

Decor mode

When in decorate mode after you buy an item, it freezes you in the menu. Also when you place an item on the wall no matter the height it defaults to the ceiling.

Stuck on a loading screen after character creation!

Hi, I have a problem where my server gets stuck on a loading screen that, turns and turns when you press "Create Character" in the starting menu. I have restarted my server and my FiveM, but nothing has fixed it.

You can either respond here or you can message my discord: Ocean# 0130.
Thanks.

64109f99827c1a9d80ba9771949537c4.mp4

Framedrop issues

After installing the standard QB server, with a clean install, I notice that every couple of seconds, my frames cut to 40 for 1 singular frame, and my game rubber bands. I know this must be an issue with QB since my esx server (running off the SAME box) does not suffer from the same issue, while being updated to the same server artifacts. Not sure what is causing this, but my frames are higher, however more inconsistent.

add gang grade

	self.Functions.SetGang = function(gang)
		local gang = gang:lower()
		if QBCore.Shared.Gangs[gang] ~= nil then
			self.PlayerData.gang.name = gang
			self.PlayerData.gang.label = QBCore.Shared.Gangs[gang].label
			self.Functions.UpdatePlayerData()
			TriggerClientEvent("QBCore:Client:OnGangUpdate", self.PlayerData.source, self.PlayerData.gang)
		end
	end
["ballas"] = {
	label = "ballas gang",
	bossmenu = vector3(-124.786, -641.486, 167.820),
	grades = {
        ['0'] = {
            name = "member",
            payment = 50
        },
['1'] = {
            name = "leader",
	isboss = true,
            payment = 150
        },
    },

weapon_bread weapon not working

["weapon_bread"] 				 = {["name"] = "weapon_bread", 				 	["label"] = "Baquette", 				["weight"] = 1000, 		["type"] = "weapon", 	["ammotype"] = nil,						["image"] = "baquette.png", 			["unique"] = true, 		["useable"] = false, 	["description"] = "Bread..?"},

https://ibb.co/7tHTx1n

PDM

Cant add add-on vehicles into pdm console starts to spit errors at me

not work this function QBCore:HasItem at array in last update

RegisterNetEvent("craft:lockpick")
AddEventHandler("craft:lockpick", function()
QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
if result then
TriggerServerEvent('QBCore:Server:AddItem', 'lockpick', 2)
TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items["lockpick"], "add")
end
end, {'steel', 'plastic', 'metalscrap', 'iron'})
end)

I'm to stupid to set myself admin

So I tried to become admin permissions on my own server and tried the following steps:

  1. Opened phpMyAdmin
  2. Went to 'permissions' table
  3. Clicked on "Insert"
  4. Filled out 'name' with the name in the 'players' table
  5. Filled out 'license' with the license in the 'players' table
  6. Wrote 'god' into 'permission'

I also tried to use 'admin' instead of 'god', neither of them worked

fix logout salary

		Citizen.Wait(7)
		if NetworkIsSessionStarted() then
			Citizen.Wait(10)
			TriggerServerEvent('QBCore:PlayerJoined')
			return
		end
	end
end)

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(1)
		if isLoggedIn then
			Citizen.Wait((1000 * 60) * 30)
			TriggerServerEvent("QBCore:ReceivedSalary")
		else
			Citizen.Wait(5000)
		end
	end
end)

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(7)
		if isLoggedIn then
			Citizen.Wait((1000 * 60) * 10)
			TriggerEvent("QBCore:Player:UpdatePlayerData")
			TriggerEvent("debug", 'QBCore: Update Player Data!', 'normal')
		else
			Citizen.Wait(5000)
		end
	end
end)

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(7)
		if isLoggedIn then
			Citizen.Wait(30000)
			TriggerEvent("QBCore:Player:UpdatePlayerPosition")
			TriggerEvent("debug", 'QBCore: Update Player Position!', 'normal')
		else
			Citizen.Wait(5000)
		end
	end
end)

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(math.random(3000, 5000))
		if isLoggedIn then
			if QBCore.Functions.GetPlayerData().metadata["hunger"] <= 0 or QBCore.Functions.GetPlayerData().metadata["thirst"] <= 0 then
				local ped = GetPlayerPed(-1)
				local currentHealth = GetEntityHealth(ped)

				SetEntityHealth(ped, currentHealth - math.random(5, 10))
			end
		end
	end
end)```

this is normal warining ?

[ script:ghmattimysql] [MariaDB:10.4.20-MariaDB] [WARNING] [qb-banking] [517ms] SELECT * FROM bank_accounts WHERE account_type=? : ["Business"]
[ script:ghmattimysql] [MariaDB:10.4.20-MariaDB] [WARNING] [qb-core] [517ms] SELECT * FROM permissions : []
[ script:ghmattimysql] [MariaDB:10.4.20-MariaDB] [WARNING] [qb-houses] [515ms] SELECT * FROM houselocations : []
[ script:ghmattimysql] [MariaDB:10.4.20-MariaDB] [WARNING] [qb-spawn] [516ms] SELECT * FROM houselocations : []
[ script:ghmattimysql] [MariaDB:10.4.20-MariaDB] [WARNING] [qb-lapraces] [514ms] SELECT * FROM lapraces : []
[ script:ghmattimysql] [MariaDB:10.4.20-MariaDB] [WARNING] [qb-houses] [516ms] SELECT * FROM player_houses : []

[SUGGESTION] Add some unclonable characteristic on an ID

Right now, it is possible for someone to steal an ID of another user. There is nothing preventing this user from using that ID in a traffic stop to frame another user. In real life, IDs have pictures which helps this. As of now, players could be using other player's ids and there's no way for police to verify it at all.

Maybe add the civ's fingerprint-ID to the license?

walk style

I love your project, that's why I offer suggestions
But you have deleted the following from the main version
It was there, but it wasn't working
It memorizes the way of walking
Even when off the server
It returns to the same way of walking

PlayerData.metadata["walk"] = PlayerData.metadata["walk"] ~= nil and PlayerData.metadata["walk"] or "reset"

not an issue for core (discord)

It seems that I have been banned or kicked or something of that sort. I have tried to go back into the server, I get in for one second then kicked immediately. Help

add new weapon in shared

	["weapon_smg_mk2"] 				 = {["name"] = "weapon_smg_mk2", 			 	["label"] = "PD MP5 2", 				["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_SMG",				["image"] = "smg.png", 					["unique"] = true, 		["useable"] = true, 	["combinable"] = nil, ["description"] = "SMG MK2"},
	["weapon_assaultrifle_mk2"] 	 = {["name"] = "weapon_assaultrifle_mk2", 	 	["label"] = "AK-47 MK2", 				["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_RIFLE",			["image"] = "assaultriflemk2.png", 		["unique"] = true, 		["useable"] = true, 	["combinable"] = nil, ["description"] = "Assault Rifle MK2"},
	["weapon_carbinerifle_mk2"] 	 = {["name"] = "weapon_carbinerifle_mk2", 	 	["label"] = "PD 762", 					["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_RIFLE",			["image"] = "carbineriflemk2.png", 		["unique"] = true, 		["useable"] = true, 	["combinable"] = nil, ["description"] = "Carbine Rifle MK2"},
	["weapon_revolver_mk2"] 		 = {["name"] = "weapon_revolver_mk2", 		 	["label"] = "Violence", 				["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_PISTOL",			["image"] = "revolvermk2.png", 			["unique"] = true, 		["useable"] = true, 	["combinable"] = nil, ["description"] = "da Violence"},
	["weapon_doubleaction"] 	     = {["name"] = "weapon_doubleaction", 		 	["label"] = "Double Action Revolver", 	["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_PISTOL",			["image"] = "doubleaction.png", 		["unique"] = true, 		["useable"] = true, 	["combinable"] = nil, ["description"] = "Double Action Revolver"},




	[`weapon_smg_mk2`] 				 = {["name"] = "weapon_smg_mk2", 			 	["label"] = "PD MP5 2", 				["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_SMG",				["image"] = "placeholder.png", 		["unique"] = true, 		["useable"] = true, 	["description"] = "This is a placeholder description"},
	[`weapon_assaultrifle_mk2`] 	 = {["name"] = "weapon_assaultrifle_mk2", 	 	["label"] = "AK-47 MK2", 				["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_RIFLE",			["image"] = "placeholder.png", 		["unique"] = true, 		["useable"] = true, 	["description"] = "This is a placeholder description"},
	[`weapon_carbinerifle_mk2`] 	 = {["name"] = "weapon_carbinerifle_mk2", 	 	["label"] = "PD 762", 					["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_RIFLE",			["image"] = "placeholder.png", 		["unique"] = true, 		["useable"] = true, 	["description"] = "This is a placeholder description"},
	[`weapon_revolver_mk2`] 		 = {["name"] = "weapon_revolver_mk2", 		 	["label"] = "Violence", 				["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_PISTOL",			["image"] = "placeholder.png", 		["unique"] = true, 		["useable"] = true, 	["description"] = "This is a placeholder description"},
	[`weapon_doubleaction`] 		 = {["name"] = "weapon_doubleaction", 			["label"] = "Double Action Revolver", 	["weight"] = 11000, 	["type"] = "weapon", 	["ammotype"] = "AMMO_PISTOL",			["image"] = "placeholder.png", 		["unique"] = true, 		["useable"] = true, 	["description"] = "This is a placeholder description"},

Discord Report

Neons do not save (check vehicle getter and setter functions) maybe new natives or wrong data?

Ground Inventory

Hello! I just installed the QB Framework through TXAdmin. The Issue I am having is when someone places something on the ground from their inventory it removes the item from the inventory, but it is no where on the ground to be picked up.

qbcore drugs in metadata

in qbcore We have a lot of code on drugs
qb-weed
qb-drugs
We should think big about the addiction system
We must have new metadata for drug and addiction
PlayerData.metadata["addiction"] = PlayerData.metadata["addiction"] ~= nil and PlayerData.metadata["addiction"] or 0
I hope this gets interesting
Example when eating cannabis gets into a value within this
thank you

Possible dupe method

Hi!,

I found on a server a dupe method that is really to do
you just move item to a stash and exit right away.

From what I saw its because the database not updating when a item removes from a player inventory
I hope you will fix it soon because QBCore is a really good framework for RolePlay.

What I did to fix this is call QBCore.Player.UpdateInventory() every time item removes/adds to the player
I don't think what I did is a good idea but its pretty easy to fix like this

I hope you will fix this soon 😄

some ques

How to set yourself up as an admin,I can't wokr with it
I already set this:
image

Cant Get Pass Checking Ban status

Hi There i am new to developing with this framework. But when ever I try load into the server it checks everything but when gets tho the part where it says "Chaecking If you are banned." It loads for about 30 seconds then I get the error
[ script:qb-core] > handler (@qb-core/server/events.lua:40)
[ script:connectqueue] QUEUE: WhirlyBird[steam:1100001176dfd9b] was placed 1/1 in queue
[ script:ghmattimysql] [MySQL] [ERROR] [qb-core] An error happens for query "SELECT * FROM bans WHERE license=? : ["license:97470cc628a2266cf5a681899fead086094fbd94"]": connect ECONNREFUSED 127.0.0.1:3306
[ script:qb-core] SCRIPT ERROR: @qb-core/server/functions.lua:227: attempt to index a nil value (local 'result')
[ script:qb-core] > handler (@qb-core/server/events.lua:40)

please help I really want to make a qbus fivem server.

can add array job

QBCore.Functions.TriggerCallback('', function(result)
if result then
end
end, {'police', 'taxi', 'ambulance'})

Can these features be added to core ?

QBCore.Functions.TriggerCallback('', function(result)
if result then
end
end, {'police', 'admin'})

edit this

["printerdocument"] 			 = {["name"] = "printerdocument", 				["label"] = "Document", 				["weight"] = 500, 		["type"] = "item", 		["image"] = "printerdocument.png", 		["unique"] = true, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,   ["description"] = "A nice document"},

ATTENTION: To have this working correctly you MUST change shared.lua as follows: Search for "printerdocument" and make ["unique"] = true otherwise documents WILL STACK and You'll be able to see only latest.

complete jobrep system for all job in project

These job are not found in the players.lua
["tow"] = 0,
["trucker"] = 0,
["taxi"] = 0,
["hotdog"] = 0,
We want all jobs to have a special point system
Can we think of a system that guarantees all players points?

qb-policejob
qb-ambulancejob
qb-mechanicjob
and other job

Doors Suggestion

In the future, could we get a system like nui_doorlock where you can create a new door on the fly? as opposed to the long and tedious config editing.

add support SpawnObject


QBCore.Functions.SpawnObject = function(model, coords, cb)
    local model = (type(model) == 'number' and model or GetHashKey(model))

    Citizen.CreateThread(function()
        RequestModel(model)
        local obj = CreateObject(model, coords.x, coords.y, coords.z, true, false, true)
        SetModelAsNoLongerNeeded(model)

        if cb then
            cb(obj)
        end
    end)
end

QBCore.Functions.SpawnLocalObject = function(model, coords, cb)
    local model = (type(model) == 'number' and model or GetHashKey(model))

    Citizen.CreateThread(function()
        RequestModel(model)
        local obj = CreateObject(model, coords.x, coords.y, coords.z, false, false, true)
        SetModelAsNoLongerNeeded(model)

        if cb then
            cb(obj)
        end
    end)
end

QBCore.Functions.DeleteObject = function(object)
    SetEntityAsMissionEntity(object, false, true)
    DeleteObject(object)
end```

add save walk to player

Through metadata there is special evidence of memorizing the way of [walk]
But in case of exit from the server
and back to him
It does not store the way you walk
The text is not complete in the original version
I hope to finish here
Example
If you choose the Franklin walk,
I want it to be saved for the character
Even if the player exits the server

Spawn

After Multicharacter the spawn block
blackscreen

⚠️⚠️ URGENT ⚠️⚠️ Server Hang!

qb-core/server/player.lua

Lines 600 to 607 in e065d29

while not UniqueFound do
CitizenId = tostring(QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(5)):upper()
QBCore.Functions.ExecuteSql(true, "SELECT COUNT(*) as count FROM `players` WHERE `citizenid` = '"..CitizenId.."'", function(result)
if result[1].count == 0 then
UniqueFound = true
end
end)
end

qb-core/server/player.lua

Lines 614 to 621 in e065d29

while not UniqueFound do
FingerId = tostring(QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(1) .. QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(4))
QBCore.Functions.ExecuteSql(true, "SELECT COUNT(*) as count FROM `players` WHERE `metadata` LIKE '%"..FingerId.."%'", function(result)
if result[1].count == 0 then
UniqueFound = true
end
end)
end

qb-core/server/player.lua

Lines 628 to 635 in e065d29

while not UniqueFound do
WalletId = "QB-"..math.random(11111111, 99999999)
QBCore.Functions.ExecuteSql(true, "SELECT COUNT(*) as count FROM `players` WHERE `metadata` LIKE '%"..WalletId.."%'", function(result)
if result[1].count == 0 then
UniqueFound = true
end
end)
end

qb-core/server/player.lua

Lines 643 to 650 in e065d29

while not UniqueFound do
SerialNumber = math.random(11111111, 99999999)
QBCore.Functions.ExecuteSql(true, "SELECT COUNT(*) as count FROM players WHERE metadata LIKE '%"..SerialNumber.."%'", function(result)
if result[1].count == 0 then
UniqueFound = true
end
end)
end

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.