[Standalone] [Paid] Sit Anywhere

A small update!
I’ve gone ahead and added/fixed some stuff (See the list below). The most notable addition is the gabz team UwU Cat Cafe (thanks to @Neiltary for mentioning it). I’ll add some more preset locations over the next couple of days/weeks. I hope you all enjoy this!

Changelog:

  • Small improvements for preset chairs at gabz pillbox
  • Fixed sitting checks not working when using an animation that did not have a specified offset
  • Added options to use circle zones instead of box zones when adding preset locations
  • Refactored dev/debugging code
  • Added Gabz UwU Cafe
2 Likes

thx for update :heart_eyes_cat:

Looks nice!

2 Likes

All good! Thanks for the suggestion! :grin:

1 Like

Can you make a quide for people to add more chairs

1 Like

Sure!

So adding chairs is pretty easy once you get the hang of it, I would advise you to take a chair that is similar to what you’re trying to add from the list.lua file, and just modify that until it fits. However, here is a “guide” for those who want to know the specifics.

The first thing to figure out is if the chair (or whatever) you are trying to add is dynamic or not. You can figure this out by using an object spooner or some other sort of dev tool (such as this one made by Koil: koil-public/fivem-koil-debug at master · itsKoil/koil-public · GitHub). If they are dynamic, then follow the Models guide, otherwise, just follow the Poly guide.

Models

[hash] = { 
    sit = { 
        type = 'chair', 
        seats = { 
            [1] = vector4(xOffset, yOffset, zOffset, headingOffset)
        } 
    } 
}, -- prop_name
  • hash : The hash is what identifies the model, you could in theory replace it with GetHashKey(prop_name) to get the same effect. However, there is no need to get the hash key every time the recourse starts up, so the faster thing is to have it pre-‘calculated’.

  • sit = {} : Inside of this table is where the sit code would be, for laying down we use lay = {}

  • type : This is the type of chair, it decides what scenarios/animations that we use, whether or not we teleport the player in or out etc. Most of the options set through the type can be overwritten on a model-to-model basis.
    You can find the full list of types in the config file.

  • option : Inside of the sit = {} table we can set model-specific options, some of them include:

    • teleportIn = boolean
    • teleportOut = boolean
    • skipSeeCheck = boolean
  • seats = {} : Inside this table, we list the possible seats, these are indexed and need to be a vector4. (You can have an unlimited amount of ‘slots’)

  • prop_name This is just a comment, has no functionality other than showing the name of the prop since we use the hash.

Example:

[-826852533] = { sit = { type = 'chair2', teleportIn = true, seats = {[1] = vector4(0.0, 0.1, 0.85, 180.0)} } }, -- prop_umpire_01

For more examples just look in the list.lua file, you’ll see plenty of examples. The best way is just to try it out in-game and adjust the numbers and restart the resource until you have something that works.

Polys
So polys are a little different but largely the same. Polys are always a part of a group, this is to reduce the number of calculations, if you are creating a new group just copy an existing one and take it from there, it should be self-explanatory what to do.

