Giter VIP home page Giter VIP logo

dc-open-houses's Introduction

This still needs testing.

dc-open-houses

An housing system to support open interior houses as owned housing for players. This is not a job related resource. This is operated by staff since 9/10 these kind of houses are sold by staff anyways. It is expected that you have the latest version of qb-doorlock.

THIS DOESN'T WORK WITH HOUSES THAT DON'T HAVE OPEN DOORS TO ENTER BUT NEED TELEPORTATION!!!

Might be supported in the future

You can always find support here in our Discord.

Donations are greatly appreciated

ko-fi

If you ever see the higlighted folder down below, don't delete it. It isn't your server cache. It's where your houses are stored.

image

1. Creating the house

Go stand in the middle of the house. This position will also be used as spawn location inside of qb-spawn if you follow How to add owned houses as spawn locations? down below. Now use the command createopenhouse along with the name of the house The name has to be unique and the server ID or CitizenID of the owner The owner has to be online.

2. Setting up the doors

Go stand in the middle of the door so that the door will be pushed half open. Now use the command adddoor along side with an unique name Copy the name, you will need it later.. Now use the newdoor command to create a new door inside of qb-doorlock. The configuration of the door should look like the following screenshot. Important points being: HouseName should be the name of the house you are in now. Makes it easier to find the doors back inside of qb-doorlock. Copied DoorName being HouseName-DoorName. DoorName being the same name you used when doing the adddoor command.

[x] Locked [x] Can't Unlock [x] Hide Door Label

image

3. Setting up interactions

Now either you or the owner can use the commands addstash, addoutfit, addlogout, addgarageopen, givehousekeys or removehousekeys

How to add owned houses as spawn locations?

Your qb-spawn resource should have the following lines on the client side.

            Wait(500)
            SendNUIMessage({
                action = "setupLocations",
                locations = QB.Spawns,
                houses = myHouses,
            })

Replace those with the following.

            local OldConfig = QB.Spawns
            for i = 1, #OpenHouses do
                if OpenHouses[i].owner == cData.citizenid then
                    if QB.Spawns[OpenHouses[i].house] then return end
                    QB.Spawns[OpenHouses[i].house] = {
                        coords = OpenHouses[i].spawn,
                        location = OpenHouses[i].house,
                        label = OpenHouses[i].house,
                    }
                end
            end
            local NewConfig = QB.Spawns
            QB.Spawns = OldConfig
            Wait(500)
            SendNUIMessage({
                action = "setupLocations",
                locations = NewConfig,
                houses = myHouses,
            })

And now add the following lines anywhere in the same file

RegisterNetEvent('dc-open-houses:client:sync', function(OpenHousesConfig)
    OpenHouses = OpenHousesConfig
end)

Known Bugs

If you logout with a character that owns a house without disconnecting, and you then want to log back in with another character. The house will still be listed in the spawn list. Since only the owner of the house will see this I don't expect any abuse unless the owner wants to lock himself inside of an house he doesn't have keys for.

dc-open-houses's People

Contributors

chatdisabled avatar drazoxxd avatar theilleniumstudios 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.