-- 基于 es_carwash 由 'EssentialMode 5 CarWash by TheSpartaPT.' --
-- Calm Productions 对其进行了稍微修改
-- 建议您不要编辑此行以下内容 --
Key = 201 -- ENTER(回车键)
vehicleAutoBodyStation = {
-- {-327.0, -144.6, 38.3}, -- LSC Burton 车身喷漆帐篷
{1139.55, -864.30, 52.77}, -- LSC La Mesa 车身喷漆帐篷
-- {481.7, -1317.4, 28.5}, -- Hayes 车身维修店, Little Bighorn Ave.
-- {288.2, -1729.5, 28.5}, -- Hayes 车身维修店, Rancho
-- {-24.6, -1678.2, 29.0}, -- Mosley 车身维修服务, Strawberry
-- {-199.0, -1382.0, 30.5}, -- Glass Heroes, Strawberry
-- {-1166.7, -2013.0, 12.5}, -- LSC 机场附近的车身喷漆帐篷
-- {-440.0, -2177.5, 10.0}, -- Otto's Auto Body, LSI Elysin Island
-- {-1409.0, -459.1, 33.8}, -- Hayes 车身维修店, Del Perro
-- {103.6, 6622.5, 31.1}, -- LSC Paleto Bay 车身喷漆帐篷
-- {1914.0, 3729.0, 32.0}, -- Otto's Auto Body, Sandy Shores
-- {1182.7, 2638.4, 37.0} -- 68 Harmony 车身喷漆帐篷
}
Citizen.CreateThread(function ()
Citizen.Wait(0)
for i = 1, #vehicleAutoBodyStation do
garageCoords = vehicleAutoBodyStation
stationBlip = AddBlipForCoord(garageCoords, garageCoords, garageCoords)
SetBlipSprite(stationBlip, 72) -- 72 radar_car_mod_shop(雷达车修改商店)
SetBlipColour(stationBlip, 3) -- 0 白色, 1 红色, 2 绿色, 3 蓝色等
SetBlipAsShortRange(stationBlip, true)
SetBlipDisplay(stationBlip, 2) -- 0 从不显示
-- 1 从不在任何地方显示
-- 2 在主地图和小地图上显示
-- 3&4 仅在主地图上
-- 5 仅在小地图上显示
-- 6 同时显示在两者上
-- 7 不显示
-- 8 两者都不可选择
-- 9 仅小地图上
-- 10 两者都不可选择
-- Rockstar 似乎只在反编译的脚本中使用 0, 2, 3, 4, 5 和 8。
BeginTextCommandSetBlipName("STRING")
AddTextComponentString("车身修理店")
EndTextCommandSetBlipName(stationBlip)
end
return
end)
function cp_auto_body_DrawSubtitleTimed(m_text, showtime)
SetTextEntry_2('STRING')
AddTextComponentString(m_text)
DrawSubtitleTimed(showtime, 1) -- 显示时间
end
function cp_auto_body_DrawNotification(m_text)
SetNotificationTextEntry('STRING')
AddTextComponentString(m_text)
DrawNotification(true, false)
end
Citizen.CreateThread(function ()
while true do
Citizen.Wait(0)
if IsPedSittingInAnyVehicle(PlayerPedId()) then
for i = 1, #vehicleAutoBodyStation do
garageCoords2 = vehicleAutoBodyStation
if GetDistanceBetweenCoords(GetEntityCoords(PlayerPedId()), garageCoords2, garageCoords2, garageCoords2, true ) < 20 then
DrawMarker(1, garageCoords2, garageCoords2, garageCoords2, 0, 0, 0, 0, 0, 0, 5.0, 5.0, 2.0, 0, 0, 156, 155, 0, 0, 2, 0, 0, 0, 0)
if GetDistanceBetweenCoords(GetEntityCoords(PlayerPedId()), garageCoords2, garageCoords2, garageCoords2, true ) < 5 then
cp_auto_body_DrawSubtitleTimed("按 自动维修车身!")
if IsControlJustPressed(1, Key) then
TriggerServerEvent('cp_auto_body:checkmoney') -- 检查玩家是否有足够的金额
end
end
end
end
end
end
end)
RegisterNetEvent('cp_auto_body:success')
AddEventHandler('cp_auto_body:success', function (price)
player = PlayerPedId()
playerVehicle = GetVehiclePedIsUsing(player)
local GVEH = GetVehicleEngineHealth(playerVehicle)
SetVehicleBodyHealth(playerVehicle, 1000.0) -- 设置车身健康值
SetVehiclePetrolTankHealth(playerVehicle, 1000.0) -- 设置油箱健康值
-- SetVehicleWheelHealth(playerVehicle, 1000.0) -- 设置轮胎健康值(已注释)
-- SetVehicleUndriveable(playerVehicle, false) -- 设置车辆可驾驶状态(已注释)
-- SetVehicleEngineHealth(playerVehicle, 1000.0) -- 设置发动机健康值(已注释)
RemoveDecalsFromVehicle(playerVehicle) -- 移除车辆上的贴花
SetVehicleDeformationFixed(playerVehicle) -- 修复车辆变形
SetVehicleFixed(playerVehicle) -- 修复车辆
SetVehicleEngineHealth(playerVehicle, GVEH) -- 恢复发动机原有健康值
Citizen.Wait(1000)
cp_auto_body_DrawNotification("您的车辆车身已 ~y~修复~s~! ~g~-$" .. price .. "~s~!")
end)
RegisterNetEvent('cp_auto_body:notenoughmoney')
AddEventHandler('cp_auto_body:notenoughmoney', function (moneyleft)
cp_auto_body_DrawNotification("~h~~r~您没有足够的钱! $" .. moneyleft .. " 剩余未用!")
end)
RegisterNetEvent('cp_auto_body:free')
AddEventHandler('cp_auto_body:free', function ()
player = PlayerPedId()
playerVehicle = GetVehiclePedIsUsing(player)
local GVEH = GetVehicleEngineHealth(playerVehicle)
SetVehicleBodyHealth(playerVehicle, 1000.0) -- 设置车身健康值
SetVehiclePetrolTankHealth(playerVehicle, 1000.0) -- 设置油箱健康值
-- SetVehicleWheelHealth(playerVehicle, 1000.0) -- 设置轮胎健康值(已注释)
-- SetVehicleUndriveable(playerVehicle, false) -- 设置车辆可驾驶状态(已注释)
-- SetVehicleEngineHealth(playerVehicle, 1000.0) -- 设置发动机健康值(已注释)
RemoveDecalsFromVehicle(playerVehicle) -- 移除车辆上的贴花
SetVehicleDeformationFixed(playerVehicle) -- 修复车辆变形
SetVehicleFixed(playerVehicle) -- 修复车辆
SetVehicleEngineHealth(playerVehicle, GVEH) -- 恢复发动机原有健康值
Citizen.Wait(1000)
cp_auto_body_DrawNotification("您的车辆车身已 ~y~免费修复~s~!")
end)