['name_of_chair'] = { 
    sit = { 
        type = 'chair2', 
        seats = {
            [1] = vector4(xCoords, yCoords, zCoords, heading)
        } 
    }, 
    poly = { 
        center = vector3(xCoords, yCoords, zCoords), 
        length = 1.25, 
        width = 0.75, 
        height = 1.0 
    } 
},
  • `‘name_of_chair’``: This is the name of the polys, it needs to be unique to its group.

  • sit = {} : The same as models.

  • option : This is the same as models, see above for info.

  • seats = {} : This is mostly the same as the model, however instead of offset we use the coords and heading.

  • poly = {} : This is what’s really different from the models. Now, even if you don’t use a 3rd eye solution and just the command you still need this to make it work.

  • center : The center of the poly, this is the most important one, it is usually the same as the seat for most 1 seat polys.

  • length : the length of the poly.

  • width : The width of the poly.

  • height : The height of the poly, this can be replaced by maxZ and minZ, but those will be absolute coords.

Example:

['pillbox_ward_c_34'] = { 
    sit = { type = 'chair3', seats = {[1] = vector4(360.72, -583.13, 42.8, 340.0)} }, 
    poly = { length = 1.0, width = 1.0, height = 1.0 } 
},

When adding polys I would advise you to set Config.Debugmode to true, and Config.DebugPoly to true IF you have your PolyZone script set to only render polys nearby.

Lay
Adding places to lay down on follows the same pattern as sitting, just remember to use lay = {} instead of sit = {}.

I hope this helps you out, if you have any questions feel free to post them!

2 Likes

Maybe a Video, do you have a support chanel or di s c o r d that i can speak to you about this futher ?

1 Like

Creating a video takes a significant amount of time, something I don’t have as of right now.

And due to my time constraints, I sadly don’t have time to help you over a voice call. You’re more than welcome to post a comment here on what you specifically need help with, and I’ll answer as soon as I got time to. I don’t say this to be mean, I just honestly don’t have more time than I need right now.

Thanks for your understanding! :slightly_smiling_face:

Im getting klapperende eierstokken from this one.

If anyone is using the big ol’ Zonah map…
You’re welcome!


    -- Zonah
    ['mtzonah'] = {
		enabled = true,
		center = vector3(-437.22, -334.04, 54.91),
		radius = 100.0,
		polys = {
            -- Waiting Room Chairs, each row is a different row of 5 seats
            ['benchzonah1'] = { 
                sit = { type = 'chair2', seats = {
                [1] = vector4(-438.50, -331.35, 34.41, 0.0), [2] = vector4(-437.87, -331.61, 34.41, 0.0), [3] = vector4(-437.06, -331.67, 34.41, 0.0), [4] = vector4(-436.42, -331.70, 34.41, 0.0), [5] = vector4(-435.64, -331.87, 34.41, 0.0), 
                [6] = vector4(-438.69, -332.23, 34.41, 180.0), [7] = vector4(-438.07, -332.26, 34.41, 180.0), [8] = vector4(-437.31, -332.40, 34.41, 180.0), [9] = vector4(-436.57, -332.52, 34.41, 180.0), [10] = vector4(-435.81, -332.62, 34.41, 180.0), 
                [11] = vector4(-438.96, -334.52, 34.41, 0.0), [12] = vector4(-438.29, -334.60, 34.41, 0.0), [13] = vector4(-437.52, -334.68, 34.41, 0.0), [14] = vector4(-436.76, -334.84, 34.41, 0.0), [15] = vector4(-436.09, -334.92, 34.41, 0.0), 
                [16] = vector4(-439.06, -335.23, 34.41, 180.0), [17] = vector4(-438.42, -335.30, 34.41, 180.0), [18] = vector4(-437.63, -335.41, 34.41, 180.0), [19] = vector4(-437.02, -335.50, 34.41, 180.0), [20] = vector4(-436.25, -335.75, 34.41, 180.0), 
                [21] = vector4(-436.45, -337.89, 34.41, 0.0), [22] = vector4(-437.21, -337.78, 34.41, 0.0), [23] = vector4(-438.01, -337.55, 34.41, 0.0), [24] = vector4(-438.63, -337.53, 34.41, 0.0), [25] = vector4(-439.26, -337.32, 34.41, 0.0), 
                [26] = vector4(-439.46, -338.12, 34.41, 180.0), [27] = vector4(-438.73, -338.20, 34.41, 180.0), [28] = vector4(-438.07, -338.43, 34.41, 180.0), [29] = vector4(-437.40, -338.55, 34.41, 180.0), [30] = vector4(-436.62, -338.55, 34.41, 180.0)} }, 
                poly = { center = vector3(-437.54, -334.75, 34.42), length = 8, width = 4, height = 0.75, heading = -7.0 } 
            },
            ['ZonahConsult1'] = { -- consult room 1
            sit = { type = 'chair2', seats = {[1] = vector4(-450.81, -322.74, 34.71, 350.62)} }, 
            lay = { type = 'lay', seats = {[1] = vector4(-450.34, -323.11, 34.71, 175.62)} },
            poly = { center = vector3(-450.48, -323.08, 34.41), length = 1, width = 2, height = 0.75, heading = -7.0  } 
            },
            ['ZonahConsult2'] = { -- consult room 2
            sit = { type = 'chair2', seats = {[1] = vector4(-456.34, -315.52, 34.71, 24.62)} }, 
            lay = { type = 'lay', seats = {[1] = vector4(-455.83, -315.61, 34.71, 200.62)} },
            poly = { center = vector3(-456.16, -315.52, 34.41), length = 1, width = 2, height = 0.75, heading = 200.0  } 
            },
            ['ZonahConsult3'] = { -- consult room 3
            sit = { type = 'chair2', seats = {[1] = vector4(-462.24, -301.49, 34.71, 24.62)} }, 
            lay = { type = 'lay', seats = {[1] = vector4(-462.24, -301.49, 34.71, 200.62)} },
            poly = { center = vector3(-462.24, -301.49, 34.41), length = 1, width = 2, height = 0.75, heading = 200.0  } 
            },
            ['ZonahConsult4'] = { -- consult room 4
            sit = { type = 'chair2', seats = {[1] = vector4(-464.77, -295.33, 34.71, 24.62)} }, 
            lay = { type = 'lay', seats = {[1] = vector4(-464.77, -295.33, 34.71, 200.62)} },
            poly = { center = vector3(-464.77, -295.33, 34.41), length = 1, width = 2, height = 0.75, heading = 200.0  } 
            },
            ['ZonahMRI'] = { -- MRI
            lay = { type = 'lay', seats = {[1] = vector4(-446.96, -290.90, 34.71, 200.62)} },
            poly = { center = vector3(-446.96, -290.90, 34.41), length = 1, width = 2, height = 0.75, heading = 200.0  } 
            },
            ['ZonahXRay'] = { -- Xray
            lay = { type = 'lay', seats = {[1] = vector4(-441.15, -303.30, 34.71, 200.62)} },
            poly = { center = vector3(-441.15, -303.30, 34.41), length = 1, width = 2, height = 0.75, heading = 200.0  } 
            },
            ['ZonahStaffCouch1'] = { -- Staff Couch 1
            lay = { type = 'lay', seats = {[1] = vector4(-430.93, -312.62, 34.41, 284.62)} },
            poly = { center = vector3(-430.93, -312.62, 34.41), length = 3, width = 2, height = 0.75, heading = 20.0  } 
            },
            ['ZonahSurgery1'] = { -- Surgery1
            lay = { type = 'lay', seats = {[1] = vector4(-456.74, -309.85, -130.93, 200.62)} },
            poly = { center = vector3(-456.74, -309.85, -130.93), length = 1, width = 2, height = 0.75, heading = 200.0  } 
            },
            ['ZonahSurgery2'] = { -- Surgery2
            lay = { type = 'lay', seats = {[1] = vector4(-443.0, -304.31, -130.93, 200.62)} },
            poly = { center = vector3(-443.0, -304.31, -130.93), length = 1, width = 2, height = 0.75, heading = 200.0  } 
            },
            ['ZonahSurgery3'] = { -- Surgery3
            lay = { type = 'lay', seats = {[1] = vector4(-446.05, -291.67, -130.93, 200.62)} },
            poly = { center = vector3(-446.05, -291.67, -130.93), length = 1, width = 2, height = 0.75, heading = 200.0  } 
            }
        }
    }

Doesn’t include absolutely every chair but includes every central waiting room chair, all the consultation tables, surgical beds, MRI and XRay beds.

Isn’t this just the free SIT ANYWHERE script from github modified?

Absolutely not! :grin:
This was built up from the ground and is not a “modified” version of any script.

This has (compared to the script you are referencing) many more models, has preset locations, allows for multiple sitting positions per model, is much more optimized, utilizes keymapping and much more. It’s not even close.

2 Likes

Purchase page not working

Seems to work just fine for me, is it still not working for you?

lLjKKl2.png (1664×978) (imgur.com)

VPN doesn’t help
Fix: adBlock ext chrome

Update!
I’ve fixed and added some stuff (see the list below). Just like last time, the most notable addition is another preset location, this time it is the Gabz team’s Vanilla Unicorns. I’ll continue to add more preset locations as time goes by. If you have any locations in particular that you wish me to add, leave a message here and I’ll try to prioritise it.

Changelog:

  • Added enable/disable option for preset locations to the config, this will make it easier to toggle preset locations.
  • Added Gabz’s Vanilla Unicorn as a preset location.
  • Added a reversed (rotated) version of the lay option ‘layside’. It’s now used at one spot in catcafe and at a couple of locations in gabz vanilla unicorn.
  • Made the timeout setting default to the default option unless set, removing the need to specify it on every sit type.
  • Fixed issue where the poly name was not getting saved/set for checks needed for laying down (the “bug” created some odd behaviour in some very specific situations).
1 Like

Tested works fine! Thanks

Hi! Can we still add our own locations for example for sitting on stairs etc? I tried to create new spots but they don’t seem to work as they did earlier.

This is really cool!!

2 Likes