forked from Simnation/Main
ed
This commit is contained in:
parent
577410aa72
commit
a58add2e97
11 changed files with 908 additions and 0 deletions
BIN
resources/[carscripts]/kq_realoffroad/.fxap
Normal file
BIN
resources/[carscripts]/kq_realoffroad/.fxap
Normal file
Binary file not shown.
26
resources/[carscripts]/kq_realoffroad/INSTALLATION.md
Normal file
26
resources/[carscripts]/kq_realoffroad/INSTALLATION.md
Normal file
|
@ -0,0 +1,26 @@
|
|||
## KQ_REALOFFROAD INSTALLATION GUIDE
|
||||
|
||||
### Step 1:
|
||||
Put the folder into your resources folder
|
||||
|
||||
### Step 2:
|
||||
Ensure the script in your `server.cfg` file.
|
||||
|
||||
### Step 3:
|
||||
Test out the script and tweak it through the config to your liking if needed.
|
||||
|
||||
|
||||
### Done
|
||||
Enjoy the script
|
||||
|
||||
|
||||
- https://kuzquality.com/
|
||||
- https://discord.gg/fZsyam7Rvz
|
||||
- https://www.youtube.com/@KuzQuality
|
||||
|
||||
### Extra
|
||||
If you're using custom MLOs. Some of the MLOs may have an incorrectly
|
||||
configured surfaces. Make sure to test them. You can enable the `debug mode` in the config.
|
||||
That will allow you to do `/surfaceDebug` to see information about the surfaces and area that you're in.
|
||||
If you notice that a certain surface in an MLO is incorrect, you can add the whole area to a
|
||||
blacklist within the config file to disable the offroad handling for that specific area.
|
BIN
resources/[carscripts]/kq_realoffroad/client/cache.lua
Normal file
BIN
resources/[carscripts]/kq_realoffroad/client/cache.lua
Normal file
Binary file not shown.
BIN
resources/[carscripts]/kq_realoffroad/client/client.lua
Normal file
BIN
resources/[carscripts]/kq_realoffroad/client/client.lua
Normal file
Binary file not shown.
|
@ -0,0 +1,232 @@
|
|||
-- This function is responsible for all the tooltips displayed on top right of the screen, you could
|
||||
-- replace it with a custom notification etc.
|
||||
function ShowTooltip(message)
|
||||
SetTextComponentFormat("STRING")
|
||||
AddTextComponentString(message)
|
||||
EndTextCommandDisplayHelp(0, 0, 0, 2000)
|
||||
end
|
||||
|
||||
-- This function is responsible for drawing all the 3d texts ('Press [E] to ...' e.g)
|
||||
function Draw3DText(coords, textInput)
|
||||
SetTextScale(0.25, 0.25)
|
||||
SetTextFont(4)
|
||||
SetTextProportional(1)
|
||||
SetTextDropshadow(1, 1, 1, 1, 255)
|
||||
SetTextEdge(2, 0, 0, 0, 150)
|
||||
SetTextDropShadow()
|
||||
SetTextOutline()
|
||||
SetTextEntry("STRING")
|
||||
SetTextCentre(1)
|
||||
AddTextComponentSubstringKeyboardDisplay(textInput)
|
||||
SetDrawOrigin(coords, 0)
|
||||
DrawText(0.0, 0.0)
|
||||
ClearDrawOrigin()
|
||||
end
|
||||
|
||||
|
||||
if Config.debug then
|
||||
local surfaceDebug = false
|
||||
|
||||
RegisterCommand('surfaceDebug', function(s, args)
|
||||
if args[1] and (args[1] == 'off' or args[1] == 'false') then
|
||||
surfaceDebug = false
|
||||
else
|
||||
surfaceDebug = true
|
||||
end
|
||||
end)
|
||||
|
||||
local wheelBones = {
|
||||
'hub_lf',
|
||||
'hub_rf',
|
||||
'hub_rr',
|
||||
'hub_lr',
|
||||
}
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
local sleep = 3000
|
||||
local playerPed = PlayerPedId()
|
||||
|
||||
if surfaceDebug and IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(GetPlayerVeh(), -1) == playerPed then
|
||||
sleep = 0
|
||||
|
||||
local veh = GetPlayerVeh()
|
||||
local vehCoords = GetEntityCoords(veh)
|
||||
|
||||
local nearestRoad = GetNearestRoadDistance()
|
||||
Draw3DText(vehCoords + vector3(0.0, 0.0, -0.3), '~w~Closest road: ' .. nearestRoad)
|
||||
|
||||
|
||||
local zoneHash = GetNameOfZone(vehCoords)
|
||||
local zoneData = GetZoneData(zoneHash)
|
||||
if zoneData then
|
||||
Draw3DText(vehCoords, '~y~Zone: ' .. zoneHash .. ' ~w~(' .. zoneData.name .. ' | dpth: x' .. zoneData.depthMultiplier .. ' | trcn: x' .. zoneData.tractionMultiplier .. ')')
|
||||
else
|
||||
Draw3DText(vehCoords, '~y~Zone: ' .. zoneHash)
|
||||
end
|
||||
|
||||
if IsSnowy() then
|
||||
Draw3DText(vehCoords + vector3(0.0, 2.0, 0.0), '~w~Snowy')
|
||||
end
|
||||
|
||||
local traction = CURRENT_TRACTION
|
||||
if traction < 100 then
|
||||
traction = traction + GetVehicleModelTractionUpgrade(veh)
|
||||
end
|
||||
Draw3DText(vehCoords + vector3(0.0, 0.0, -0.4), '~b~Traction: ' .. traction)
|
||||
|
||||
local isBlacklistedArea, blacklistArea = IsInBlacklistedArea(veh)
|
||||
if isBlacklistedArea then
|
||||
DrawSphere(blacklistArea.coords, blacklistArea.radius, 200, 0, 0, 0.5)
|
||||
Draw3DText(vehCoords - vector3(0.0, 0.0, -0.4), '~r~In blacklisted area')
|
||||
end
|
||||
|
||||
for index = 0, GetVehicleNumberOfWheels(veh) -1 do
|
||||
local surfaceId = GetVehicleWheelSurfaceMaterial(veh, index)
|
||||
|
||||
if index + 1 <= #wheelBones then
|
||||
local boneIndex = GetEntityBoneIndexByName(veh, wheelBones[index + 1])
|
||||
local coords = GetWorldPositionOfEntityBone(veh, boneIndex)
|
||||
|
||||
if Config.surfaces[surfaceId] then
|
||||
local data = Config.surfaces[surfaceId]
|
||||
Draw3DText(coords, '~g~[~w~' .. surfaceId .. '~g~]\n~w~' .. data.name .. '~g~\nTraction ' .. data.traction .. '\nDepth ' .. data.depth .. '\nSoftness ' .. data.softness)
|
||||
else
|
||||
Draw3DText(coords, '~r~' .. surfaceId)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Citizen.Wait(sleep)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function IsSnowy()
|
||||
return UseCache('isSnowy', function()
|
||||
return ContainsVehicleModel(Config.snow.weathers, GetNextWeatherTypeHashName()) or GetSnowLevel() > 0.1
|
||||
end, 5000)
|
||||
end
|
||||
|
||||
function GetNearestRoadDistance()
|
||||
return UseCache('nearestRoad', function()
|
||||
local coords = GetEntityCoords(PlayerPedId())
|
||||
local ret, p5, p6 = GetClosestRoad(coords.x, coords.y, coords.z, 1.0, 0, 1)
|
||||
local dist1 = GetDistanceBetweenCoords(p5, coords, false)
|
||||
local dist2 = GetDistanceBetweenCoords(p6, coords, false)
|
||||
|
||||
return math.min(dist1, dist2)
|
||||
end, 1000)
|
||||
end
|
||||
|
||||
function HasOffroadTires(veh)
|
||||
return UseCache('hasOffroadTires_' .. veh, function()
|
||||
return GetVehicleWheelType(veh) == 4
|
||||
end, 5000)
|
||||
end
|
||||
|
||||
function GetVehicleSuspenionHeight(veh)
|
||||
local min, max = GetVehicleSuspensionBounds(veh)
|
||||
return math.abs(min.z) + max.z
|
||||
end
|
||||
|
||||
function GetMassUpgrade(veh)
|
||||
return UseCache('weightUpgrade' .. veh, function()
|
||||
local mass = GetVehicleHandlingFloat(veh, 'CHandlingData', 'fMass')
|
||||
|
||||
local upgrade = 0
|
||||
if mass > 1300 then
|
||||
upgrade = (1300 - mass) / 60
|
||||
else
|
||||
upgrade = (1300 - mass) / 10
|
||||
end
|
||||
|
||||
if GetWheelCount(veh) == 2 then
|
||||
upgrade = upgrade * 0.1
|
||||
elseif GetWheelCount(veh) == 3 then
|
||||
upgrade = upgrade * 0.35
|
||||
end
|
||||
|
||||
return upgrade
|
||||
end, 60000)
|
||||
end
|
||||
|
||||
function IsMotorcycle(veh)
|
||||
return UseCache('isMotorbike_' .. veh, function()
|
||||
return GetVehicleClass(veh) == 8
|
||||
end, 60000)
|
||||
end
|
||||
|
||||
function IsInBlacklistedArea(veh)
|
||||
return UseCache('isInBlacklistedArea_' .. veh, function()
|
||||
local coords = GetEntityCoords(veh)
|
||||
|
||||
for k, area in pairs(Config.areaBlacklist) do
|
||||
local distance = GetDistanceBetweenCoords(coords, area.coords)
|
||||
if distance <= area.radius then
|
||||
return true, area
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end, 1000)
|
||||
end
|
||||
|
||||
function GetVehicleModelUpgrade(veh)
|
||||
return UseCache('vehicleModelUpgrade_' .. veh, function()
|
||||
for model, handling in pairs(Config.depthHandlingQuality.models) do
|
||||
if GetEntityModel(veh) == GetHashKey(model) then
|
||||
return handling
|
||||
end
|
||||
end
|
||||
|
||||
local vehClass = GetVehicleClass(veh)
|
||||
if Config.depthHandlingQuality.classes[vehClass] then
|
||||
return Config.depthHandlingQuality.classes[vehClass]
|
||||
end
|
||||
|
||||
return 0
|
||||
end, 60000)
|
||||
end
|
||||
|
||||
|
||||
function GetVehicleModelTractionUpgrade(veh)
|
||||
return UseCache('vehicleModelTractionUpgrade_' .. veh, function()
|
||||
for model, handling in pairs(Config.tractionHandlingQuality.models) do
|
||||
if GetEntityModel(veh) == GetHashKey(model) then
|
||||
return handling
|
||||
end
|
||||
end
|
||||
|
||||
local vehClass = GetVehicleClass(veh)
|
||||
if Config.tractionHandlingQuality.classes[vehClass] then
|
||||
return Config.tractionHandlingQuality.classes[vehClass]
|
||||
end
|
||||
|
||||
return 0
|
||||
end, 60000)
|
||||
end
|
||||
|
||||
function IsBlacklisted(veh)
|
||||
return UseCache('vehicleBlacklisted' .. veh, function()
|
||||
for _, model in pairs(Config.blacklist.models) do
|
||||
if GetEntityModel(veh) == GetHashKey(model) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local vehClass = GetVehicleClass(veh)
|
||||
if Config.blacklist.classes[vehClass] then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end, 60000)
|
||||
end
|
||||
|
||||
function GetCurrentDepth()
|
||||
return CURRENT_DEPTH
|
||||
end
|
||||
|
||||
exports('GetCurrentDepth', GetCurrentDepth);
|
BIN
resources/[carscripts]/kq_realoffroad/client/functions.lua
Normal file
BIN
resources/[carscripts]/kq_realoffroad/client/functions.lua
Normal file
Binary file not shown.
BIN
resources/[carscripts]/kq_realoffroad/client/handling.lua
Normal file
BIN
resources/[carscripts]/kq_realoffroad/client/handling.lua
Normal file
Binary file not shown.
611
resources/[carscripts]/kq_realoffroad/config.lua
Normal file
611
resources/[carscripts]/kq_realoffroad/config.lua
Normal file
|
@ -0,0 +1,611 @@
|
|||
Config = {}
|
||||
|
||||
-- This enabled additional debug commands and logs
|
||||
-- Debug commands:
|
||||
-- /surfaceDebug - Displays the surface that the wheel is standing on along with all its configured values
|
||||
Config.debug = false
|
||||
|
||||
|
||||
-------------------------------------------------
|
||||
--- GENERAL SETTINGS
|
||||
-------------------------------------------------
|
||||
|
||||
-- By default this script is configured to replicate realistic(ish) values while keeping the gameplay fun and entertaining.
|
||||
-- If you want to make this script less realistic and more arcady. If your players are getting annoyed and you don't want
|
||||
-- a realistic handling. Here are the recommended values:
|
||||
-- generalDepthDifficulty = 25
|
||||
-- generalSinkageSpeed = 50
|
||||
-- generalTractionLoss = 50
|
||||
|
||||
-- General difficulty of the depth handling.
|
||||
-- 100 = default
|
||||
-- Lower this value to make driving in deep surfaces (such as mud or deep sand) easier for ALL vehicles
|
||||
-- Raise this value to make driving in deep surfaces more difficult
|
||||
Config.generalDepthDifficulty = 100
|
||||
|
||||
-- General speed of the vehicle sinking into the surface
|
||||
-- 100 = Default
|
||||
-- Lower this value to make all vehicles sink slower
|
||||
-- Raise this value to make all vehicles sink faster
|
||||
Config.generalSinkageSpeed = 100
|
||||
|
||||
-- General loss of traction based on vehicle surface
|
||||
-- Vehicles will be more likely to skid on low traction surfaces
|
||||
-- Lower this value to decrease the general traction loss (make vehicles drift less on slippery surfaces)
|
||||
-- Raise this value to make vehicles lose more traction on slippery surfaces (make vehicles drift more on slippery surfaces)
|
||||
Config.generalTractionLoss = 100
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------
|
||||
--- VEHICLE MODIFIERS
|
||||
-------------------------------------------------
|
||||
|
||||
-- Changes that offroad tires will make.
|
||||
-- upgradeValue = value of how much better the vehicle should perform when deep in a surface (mud, sand, etc.)
|
||||
-- tractionOnSoft = Additional traction when on materials of softness that's more than 10
|
||||
-- tractionOnHard = Additional (in default case negative) traction on hard materials (softness less than 10)
|
||||
Config.offroadTires = {
|
||||
upgradeValue = 50,
|
||||
tractionOnSoft = 20,
|
||||
tractionOnHard = -10,
|
||||
}
|
||||
|
||||
-- Handling upgrade in deep surface for AWD (4WD) vehicles
|
||||
Config.awdUpgrade = 25
|
||||
|
||||
-- Speed at which vehicles will have 100% of skidding effect applied. When driving under said speed vehicles will not slide nearly as much
|
||||
-- (in km/h)
|
||||
Config.skidSpeedThreshold = 60
|
||||
|
||||
-------------------------------------------------
|
||||
--- SCRIPT PERFORMANCE SETTINGS
|
||||
-------------------------------------------------
|
||||
|
||||
-- The refresh rate of all the sinking/surface logic. The higher the value the less smoother the visuals but better script performance.
|
||||
-- If your server is known for players with slower devices you might want to turn this up
|
||||
-- If your players have better computers or you really want the off-roading to look good try turning it down
|
||||
-- Values between 100 - 500
|
||||
Config.refreshRate = 200
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------
|
||||
--- AREA BLACKLISTING
|
||||
-------------------------------------------------
|
||||
|
||||
-- Some custom MLOs have incorrectly set surfaces for the areas (e.g asphalt is marked as dirt or sand), causing vehicles to sink
|
||||
-- Here you can define custom areas in which the script will not be active in
|
||||
|
||||
-- By default I configured some popular locations for custom MLOs to hopefully prevent majority of issues with sinking into
|
||||
-- incorrectly setup MLO surfaces
|
||||
Config.areaBlacklist = {
|
||||
{ -- Pillbox hospital
|
||||
coords = vector3(293.17, -584.5, 42.8),
|
||||
radius = 20.0
|
||||
},
|
||||
{ -- LSPD
|
||||
coords = vector3(444.9, -1003.2, 30.7),
|
||||
radius = 60.0
|
||||
},
|
||||
{ -- Simeon's dealership
|
||||
coords = vector3(-40.4, -1111.3, 25.8),
|
||||
radius = 40.0
|
||||
},
|
||||
{ -- BCSO
|
||||
coords = vector3(-446.0, 6013.8, 31.8),
|
||||
radius = 50.0
|
||||
},
|
||||
{ -- Sandy Shores PD
|
||||
coords = vector3(1853.6, 3685.8, 34.3),
|
||||
radius = 25.0
|
||||
},
|
||||
{ -- Legion Square
|
||||
coords = vector3(202.3, -941.9, 27.6),
|
||||
radius = 120.0
|
||||
},
|
||||
}
|
||||
|
||||
-------------------------------------------------
|
||||
--- DETAILED SETTINGS
|
||||
-------------------------------------------------
|
||||
|
||||
-- Blacklist. This will disable all script functionality for said model/vehicle class
|
||||
Config.blacklist = {
|
||||
models = {
|
||||
'rcbandito',
|
||||
'monster',
|
||||
'rhino',
|
||||
'scarab',
|
||||
'khanjali',
|
||||
},
|
||||
classes = {
|
||||
[0] = false, -- Compacts
|
||||
[1] = false, -- Sedans
|
||||
[2] = false, -- SUVs
|
||||
[3] = false, -- Coupes
|
||||
[4] = false, -- Muscle
|
||||
[5] = false, -- Sports Classics
|
||||
[6] = false, -- Sports
|
||||
[7] = false, -- Super
|
||||
[8] = false, -- Motorcycles
|
||||
[9] = false, -- Off-road
|
||||
[10] = false, -- Industrial
|
||||
[11] = false, -- Utility
|
||||
[12] = false, -- Vans
|
||||
[17] = false, -- Service
|
||||
[18] = false, -- Emergency
|
||||
[19] = false, -- Military
|
||||
[20] = false, -- Commercial
|
||||
}
|
||||
}
|
||||
|
||||
-- If you define a model specific multiplier it will be used instead of the class multiplier
|
||||
-- Vehicle classes https://docs.fivem.net/natives/?_0x29439776AAA00A62
|
||||
-- Abstract value - Determines how well the class or model of the vehicle can handle being submerged in the surface
|
||||
-- 0 = Default
|
||||
-- Positive values = Better handling / ability to get out of deep surface
|
||||
-- Negative values = Worse handling / less ability to get out of deep surface
|
||||
Config.depthHandlingQuality = {
|
||||
models = {
|
||||
seminole2 = 20,
|
||||
sandking = 20,
|
||||
sandking2 = 20,
|
||||
issi2 = -10,
|
||||
panto = -20,
|
||||
comet4 = 30,
|
||||
|
||||
-- dirt bikes
|
||||
bf400 = 30,
|
||||
sanchez = 20,
|
||||
manchez = 20,
|
||||
esskey = 0,
|
||||
cliffhanger = 0,
|
||||
enduro = 0,
|
||||
},
|
||||
classes = {
|
||||
[0] = 5, -- Compacts
|
||||
[1] = -5, -- Sedans
|
||||
[2] = 15, -- SUVs
|
||||
[3] = 0, -- Coupes
|
||||
[4] = -5, -- Muscle
|
||||
[5] = 5, -- Sports Classics
|
||||
[6] = 5, -- Sports
|
||||
[7] = 5, -- Super
|
||||
[8] = -20, -- Motorcycles
|
||||
[9] = 35, -- Off-road
|
||||
[10] = -10, -- Industrial
|
||||
[11] = -10, -- Utility
|
||||
[12] = -5, -- Vans
|
||||
[17] = 10, -- Service
|
||||
[18] = 10, -- Emergency
|
||||
[19] = 15, -- Military
|
||||
[20] = -5, -- Commercial
|
||||
}
|
||||
}
|
||||
|
||||
-- If you define a model specific multiplier it will be used instead of the class multiplier
|
||||
-- Vehicle classes https://docs.fivem.net/natives/?_0x29439776AAA00A62
|
||||
-- Abstract value - Determines how much traction the vehicle has on an off-road surface
|
||||
-- 0 = Default
|
||||
-- Positive values = Better handling / less traction loss effect
|
||||
-- Negative values = Worse handling / more traction loss effect
|
||||
Config.tractionHandlingQuality = {
|
||||
models = {
|
||||
seminole2 = 25,
|
||||
sandking = 15,
|
||||
sandking2 = 15,
|
||||
comet4 = 20,
|
||||
},
|
||||
classes = {
|
||||
[0] = 5, -- Compacts
|
||||
[1] = 0, -- Sedans
|
||||
[2] = 10, -- SUVs
|
||||
[3] = 0, -- Coupes
|
||||
[4] = -5, -- Muscle
|
||||
[5] = -5, -- Sports Classics
|
||||
[6] = -5, -- Sports
|
||||
[7] = -10, -- Super
|
||||
[8] = 0, -- Motorcycles
|
||||
[9] = 20, -- Off-road
|
||||
[10] = -10, -- Industrial
|
||||
[11] = -10, -- Utility
|
||||
[12] = -5, -- Vans
|
||||
[17] = 10, -- Service
|
||||
[18] = 15, -- Emergency
|
||||
[19] = 20, -- Military
|
||||
[20] = -5, -- Commercial
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Options to decrease traction when theres snow on the roads or the weather is snowy
|
||||
Config.snow = {
|
||||
enabled = true,
|
||||
tractionLoss = 30,
|
||||
|
||||
weathers = {
|
||||
'XMAS',
|
||||
},
|
||||
}
|
||||
|
||||
-- Options to decrease traction when its raining
|
||||
Config.rain = {
|
||||
enabled = true,
|
||||
tractionLoss = 10,
|
||||
}
|
||||
|
||||
|
||||
-- Whether to disable the total stop when deep in mud. When `true` vehicles will always be able to move slowly, even when deep submerged
|
||||
Config.disableTotalStop = false
|
||||
|
||||
-------------------------------------------------
|
||||
--- ROADSIDE SETTINGS
|
||||
-------------------------------------------------
|
||||
|
||||
-- When enabled it makes surfaces which are close to main roads less deep to prevent cars from sinking too deep when on the median etc.
|
||||
Config.roadSideHelper = {
|
||||
enabled = true,
|
||||
|
||||
-- Maximum distance from the road (mind that this takes the middle point of the road. You can see the distance in the /surfaceDebug mode
|
||||
distanceThreshold = 15.0,
|
||||
|
||||
-- Depth multiplier
|
||||
depthMultiplier = 0.1,
|
||||
|
||||
-- Traction loss multiplier
|
||||
tractionMultiplier = 0.25,
|
||||
}
|
||||
|
||||
|
||||
-------------------------------------------------
|
||||
--- SURFACES
|
||||
-------------------------------------------------
|
||||
|
||||
-- name = Only used for the ease of config as well as the debug mode
|
||||
-- traction = Amount of traction on the surface. Anything below 100 will make the vehicles skid. Lower value = more skid
|
||||
-- Maximum 100
|
||||
-- Minimum 0
|
||||
|
||||
-- depth = Maximum depth of the surface in mm (millimeter) - (100mm = +-4 inches)
|
||||
-- Maximum infinite
|
||||
-- Minimum 0
|
||||
|
||||
-- softness = The softness of the material. This dictates how fast the vehicles will sink into the surface. (This is also used for off-road tires to decide their handling boost
|
||||
-- Maximum infinite
|
||||
-- Minimum 0
|
||||
|
||||
-- Values which will be assigned to all un-configured surfaces
|
||||
Config.fallbackSurface = {
|
||||
name = 'Fallback Surface',
|
||||
traction = 100,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
}
|
||||
|
||||
Config.surfaces = {
|
||||
[1] = {
|
||||
name = 'Concrete',
|
||||
traction = 100,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
[4] = {
|
||||
name = 'Road',
|
||||
traction = 100,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
[5] = {
|
||||
name = 'Tarmac',
|
||||
traction = 100,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
[6] = {
|
||||
name = 'Sandy roadside',
|
||||
traction = 80,
|
||||
depth = 50,
|
||||
softness = 5,
|
||||
},
|
||||
[9] = {
|
||||
name = 'Sandstone',
|
||||
traction = 80,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
[10] = {
|
||||
name = 'Rock',
|
||||
traction = 80,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
[11] = {
|
||||
name = 'Rock',
|
||||
traction = 80,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
[13] = {
|
||||
name = 'Cobble',
|
||||
traction = 90,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
[16] = {
|
||||
name = 'Limestoneesque sand',
|
||||
traction = 80,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
[17] = {
|
||||
name = 'Rocky dry dirt',
|
||||
traction = 80,
|
||||
depth = 50,
|
||||
softness = 5,
|
||||
},
|
||||
[18] = {
|
||||
name = 'Dry sand',
|
||||
traction = 80,
|
||||
depth = 130,
|
||||
softness = 40,
|
||||
},
|
||||
[19] = {
|
||||
name = 'Road sand',
|
||||
traction = 90,
|
||||
depth = 30,
|
||||
softness = 5,
|
||||
},
|
||||
[20] = {
|
||||
name = 'Grainy Sand',
|
||||
traction = 80,
|
||||
depth = 100,
|
||||
softness = 10,
|
||||
},
|
||||
[21] = {
|
||||
name = 'Gravely sand',
|
||||
traction = 70,
|
||||
depth = 220,
|
||||
softness = 30,
|
||||
},
|
||||
[22] = {
|
||||
name = 'Wet hard sand',
|
||||
traction = 70,
|
||||
depth = 250,
|
||||
softness = 50,
|
||||
},
|
||||
[23] = {
|
||||
name = 'Gravel road',
|
||||
traction = 75,
|
||||
depth = 50,
|
||||
softness = 5,
|
||||
},
|
||||
[24] = {
|
||||
name = 'Wet sand',
|
||||
traction = 60,
|
||||
depth = 350,
|
||||
softness = 70,
|
||||
},
|
||||
[31] = {
|
||||
name = 'Gravely dirt/path',
|
||||
traction = 70,
|
||||
depth = 50,
|
||||
softness = 5,
|
||||
},
|
||||
[32] = {
|
||||
name = 'Gravely dirt',
|
||||
traction = 70,
|
||||
depth = 200,
|
||||
softness = 15,
|
||||
},
|
||||
[35] = {
|
||||
name = 'Tuff Sand',
|
||||
traction = 90,
|
||||
depth = 50,
|
||||
softness = 5,
|
||||
},
|
||||
[36] = {
|
||||
name = 'Dirt',
|
||||
traction = 70,
|
||||
depth = 300,
|
||||
softness = 40,
|
||||
},
|
||||
[37] = {
|
||||
name = 'Deep road sand',
|
||||
traction = 60,
|
||||
depth = 75,
|
||||
softness = 15,
|
||||
},
|
||||
[38] = {
|
||||
name = 'Rocky sand',
|
||||
traction = 70,
|
||||
depth = 150,
|
||||
softness = 10,
|
||||
},
|
||||
[40] = {
|
||||
name = 'Moist dirt path',
|
||||
traction = 60,
|
||||
depth = 150,
|
||||
softness = 50,
|
||||
},
|
||||
[41] = {
|
||||
name = 'Swamp grass',
|
||||
traction = 50,
|
||||
depth = 250,
|
||||
softness = 50,
|
||||
},
|
||||
[42] = {
|
||||
name = 'Swamp sand',
|
||||
traction = 70,
|
||||
depth = 500,
|
||||
softness = 110,
|
||||
},
|
||||
[43] = {
|
||||
name = 'Hard Sand',
|
||||
traction = 75,
|
||||
depth = 50,
|
||||
softness = 10,
|
||||
},
|
||||
[44] = {
|
||||
name = 'Dirt/Sand',
|
||||
traction = 50,
|
||||
depth = 200,
|
||||
softness = 25,
|
||||
},
|
||||
[46] = {
|
||||
name = 'Hard grass',
|
||||
traction = 80,
|
||||
depth = 50,
|
||||
softness = 5,
|
||||
},
|
||||
[47] = {
|
||||
name = 'Grass',
|
||||
traction = 65,
|
||||
depth = 125,
|
||||
softness = 10,
|
||||
},
|
||||
[48] = {
|
||||
name = 'Tall grass',
|
||||
traction = 60,
|
||||
depth = 150,
|
||||
softness = 20,
|
||||
},
|
||||
[49] = {
|
||||
name = 'Farmland',
|
||||
traction = 60,
|
||||
depth = 200,
|
||||
softness = 35,
|
||||
},
|
||||
[50] = {
|
||||
name = 'Podzol',
|
||||
traction = 70,
|
||||
depth = 125,
|
||||
softness = 25,
|
||||
},
|
||||
[51] = {
|
||||
name = 'Podzol',
|
||||
traction = 70,
|
||||
depth = 125,
|
||||
softness = 25,
|
||||
},
|
||||
[52] = {
|
||||
name = 'Dry podzol',
|
||||
traction = 80,
|
||||
depth = 75,
|
||||
softness = 10,
|
||||
},
|
||||
[64] = {
|
||||
name = 'Metal',
|
||||
traction = 90,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
[125] = {
|
||||
name = 'Drain concrete',
|
||||
traction = 70,
|
||||
depth = 0,
|
||||
softness = 0,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
-- Zone multiplier
|
||||
-- This has been added to modify the maximum depth of all surfaces located within zones.
|
||||
-- Its used to make grass located (for example) in the city less deep to make it more realistic and easier to drive on.
|
||||
-- If you have popular areas in your city in which you want the off-roading (think of road medians etc.) to be easier you can add the zone here.
|
||||
-- Same goes for areas which you want to be more difficult. You can make the depth multiplier higher for those
|
||||
|
||||
-- You can view the zone you're in by using the debug command /surfaceDebug
|
||||
|
||||
-- Map of zones: https://www.reddit.com/media?url=https%3A%2F%2Fi.redd.it%2F5cw11krz9kcz.jpg
|
||||
-- Zone names and hashes: https://docs.fivem.net/natives/?_0xCD90657D4C30E1CA
|
||||
|
||||
Config.zones = {
|
||||
{
|
||||
name = 'City',
|
||||
depthMultiplier = 0.3,
|
||||
tractionMultiplier = 0.6,
|
||||
zones = {
|
||||
'MOVIE',
|
||||
'ROCKF',
|
||||
'DOWNT',
|
||||
'DTVINE',
|
||||
'EAST_V',
|
||||
'GOLF',
|
||||
'LEGSQU',
|
||||
'ROCKF',
|
||||
'MORN',
|
||||
'STAD',
|
||||
'DAVIS',
|
||||
'RANCHO',
|
||||
'STRAW',
|
||||
'CHAMH',
|
||||
'PBOX',
|
||||
'SKID',
|
||||
'TEXTI',
|
||||
'LMESA',
|
||||
'ELYSIAN',
|
||||
'TERMINA',
|
||||
'HAWICK',
|
||||
'ALTA',
|
||||
'BURTON',
|
||||
'DELPE',
|
||||
},
|
||||
},
|
||||
{
|
||||
name = 'City beaches',
|
||||
depthMultiplier = 0.75,
|
||||
tractionMultiplier = 0.75,
|
||||
zones = {
|
||||
'BEACH',
|
||||
'DELBE',
|
||||
},
|
||||
},
|
||||
{
|
||||
name = 'Mountains',
|
||||
depthMultiplier = 1.25,
|
||||
tractionMultiplier = 1.1,
|
||||
zones = {
|
||||
'MTCHIL',
|
||||
'MTGORDO',
|
||||
'MTJOSE',
|
||||
'PALHIGH',
|
||||
},
|
||||
},
|
||||
{
|
||||
name = 'Zancudo Swamp',
|
||||
depthMultiplier = 1.1,
|
||||
tractionMultiplier = 1.1,
|
||||
zones = {
|
||||
'LAGO',
|
||||
'ZANCUDO',
|
||||
},
|
||||
},
|
||||
{
|
||||
name = 'Popular',
|
||||
depthMultiplier = 0.75,
|
||||
tractionMultiplier = 0.75,
|
||||
zones = {
|
||||
'PALETO',
|
||||
'HARMO',
|
||||
'GRAPES',
|
||||
'SANDY',
|
||||
'RTRAK',
|
||||
'ZQ_UAR',
|
||||
'HUMLAB',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
-- (Advanced)
|
||||
-- When making the vehicles sink the suspension does not always get updated properly.
|
||||
-- Therefore I had to add a system which updates/refreshes the vehicles suspension.
|
||||
-- There are two systems "force" and "flag". "force" is an old system which applies tiny amounts of visual damage to the car
|
||||
-- Unfortunately this sometimes appears to be too much for certain modded vehicles with very soft shells.
|
||||
-- The new system "flag" seems to work much better but hasn't been tested with some vehicles.
|
||||
-- If you encounter any issues with this system, please let us know on our discord <3
|
||||
Config.suspensionRefresh = {
|
||||
enabled = true,
|
||||
type = 'flag',
|
||||
}
|
39
resources/[carscripts]/kq_realoffroad/fxmanifest.lua
Normal file
39
resources/[carscripts]/kq_realoffroad/fxmanifest.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
fx_version 'cerulean'
|
||||
games { 'gta5' }
|
||||
lua54 'yes'
|
||||
|
||||
author 'KuzQuality | Kuzkay'
|
||||
description 'Realistic offroad physics by KuzQuality'
|
||||
version '1.8.0'
|
||||
|
||||
|
||||
--
|
||||
-- Server
|
||||
--
|
||||
|
||||
server_scripts {
|
||||
'mixed/constants.lua',
|
||||
'config.lua',
|
||||
'server/server.lua',
|
||||
}
|
||||
|
||||
--
|
||||
-- Client
|
||||
--
|
||||
|
||||
client_scripts {
|
||||
'mixed/constants.lua',
|
||||
'config.lua',
|
||||
'client/cache.lua',
|
||||
'client/editable/editable.lua',
|
||||
'client/functions.lua',
|
||||
'client/client.lua',
|
||||
'client/handling.lua',
|
||||
}
|
||||
|
||||
escrow_ignore {
|
||||
'config.lua',
|
||||
'client/editable/*.lua',
|
||||
}
|
||||
|
||||
dependency '/assetpacks'
|
BIN
resources/[carscripts]/kq_realoffroad/mixed/constants.lua
Normal file
BIN
resources/[carscripts]/kq_realoffroad/mixed/constants.lua
Normal file
Binary file not shown.
BIN
resources/[carscripts]/kq_realoffroad/server/server.lua
Normal file
BIN
resources/[carscripts]/kq_realoffroad/server/server.lua
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue