ScriptsM Temp

ScriptsM Temperature

A simple script for qbcore/esx to get cold, disease or warm. Heal your character by pills, heatpack and check temp by thermometer.

Installation

Install all resource dependencies.

Download a resource (opens in a new tab) from keymaster or buy it by buttons at the top

Set up the InteractSound (opens in a new tab)

To get sounds working, you need to install sounds from zip archive following this guide:

  1. Add sounds from zip archive to InteractSound/client/html/sounds
  2. Open __resource.lua and modify following portion:
files({
    'client/html/index.html',
    -- Begin Sound Files Here...
    -- client/html/sounds/ ... .ogg
    ...
})
  1. Now you are done with sounds

Config

There you can find an config of script

# your framework
Config.Framework = 'esx'
 
# Drawable is a id of clothing, you can find it in vMenu or your character editor. Bonus is a temperature bonus that applys to character.
Config.Jackets = {
    {ismale = true, Jacketdrawable = 5, Jacketbonus = 2},
    {ismale = true, Jacketdrawable = 27, Jacketbonus = 5}
}
 
Config.Lower = {
    {ismale = true, Lowerdrawable = 5, Lowerbonus = 2},
    {ismale = true, Lowerdrawable = 4, Lowerbonus = 3}
}
 
Config.Boots = {
    {ismale = true, Bootsdrawable = 5, Bootsbonus = 2},
    {ismale = true, Bootsdrawable = 10, Bootsbonus = 5}
}
 
Config.Hat = {
    {ismale = true, Hatdrawable = 3, Hatbonus = 2},
    {ismale = true, Hatdrawable = 6, Hatbonus = 20}
}
 
Config.Scarf = {
    {ismale = true, Scarfdrawable = 31, Scarfbonus = 4},
    {ismale = true, Scarfdrawable = 6, Scarfbonus = 20}
}
 
Config.Mask = {
    {ismale = true, Maskdrawable = 10, Maskbonus = 2},
    {ismale = false, Maskdrawable = 6, Maskbonus = 20}
}
 
# Weather temperature
Config.weathers = {
    [`EXTRASUNNY`] = {6, -1.9, 30},
    [`CLEAR`] = {3, -1.9, 28},
    [`OVERCAST`] = {1, -1.9, 20},
    [`CLOUDS`] = {1, -1.9, 20},
    [`RAIN`] = {0.9, -1.9, 19},
    [`CLEARING`] = {2.1, -1.9, 20},
    [`THUNDER`] = {0.9, -1.9, 19},
    [`SMOG`] = {0.9, -1.9, 19},
    [`FOGGY`] = {0.9, -1.9, 19},
    [`XMAS`] = {2, -1.9, -4},
    [`SNOWLIGHT`] = {2, -1.9, -2},
    [`BLIZZARD`] = {2, -1.9, -2},
    ['default'] = {3, -1.9, 20}
}
 
# Bonuses
Config.CampFireBonus = 10
Config.InteriorBonus = 3
Config.WaterBonus = -5
Config.HeatPackBonus = 20
 
 
 
# Minus health if you get warm
Config.MinusHealth = 10
 
# Minus health if you get cold
Config.ColdMinusHealth = 10
 
# Temp to get heat
Config.MaxTemp = 30
 
# Temp to get cold
Config.MinTemp = 16
 
# Delay of health minus
Config.WaitMinusHealth = 15000
 
# Cough delay
Config.CoughTimer = 10000
 
# Campfire work radius
Config.CampRadius = 3.0
 
# You feeling heat notify
Config.HeatNotify = function()
end
 
# You feel sick notify
Config.InfectionNotify = function()
end
 
# You feel warmer notify
Config.HeatPackNotify = function()
end
 
# You apply pills notify
Config.PillsNotify = function()
end
 
# You feeling cold notify
Config.ColdNotify = function()
end
 
# No temperature thermometer notify
Config.NoThermometerNotification = function()
end
 
# High temperature thermometer notify
Config.YesThermometerNotification = function()
end
 
# Progress bar export to use thermometer. Delay = 3000.
Config.ProgressBarThermometer = function()
end

Exports

GetCurrentTemp

Returns current temperature

Use:

RegisterCommand( "hello", function()
   currenttemp = exports['SM-Cold']:GetCurrentTemp()
   print(currenttemp)
end)

IsDeseaseActive

Returns true or false, is desease active

Use:

RegisterCommand( "hello", function()
   isactive = exports['SM-Cold']:IsDeseaseActive()
   print(isactive)
end)