[STANDALONE] Sit Anywhere

kc-sitting

Sit Anywhere - Immersive Seating

Tired of struggling to find the perfect spot to sit and relax? This script enables players to sit anywhere they like, providing a more immersive and interactive environment. With a single command, you’ll be comfortably seated in no time - perfect for in-game socializing or taking a break from the action!

Sit Anywhere is a standalone script that offers 6 dynamic “situations” to sit or lean, working in real time without the need to configure various locations or props. Highly optimized and customizable, this script ensures minimal performance impact on your game while offering a seamless seating experience :wink:

Features

  • 6 dynamic situations: Sit, Sit on the ground, Sit on chairs/benches, Sit on stairs, Sit on ledges, Leaning on wall
  • No need to configure various locations or props; everything is done dynamically in real time
  • Single, easy-to-use command that can be changed in the Config file (Default: /sit)
  • Automatically determines the most appropriate scenario based on the player’s surroundings
  • Update checker with changelog if a new update is found directly in the console on resource start, except if fivem-checker is installed and running on your server
  • Highly optimized script: 0.00ms (0.00%) on idle and 0.02ms after entering the command until the player is seated (Max reached is 0.03ms)
  • Debug mode for troubleshooting any issues with the resource
  • Customizable localization and command name, along with even more options that you can see in the config file below
Config file

The script is highly configurable; check out the full config file:

Config                              = Config or {}

-- Base
Config.Precision                    = 0.04  -- This determines the precision at which the system will attempt to detect a seat. If set too low, it may cause severe lag. If set too high, player placement may be slightly off (The default value is 0.04)
Config.MaxHeight                    = 0.20  -- This determines the maximum height a player can sit at. A higher value allows for higher seating positions (The default value is 0.20)
Config.Distance                     = 0.5   -- This determines the distance at which the system will search for a seat. If set too low, it may not accurately detect seats. If set too high, it may produce unexpected detections (The default value is 0.5)
Config.GroundDistance               = 0.8   -- This determines the distance at which the system will search for a seat on the ground. If set too low, it may not accurately detect seats. If set too high, it may produce unexpected detections (The default value is 0.8)
Config.StairsDistance               = 1.0   -- This determines the distance at which the system will search for stairs. (The default value is 1.0) ## DO NOT MODIFY THIS SINCE IT ISN'T BUGPROOF ##
Config.MaxRetryBeforeSeated         = 10    -- This determines how many attempts the system will make to detect a seat. A higher value means the player will wait longer before being seated, while a lower value reduces the likelihood of finding a seat (The default value is 10)
Config.DistanceCheckPed             = 0.6   -- This determines the distance at which the system need to check for the closest ped to avoid 2 players sitting inside each other (The default value is 0.6)
-- I would advise to not change anything in this category, I've still left those options if anyone really need to modify such things.

-- Detection
Config.DetectWorld                  = true  -- This value determines whether the system should detect seats in the world (The default value is true)
Config.DetectProps                  = true  -- This value determines whether the system should detect seats on props (The default value is true)
Config.DetectVehicles               = false -- This value determines whether the system should detect seats on vehicles (The default value is false)
-- I would advise to not change anything in this category, I've still left those options if anyone really need to modify such things. Be aware of DetectVehicles, it doesn't work for every vehicles, thats why it's false by default!

-- Sit Bind Config
Config.CommandTitle                 = 'Sit Anywhere'    -- Key title in GTA 5 control settings
Config.CommandInputMapper           = 'KEYBOARD'        -- Input Mapper (https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/)
Config.CommandInputParameter        = 'J'               -- Input Parameter (https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/)
Config.CommandUseKey                = false              -- This value determines if you want to use the set keys above or not
Config.CommandName        		    = 'sit'             -- If you use another sitting script, you can change the command name to avoid any issue

-- Get Up Config
Config.GetUpFromSitKey              = 73                -- This value determines the control key to get up from a seat (The default value is 73 - X) -- https://docs.fivem.net/docs/game-references/controls/
Config.GetUpFromSitKeyName          = 'INPUT_VEH_DUCK'  -- This value determines the name of the control key to get up from a seat (The default value is 'INPUT_VEH_DUCK') -- https://docs.fivem.net/docs/game-references/controls/
Config.UseMoveKeyToGetUp            = false             -- This value determines whether the system should use the key set above or use the move keys to get up from a seat (32, 33, 34, 35)
Config.GetUpChecks                  = {                 -- This table determines the condition that must be met for a player to get up from a seat (You can't add new condition that the default ones)
    ["Health"] = false,
    ["Ragdoll"] = false
}

-- List
Config.EnabledList = { -- This list allow you to able/disable certain sit type.
    ['Stairs'] = true,
    ['Chair'] = true,
    ['Sit'] = true,
    ['Wall'] = true,
    ['Ledge'] = true,
    ['Ground'] = false,
    ['Seat'] = true,
    ['Seat (chair)'] = true
}

-- Misc
Config.Language						= 'en'		-- Currently Available: fr, en
Config.Debug        				= false   	-- If you think something is not working properly, you can set 'Config.Debug' to true. It will then print a lot of debug information in your console or above radar
Config.UpdateChecker                = false     -- Set to false if you don't want to check for resource update on start (No need to change this if you're using fivem-checker)
Config.ChangeLog					= false		-- Set to false if you don't want to display the changelog if new version is find (No need to change this if you're using fivem-checker)

