QBCore

This page will contain information about QBCore Framework.

A lot of you who are using the QBCore Framework will of noticed a default ped appear three times in different places after the loading screen has

finished and just before the multicharacter screen starts up. 

I had a look at the cfx-default scripts and found out it was the basic-gamemode files causing the default ped to appear.

The default peds are used when you have no framework like ESX or QBCORE so you have a ped that automatically spawns in random locations around the map.

If you are using a multicharacter script like qb-multicharacter you do not require basic-gamemode because qb-multicharacter uses a script called qb-spawn after you have created a character.
Once your character is created the information is saved to a SQL database so you can use the same information without having to redo a character. It also saves your last location from when you exited the server.

For this reason, you do not require basic-gamemode or any of the random spawn locations.

There will be a default loading screen with information about what is loading to help developers.

Once the loading screen is finished a default ped is spawned. Basic-gamemode folder is used and is located in a folder called [gamemodes]. 

Inside the basic-gamemode the is a file called basic_client.lua and if you look at line 2 you will notice the code that looks like this exports.spawnmanager:setAutoSpawn(true).

That is an instruction or command to spawn peds just after the loading screen has finished. If you look at your console you might notice at the bottom a folder called fivem-map-hipster is being used.
That file is located [gamemodes]\[maps] and there are two other folders in there as well that are not used one is called fivem-map-skater and the other is redm-map-one that is used the redm multiplayer

If you open the fivem-map-hipster folder you will find a file called map.lua and ig you open that with your editor you will see lines of code that look like this spawnpoint ‘a_m_y_hipster_01’ { x = -802.311, y = 175.056, z = 72.8446 }.

Those are the default spawn locations for your character when you not using a framework.

The basic basic-gamemode folder is not required if you have a framework like esx or qbcore or any other framework you might be using.

If you look in the folder of your loading screen and open fxmanifest.lua you will see a line of code that instructs a manual shutdown of the loading screen and because of that without the  basic-gamemode you

will find the loading screen hangs at the end because it’s waiting for basic-gamemode that is no longer running.

the loadscreen_auto_shutdown ‘yes’ set to Auto will instruct the loading screen to shut down automatically and proceed to the multicharacter and spawn after that to spawn your character on to the map.

To fix the problem of the default peds appearing there are three steps you must do and follow below.

This will be the same for all loading screens and should have the line of code if it does not then add loadscreen_auto_shutdown ‘yes’ and it will fix the problem.

Here is what to do step by step.

Step 1: Go to your server.cfg and comment out basic-gamemode so it looks like this #ensure basic-gamemode or just remove it.
Step 2: Go to where the last item marked ensure in your server.cfg and add stop basic-gamemode to make sure it stops or you can just remove ensure basic-gamemode .
Step 3: Go to or find your loading screen folder or script and open up the fxmanifest.lua or __resource.lua file with your editor and find
loadscreen_manual_shutdown ‘yes’ and change manual to auto so it looks like this loadscreen_auto_shutdown ‘yes’ and that is all you need to do.
Do not forget to restart your server after you have completed all three steps above.