Code Monkey home page Code Monkey logo

Comments (4)

Nophobia09 avatar Nophobia09 commented on August 31, 2024

Describe the bug Happens when clean install qb then used skip spawn true. I can register and spawn, but after relogin the account it goes black screen. But if i set SkipSelection = false, it spawn me as usual with the spawn menu. Update : it's when i turn off apartment when starting it happens.

There was no error at all from console neither the server.

Questions (please complete the following information):

  • When you last updated: Today
  • Are you using custom resource : None, fresh install
  • Have you renamed qb- to something custom? = Defineatly no.
    @ezyhabz

I have located the issue. The problem is there is only one spawn last location 'qb-multicharacter:client:spawnLastLocation' which does not take into account if you do not own a property, I modified the function so that if it returns without a result from the callback (Which there shouldnt be if you turn off automatically spawning to an apartment), the player is loaded at their last location. Here is a modified version of that function in qb-multicharacter Client Line 139

RegisterNetEvent('qb-multicharacter:client:spawnLastLocation', function(coords, cData)
    QBCore.Functions.TriggerCallback('apartments:GetOwnedApartment', function(result)
        if result then
            TriggerEvent("apartments:client:SetHomeBlip", result.type)
        end

        local ped = PlayerPedId()
        SetEntityCoords(ped, coords.x, coords.y, coords.z)
        SetEntityHeading(ped, coords.w)
        FreezeEntityPosition(ped, false)
        SetEntityVisible(ped, true)
        local PlayerData = QBCore.Functions.GetPlayerData()
        local insideMeta = PlayerData.metadata["inside"]
        DoScreenFadeOut(500)

        if insideMeta.house then
            TriggerEvent('qb-houses:client:LastLocationHouse', insideMeta.house)
        elseif insideMeta.apartment.apartmentType and insideMeta.apartment.apartmentId then
            TriggerEvent('qb-apartments:client:LastLocationHouse', insideMeta.apartment.apartmentType, insideMeta.apartment.apartmentId)
        end
        
        TriggerServerEvent('QBCore:Server:OnPlayerLoaded')
        TriggerEvent('QBCore:Client:OnPlayerLoaded')
        Wait(2000)
        DoScreenFadeIn(250)
    end, cData.citizenid)  
end)

Let me know if this resolves your issues!

from qb-multicharacter.

github-actions avatar github-actions commented on August 31, 2024

This issue has had 60 days of inactivity & will close within 7 days

from qb-multicharacter.

djthemask avatar djthemask commented on August 31, 2024

I also am having issues with this.

When i add SkipSelection to my config and set it to True ( I don't have it by default ). It indeed does skip the spawn menu but it also skips character selection and spawns at the character initial configuration location without being able to move instead of spawning at the last location which is what we would like to achieve. So basically we want the multi character to have the same functionality but just skip the spawn menu. We already removed all the aditional spawn options that where configured and now when we join we get the menu with only one option which is last location. It would be great if someone could tell me how we could go about skipping this menu and load the last spawn location by default.

EDIT: Nevermind, i was using an outdated version. If you have the same issue as described above make sure to download the latest version.

Thanks in advance

from qb-multicharacter.

github-actions avatar github-actions commented on August 31, 2024

This issue has had 60 days of inactivity & will close within 7 days

from qb-multicharacter.

Related Issues (20)

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.