GTA5 FiveMに無料で導入可能なAI Policeになります。
[FREE] [QBCore] AI Police – FiveM Releases – Cfx.re Community
導入手順は以下の通り。
※2024/4時点の情報、Linuxのサーバに導入
- ダウンロードしたファイルを解凍してできた「sd-aipolice」フォルダを「resources」Dirへ入れる
- 「resource/[qb]/qb-smallresources」Dir内にあるconfig.luaを開き、編集する
編集箇所①(220行目あたり):->すべて「true」を「false」に変更
編集前:
Config.BlacklistedPeds = {
[s_m_y_ranger_01
] = true,
[s_m_y_sheriff_01
] = true,
[s_m_y_cop_01
] = true,
[s_f_y_sheriff_01
] = true,
[s_f_y_cop_01
] = true,
[s_m_y_hwaycop_01
] = ture,
}
編集後:
Config.BlacklistedPeds = {
[s_m_y_ranger_01
] = false,
[s_m_y_sheriff_01
] = false,
[s_m_y_cop_01
] = false,
[s_f_y_sheriff_01
] = false,
[s_f_y_cop_01
] = false,
[s_m_y_hwaycop_01
] = false,
}
編集箇所②(82行目あたり):hudComponentsにある「1,」を削除する
編集前:
Config.Disable = {
hudComponents = { 1, 2, 3, 4, 7, 9, 13, 14, 19, 20, 21, 22 }, — Hud Components: https://docs.fivem.net/natives/?_0x6806C51AD12B83B8
編集後:
Config.Disable = {
hudComponents = { 2, 3, 4, 7, 9, 13, 14, 19, 20, 21, 22 }, — Hud Components: https://docs.fivem.net/natives/?_0x6806C51AD12B83B8 - 「qb-smallresources/client」Dirにあるignore.luaを開き、編集する
変種箇所①(59行目あたり):(コメントアウトをする)
編集前:
CreateThread(function()
for i = 1, 15 do
local toggle = Config.AIResponse.dispatchServices[i]
EnableDispatchService(i, toggle)
end
local wantedLevel = Config.AIResponse.wantedLevels and 5 or 0
SetMaxWantedLevel(wantedLevel)
end)
編集後:
— CreateThread(function()
— for i = 1, 15 do
— local toggle = Config.AIResponse.dispatchServices[i]
— EnableDispatchService(i, toggle)
— end
— local wantedLevel = Config.AIResponse.wantedLevels and 5 or 0
— SetMaxWantedLevel(wantedLevel)
— end)
編集箇所②:(「setAudioFlag~」から「REMOVE CHOPPERS WOW
end)」までコメントアウト)
編集前:
CreateThread(function() — all these should only need to be called once
if Config.Disable.ambience then
StartAudioScene(‘CHARACTER_CHANGE_IN_SKY_SCENE’)
SetAudioFlag(‘DisableFlightMusic’, true)
endSetAudioFlag('PoliceScannerDisabled', true)
SetGarbageTrucks(false)
SetCreateRandomCops(false)
SetCreateRandomCopsNotOnScenarios(false)
SetCreateRandomCopsOnScenarios(false)
DistantCopCarSirens(false)
RemoveVehiclesFromGeneratorsInArea(335.2616 - 300.0, -1432.455 - 300.0, 46.51 - 300.0, 335.2616 + 300.0, -1432.455 + 300.0, 46.51 + 300.0) -- central los santos medical center
RemoveVehiclesFromGeneratorsInArea(441.8465 - 500.0, -987.99 - 500.0, 30.68 - 500.0, 441.8465 + 500.0, -987.99 + 500.0, 30.68 + 500.0) -- police station mission row
RemoveVehiclesFromGeneratorsInArea(316.79 - 300.0, -592.36 - 300.0, 43.28 - 300.0, 316.79 + 300.0, -592.36 + 300.0, 43.28 + 300.0) -- pillbox
RemoveVehiclesFromGeneratorsInArea(-2150.44 - 500.0, 3075.99 - 500.0, 32.8 - 500.0, -2150.44 + 500.0, -3075.99 + 500.0, 32.8 + 500.0) -- military
RemoveVehiclesFromGeneratorsInArea(-1108.35 - 300.0, 4920.64 - 300.0, 217.2 - 300.0, -1108.35 + 300.0, 4920.64 + 300.0, 217.2 + 300.0) -- nudist
RemoveVehiclesFromGeneratorsInArea(-458.24 - 300.0, 6019.81 - 300.0, 31.34 - 300.0, -458.24 + 300.0, 6019.81 + 300.0, 31.34 + 300.0) -- police station paleto
RemoveVehiclesFromGeneratorsInArea(1854.82 - 300.0, 3679.4 - 300.0, 33.82 - 300.0, 1854.82 + 300.0, 3679.4 + 300.0, 33.82 + 300.0) -- police station sandy
RemoveVehiclesFromGeneratorsInArea(-724.46 - 300.0, -1444.03 - 300.0, 5.0 - 300.0, -724.46 + 300.0, -1444.03 + 300.0, 5.0 + 300.0) -- REMOVE CHOPPERS WOW
end)
編集後:
CreateThread(function() — all these should only need to be called once
if Config.Disable.ambience then
StartAudioScene(‘CHARACTER_CHANGE_IN_SKY_SCENE’)
SetAudioFlag(‘DisableFlightMusic’, true)
end--SetAudioFlag('PoliceScannerDisabled', true)
--SetGarbageTrucks(false)
--SetCreateRandomCops(false)
--SetCreateRandomCopsNotOnScenarios(false)
--SetCreateRandomCopsOnScenarios(false)
--DistantCopCarSirens(false)
--RemoveVehiclesFromGeneratorsInArea(335.2616 - 300.0, -1432.455 - 300.0, 46.51 - 300.0, 335.2616 + 300.0, -1432.455 + 300.0, 46.51 + 300.0) -- central los santos medical center
--RemoveVehiclesFromGeneratorsInArea(441.8465 - 500.0, -987.99 - 500.0, 30.68 - 500.0, 441.8465 + 500.0, -987.99 + 500.0, 30.68 + 500.0) -- police station mission row
--RemoveVehiclesFromGeneratorsInArea(316.79 - 300.0, -592.36 - 300.0, 43.28 - 300.0, 316.79 + 300.0, -592.36 + 300.0, 43.28 + 300.0) -- pillbox
--RemoveVehiclesFromGeneratorsInArea(-2150.44 - 500.0, 3075.99 - 500.0, 32.8 - 500.0, -2150.44 + 500.0, -3075.99 + 500.0, 32.8 + 500.0) -- military
--RemoveVehiclesFromGeneratorsInArea(-1108.35 - 300.0, 4920.64 - 300.0, 217.2 - 300.0, -1108.35 + 300.0, 4920.64 + 300.0, 217.2 + 300.0) -- nudist
--RemoveVehiclesFromGeneratorsInArea(-458.24 - 300.0, 6019.81 - 300.0, 31.34 - 300.0, -458.24 + 300.0, 6019.81 + 300.0, 31.34 + 300.0) -- police station paleto
--RemoveVehiclesFromGeneratorsInArea(1854.82 - 300.0, 3679.4 - 300.0, 33.82 - 300.0, 1854.82 + 300.0, 3679.4 + 300.0, 33.82 + 300.0) -- police station sandy
--RemoveVehiclesFromGeneratorsInArea(-724.46 - 300.0, -1444.03 - 300.0, 5.0 - 300.0, -724.46 + 300.0, -1444.03 + 300.0, 5.0 + 300.0) -- REMOVE CHOPPERS WOW
end) - 「qb-smallresources/client」Dirにあるhudcomponents.luaを開き、編集する
編集箇所①:(先頭箇所へ追記)
追記内容:
local copsOnline = false
RegisterNetEvent(‘qb-smallresources:client:CopsOnline’, function()
copsOnline = true
end)
RegisterNetEvent(‘qb-smallresources:client:CopsOffline’, function()
copsOnline = false
end)
編集箇所②(31行目あたり):(「CreateThread(function()」箇所の先頭へ追記)
編集前:
CreateThread(function()
while true dofor i = 1, #disableHudComponents do
HideHudComponentThisFrame(disableHudComponents[i])
end
編集後:
CreateThread(function()
while true doif copsOnline then
HideHudComponentThisFrame(1) -- 1 : WANTED_STARS
end
for i = 1, #disableHudComponents do
HideHudComponentThisFrame(disableHudComponents[i])
end
これで警察役がいなくてもNPCの警察がやってくるようになります。