[Standalone] RS vehiclelimit


:red_car: 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.


:star2: 功能介绍 / Features

  • :white_check_mark: 根据是否安装 Turbo 改装,动态调整最大速度
    Dynamically adjusts top speed based on Turbo mod installation
  • :white_check_mark: 为不同车辆单独设置基础速度和 Turbo 速度
    Per-vehicle configuration for base and turbo speeds
  • :white_check_mark: 纯客户端运行,性能开销小,无额外依赖
    Runs fully client-side, low overhead, no external dependencies
  • :white_check_mark: 适合 RP 服务器或赛道服务器
    Ideal for RP or racing servers

:jigsaw: 脚本代码 / 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)

:camera_flash: 预览截图 / Preview Screenshot


:package: 下载地址 / Download

:inbox_tray: GitHub 源码与下载 / GitHub Source & Download:
:point_right: https://github.com/Ykoujuse/rs_speed/tree/main


:mailbox_with_mail: 联系我 / Contact Me

有问题或需要帮助?欢迎联系我:
Got questions or need help? Feel free to contact me:

  • :speech_balloon: QQ:3391407547
  • :speech_balloon: Discord:.rsheng_

:heart: 支持一下 / Support Me

如果你觉得这个脚本对你有用,欢迎点赞或评论支持!
If you find this script useful, a like or comment would be greatly appreciated!


4 Likes

垃圾东西 呸