-- Custom condition to sit
function CanSit(player)
    return true -- Example: " return GetSelectedPedWeapon(player) == GetHashKey('weapon_unarmed')"
end

function SittingNotification(message, type) -- type: 0 refer to nothing special, 1 could refer to "success", 2 could refer to "error", 3 could refer to "in progress"
    local ShouldBeep = {
        [0] = false,
        [1] = true,
        [2] = true,
        [3] = false
    }

    DrawText2D(message, ShouldBeep[type])
end

Showcase

Youtube video (if the above won’t load)

Screenshot:

Sit on ledges

More coming soon

Purchase on Tebex

Get Sit Anywhere at 12.00 USD on Tebex.


My other scripts

[STANDALONE] Pick It Back
[STANDALONE] Parkour Abilities
[STANDALONE] Better Tricks & Wheelies

Feel free to share your suggestions, and enjoy a more immersive seating experience! Please be gentle with feedback, as this is my first-ever paid script release :sweat_smile:

Code is accessible No, only Config file
Subscription-based No
Lines (approximately) 300
Requirements None
Support Yes
11 Likes

Nice realse!

PD: Wrong yt link of the video :stuck_out_tongue:

Oh thanks lmao! Too much stress going on right now :melting_face:

1 Like

how about ox target usage here?

It’s not target reliant mate.
Great release, can’t wait to try it out.

very interesting, but I also wish it was by qb-target

What do you mean by that?

What needs are you interesting in seeing in this script regarding a third eye implementation?

2 Likes

yes. Ox_target.

Any change to fix the view when sitting

And maybe to detect these kinda seats , looks off sitting on these chairs like this.

Oh wow… I hadn’t thought of such a situation… I will look into it, but I might need to add a list for different props. Which MLO is this?

Also, regarding the camera issue, I might have an idea!

We have a lot of MLO’s with these kinda seats , most are Gabz MLOs

r u kiddin? these are just noclip scripts with placement adjustment and sitting animations xD Lookin awful imo.

@Clementinise Perfect release mate. gonna be lookin’ forward for updates.

1 Like

Script looks really handy, the q is… is it possible to sit, lean behind, or on transport as well? like on car hood, or else?

Well, it is possible, but the way the script checks for a sitting position is somewhat bugged for vehicles, and I don’t think it’s fixable. You can still activate vehicle detection in the config file if needed, but I can’t guarantee it will works as good as the rest :melting_face:

1 Like

Can you add a check for Is Ped In vehicle?
Cz people can use the command to get out of a fast moving car.

1 Like

:rotating_light: Update Alert :rotating_light:

I’ve been working on improving the Sit Anywhere script and have implemented a bunch of fixes and additions. With new features like sitting on stairs and other enhancements :smile:

Changelog:

  • Added a new scenario, sit on stairs, for an even more diverse seating experience (please report any stairs that don’t work to me)
  • Implemented a check to avoid players sitting inside each other
  • Introduced a config option for customizing conditions that affect the player getting up
  • Added a 2D Text prompt, so you know which key to press to get up
  • Included new debug prints for easier troubleshooting
  • Added a locale system to choose the language for the script’s text
  • Integrated new checks to avoid exploits, ensuring you aren’t in a car or already seated
  • Fixed an issue that could result in you being seated at 0.0 0.0 0.0 coordinates
  • Fixed an issue with the changelog only displaying the first line

As always, I value your feedback and suggestions. If you have any specific features you’d like to see added, feel free to leave a message here. Enjoy the enhanced Sit Anywhere experience! :wink:

1 Like

Minor Update

Changelog:

  • 3 New Config options: Config.CommandTitle, Config.CommandInputMapper, and Config.CommandInputParameter to bind the command to a key
  • New export exports['kc-sitting']:IsSitting(): Returns whether the player is sitting
  • Added function CanSit() in the config to add custom conditions for sitting
1 Like

Hi, does it detect these kinds of seats already? thanks

Not yet, I’m reworking the whole script for those kinds of situations, but it might take a while (I will DM you once it’s released)

1 Like