ScriptsM Skip Night
With SM-SKIPNIGHT, your players can sleep on beds, sleeping bags and skip the night. Time is synchronized among all players and changes smoothly, avoiding the flash grenade effect caused by abrupt time shifts.
Our script also includes a convenient sleep location installer, which allows you to select a sleep location with just one click (the sleeping ped is displayed, and you can place it on the bed, rotate it as you wish). The data is then automatically transferred to the config.
Installation
Download a resource (opens in a new tab) from keymaster or buy it by buttons at the top
It's important for your resources to start in a logical order to prevent errors from missing dependencies.
Resource start order
It's important for your resources to start in a logical order to prevent errors from missing dependencies.
start [your framework] # optional
start [your inventory] # optional
start sm_skipnight
Config
There you can find an config of resource with description for all params
Config = {}
Config.BedModels = { -- Models of beds that you can sleep on
{model = "p_mbbed_s", x = 0.0, y = 0.0, z = 1.7, zRot = -90.0, animdict='timetable@tracy@sleep@', animname='base'}, -- Animations: https://gtahash.ru/animations/
{model = "p_lestersbed_s", x = 0.0, y = 0.0, z = 1.1, zRot = -90.0, animdict='timetable@tracy@sleep@', animname='base'},
{model = "v_res_msonbed_s", x = 0.0, y = 0.0, z = 1.8, zRot = -90.0, animdict='timetable@tracy@sleep@', animname='base'},
}
Config.BagItems = { -- Sleeping bag items for use with inventory
{itemname='sleepbag', model='prop_skid_sleepbag_1', x = 0.0, y = 0.0, z = 1.1, zRot = 0.0, animdict='timetable@tracy@sleep@', animname='base'}
}
Config.OneBag = true -- Allow player have only one bag?
Config.BedPositions = { -- Bed positions on map. Can be simply installed through /setup command
{position = vector3(-0.8, 523.88, 170.32), zRot = 110.00, animdict = 'amb@world_human_sunbathe@female@back@base', animname = 'base'}, -- Animations: https://gtahash.ru/animations/
{position = vector3(-1.43, 524.35, 170.32), zRot = 0.00, animdict = 'amb@world_human_bum_slumped@male@laying_on_left_side@idle_a', animname = 'idle_b'},
}
Config.NightHour = 22 -- The hour after which the player can fall asleep
Config.MorningHour = 6 -- The hour before which the player will sleep. Also the hour after which the player will not be able to fall asleep
Config.SleepTime = 1 -- The multiplier of the time it takes for the player to wake up. 1 is the default value. It also depends on how much time the player needs to sleep.
Config.Framework = 'esx' -- standalone / qb / esx
Config.TargetSystem = 'ox' -- default / qb / ox
Config.UseBagCommand = true -- Use /sleepbag or not
Config.BagCommand = {model='prop_skid_sleepbag_1', x = 0.0, y = 0.0, z = 1.1, zRot = 0.0, animdict='timetable@tracy@sleep@', animname='base'} -- A sleeping bag that will be created by the command. -- Animations: https://gtahash.ru/animations/
Config.UseSetupCommand = true -- Use /setup command?
Config.PlayerPercent = 50 -- The percentage of all players who need to fall asleep to skip night
function Config.TimeExportSV(hour, minute) -- If you are using scripts to synchronize time, specify your server export here.
end
function Config.TimeExportCL(hour, minute) -- If you are using scripts to synchronize time, replace NetworkOverrideClockTime line with your client export here.
NetworkOverrideClockTime(hour, minute, 0)
end
Config.SetupConfirmKey = 191 -- E
Config.SetupCancelKey = 73 -- X
Config.RotateLeftKey = 44 -- Q
Config.RotateRightKey = 46 -- E
Config.SleepKey = 38 -- E
Config.PickupKey = 246 -- Y
Config.InteractDistance = 3 -- Distance to interact with bed
Config.Locales = {
["sleep"] = "Sleep",
['pickup'] = "Pickup",
['setup'] = "Start setup of bed position",
['bag_place'] = "Sleeping bag place\n~INPUT_FRONTEND_RDOWN~ - Confirm\n~INPUT_VEH_DUCK~ - Cancel\n",
['setup_help'] = "Bed position setup\n~INPUT_FRONTEND_RDOWN~ - Confirm\n~INPUT_VEH_DUCK~ - Cancel\n~INPUT_COVER~ - Rotate Left\n~INPUT_TALK~ - Rotate Right",
['already_have'] = "You already have a sleeping bag",
['sleeping_now'] = "Sleeping now:",
['wake_up'] = "Wake up: ~g~[Space]",
['time'] = "~w~Time:",
["far_away"] = "~r~Too far away.",
["arg_name"] = "double",
["arg_desc"] = "Double bed mode. Enter double to activate",
['bag_help'] = "~INPUT_PICKUP~ - Sleep\n~INPUT_MP_TEXT_CHAT_TEAM~ - Pickup",
['sleep_help'] = "~INPUT_PICKUP~ - Sleep",
['bag_command'] = "Place sleeping bag",
}