-- добавляем новые машины
function AddNewCars(_ARG_0_)
  game.garage:CheatAddCar('Cossack_Cavallo', true)
  game.garage:CheatAddCar('Smith_Thunderbolt', true)
  game.garage:CheatAddCar('Chaffeque_X30', true)
  game.garage:CheatAddCar('Walter_Coupe', true)
  game.garage:CheatAddCar('Shubert_38_2', true)
  game.garage:CheatAddCar('BoltAce_Cabriolet', true)
end

-- устанавливаем отношения между группами AI
function SetAIRelationships(_ARG_0_)
  ai.relationships:SetRelationship(enums.AI_SIDE.PLAYER, enums.AI_TYPE.FRIEND, enums.AI_SIDE.GANG, enums.AI_TYPE.CLEMENTE, 10)
  ai.relationships:SetRelationship(enums.AI_SIDE.GANG, enums.AI_TYPE.CLEMENTE, enums.AI_SIDE.PLAYER, enums.AI_TYPE.FRIEND, 10)
end

-- создаем действия для персонажей
function CreateActions(_ARG_0_)
  joe:RegisterToMessages(guid)
  Math:newVector():set(0, 0, 0)
  actionJoe = game.game:CreateScriptActorAction(joe, Math:newVector(), 1.5, 'StartJoe', '0050000023')
  henry:RegisterToMessages(guid)
  Math:newVector():set(0, 0, 0)
  actionHenry = game.game:CreateScriptActorAction(henry, Math:newVector(), 1.5, 'StartHenry', '0050000023')
end

-- функция для начала действия Джо
function StartJoe(_ARG_0_)
  id = CommandBuffer:Insert(_ARG_0_, {
    function(_ARG_0_)
      game.game:ChangePlayerModel('VITTUX', -1)
    end,
    function(_ARG_0_)
      _ARG_0_.friendlyDoorCfg:AddWingman(joe:GetGuid())
      soJde = joe:Follow(game.game:GetActivePlayer(), 'RUN', 2, 3.5, true)
      game.game:GetActivePlayer():RegisterFollower(joe)
      return game.delayed:CreateDelayedSynchroObject(100)
    end,
    function(_ARG_0_)
      actionJoe:SetEventName('StopJoe')
      actionJoe:SetTextId('0050000024')
    end
  })
end

-- функция для окончания действия Джо
function StopJoe(_ARG_0_)
  id = CommandBuffer:Insert(_ARG_0_, {
    function(_ARG_0_)
      game.game:ChangePlayerModel('VITPRA', -1)
    end,
    function(_ARG_0_)
      _ARG_0_.friendlyDoorCfg:RemoveWingman(joe:GetGuid())
      if soJde ~= nil then
        soJde:UserData():Terminate()
      end
      player:UnregisterFollower(joe)
      return game.delayed:CreateDelayedSynchroObject(100)
    end,
    function(_ARG_0_)
      actionJoe:SetEventName('StartJoe')
      actionJoe:SetTextId('0050000023')
    end
  })
end

-- функция для начала действия Генри
function StartHenry(_ARG_0_)
  id = CommandBuffer:Insert(_ARG_0_, {
    function(_ARG_0_)
      game.game:ChangePlayerModel('VITSUIT', -1)
    end,
    function(_ARG_0_)
      _ARG_0_.friendlyDoorCfg:AddWingman(henry:GetGuid())
      soHenry = henry:Follow(game.game:GetActivePlayer(), 'RUN', 3.5, 5, true)
      game.game:GetActivePlayer():RegisterFollower(henry)
      return game.delayed:CreateDelayedSynchroObject(100)
    end,
    function(_ARG_0_)
      actionHenry:SetEventName('StopHenry')
      actionHenry:SetTextId('0050000024')
    end
  })
end

-- функция для окончания действия Генри
function StopHenry(_ARG_0_)
  id = CommandBuffer:Insert(_ARG_0_, {
    function(_ARG_0_)
      game.game:ChangePlayerModel('VITPRA', -1)
    end,
    function(_ARG_0_)
      _ARG_0_.friendlyDoorCfg:RemoveWingman(henry:GetGuid())
      if soHenry ~= nil then
        soHenry:UserData():Terminate()
      end
      player:UnregisterFollower(henry)
      return game.delayed:CreateDelayedSynchroObject(100)
    end,
    function(_ARG_0_)
      actionHenry:SetEventName('StartHenry')
      actionHenry:SetTextId('0050000023')
    end
  })
end

-- ... (остальной код скрипта)
Mafia 2 FreeRide Lua скрипт: расширенные возможности и полный код

原文地址: https://www.cveoy.top/t/topic/nKeh 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录