FiveM 载具限速脚本 / Vehicle Speed Limiter Script
大家好!
Hi everyone!
这是一个轻量级的 FiveM 客户端载具限速插件,能够根据车辆是否安装 Turbo 改装(Mod 18) 来自动调整最大速度。
This is a lightweight FiveM client-side vehicle speed limiter script, which automatically adjusts the vehicle’s top speed based on whether Turbo modification (Mod 18) is installed.
功能介绍 / Features
根据是否安装 Turbo 改装,动态调整最大速度
Dynamically adjusts top speed based on Turbo mod installation为不同车辆单独设置基础速度和 Turbo 速度
Per-vehicle configuration for base and turbo speeds纯客户端运行,性能开销小,无额外依赖
Runs fully client-side, low overhead, no external dependencies适合 RP 服务器或赛道服务器
Ideal for RP or racing servers
脚本代码 / Script Code
local vehicleSpeeds = {
[GetHashKey('t20')] = { baseSpeed = 200.0, turboSpeed = 260.0 },
}
Citizen.CreateThread(function()
while true do
Citizen.Wait(500)
local player = PlayerPedId()
local vehicle = GetVehiclePedIsIn(player, false)
if vehicle and DoesEntityExist(vehicle) then
local modelHash = GetEntityModel(vehicle)
local config = vehicleSpeeds[modelHash]
if config then
local turboInstalled = IsToggleModOn(vehicle, 18)
local speed = turboInstalled and config.turboSpeed or config.baseSpeed
local speedInMetersPerSecond = speed / 3.6
SetVehicleMaxSpeed(vehicle, speedInMetersPerSecond)
end
end
end
end)
预览截图 / Preview Screenshot
下载地址 / Download
GitHub 源码与下载 / GitHub Source & Download:
https://github.com/Ykoujuse/rs_speed/tree/main
联系我 / Contact Me
有问题或需要帮助?欢迎联系我:
Got questions or need help? Feel free to contact me:
QQ:3391407547
Discord:
.rsheng_
支持一下 / Support Me
如果你觉得这个脚本对你有用,欢迎点赞或评论支持!
If you find this script useful, a like or comment would be greatly appreciated!