syrianwarfare吧 关注:1,211贴子:7,486
  • 2回复贴,共1

关于cheat codes的三种实现方式

取消只看楼主收藏回复

研究utils.lua参数,发现控制台有三种作弊代码可用于调出单位。
第一种:在(10,10)的坐标处,生成自定义数量的单位(坦克、直升机、车辆、步兵)
-- First:------------------------------------------------------------------------------
help = function()
console.log(" - cheats.giveT90(num)")
console.log(" - Spawns lates versions of T90 tanks at 10, 10")
console.log(" - num - How many T90 to spawn")
end
cheats = {
giveT90 = function(num)
local dist = 5
local x = 10 - dist
local y = 10 - dist
if ((num == nil) or (num < 1)) then
num = 1
end
for count = 1, num, 1 do
local xx = x + count * dist
local yy = y + count * dist
local zz = game.getLandHeight(xx, yy)
game.selectEntity(game.spawnTank("tank_t90", xx, yy, zz, 0, "usa"))
end
console.log("CHEATS >> Spawned ", num, " T90")
end,
giveMi28 = function(num)
local dist = 5
local x = 10 - dist
local y = 10 - dist
if ((num == nil) or (num < 1)) then
num = 1
end
for count = 1, num, 1 do
local xx = x + count * dist
local yy = y + count * dist
local zz = game.getLandHeight(xx, yy)
game.selectEntity(game.spawnHeli("new_vertolet_mi28", xx, yy, zz, 0, "usa"))
end
console.log("CHEATS >> Spawned ", num, " Mi28")
end,
giveBTR80A = function(num)
local dist = 5
local x = 10 - dist
local y = 10 - dist
if ((num == nil) or (num < 1)) then
num = 1
end
for count = 1, num, 1 do
local xx = x + count * dist
local yy = y + count * dist
local zz = game.getLandHeight(xx, yy)
game.selectEntity(game.spawnCar("car_btr80_gun", xx, yy, zz, 0, "usa"))
end
console.log("CHEATS >> Spawned ", num, " BTR80A")
end,
giveVDV = function(num)
local dist = 5
local x = 10 - dist
local y = 10 - dist
if ((num == nil) or (num < 1)) then
num = 1
end
for count = 1, num, 1 do
local xx = x + count * dist
local yy = y + count * dist
local zz = game.getLandHeight(xx, yy)
game.selectEntity(game.spawnSquad("rus_vdv", xx, yy, zz, 0, "usa"))
end
console.log("CHEATS >> Spawned ", num, " VDV")
end,
}
-- end ------------------------------------------------------------------------------


IP属地:湖北1楼2024-04-13 09:26回复
    第二种:在自定义的坐标处,生成一个单位(坦克、直升机、车辆、步兵)
    -- Second:--------------------------------------------------------------------------
    help = function()
    console.log(" - cheats.giveUnit(X, Y) - Spawn a Unit at X, Y")
    end
    cheats = {
    giveT90 = function(xx, yy)
    game.selectEntity(game.spawnTank("tank_t90", xx, yy, game.getLandHeight(xx, yy), 0, "usa"))
    end,
    giveMi28 = function(xx, yy)
    game.selectEntity(game.spawnHeli("new_vertolet_mi28", xx, yy, game.getLandHeight(xx, yy), 0, "usa"))
    end,
    giveBTR80A = function(xx, yy)
    game.selectEntity(game.spawnCar("car_btr80_gun", xx, yy, game.getLandHeight(xx, yy), 0, "usa"))
    end,
    giveBTR80A = function(xx, yy)
    game.selectEntity(game.spawnCar("car_btr80_gun", xx, yy, game.getLandHeight(xx, yy), 0, "usa"))
    end,
    giveVDV = function(xx, yy)
    game.selectEntity(game.spawnSquad("rus_vdv", xx, yy, game.getLandHeight(xx, yy), 0, "usa"))
    end,
    }
    -- end ------------------------------------------------------------------------------


    IP属地:湖北2楼2024-04-13 09:27
    回复
      2025-10-16 02:29:39
      广告
      不感兴趣
      开通SVIP免广告
      第三种:在自定义的坐标处,生成自定义数量的单位(坦克、直升机、车辆、步兵)
      -- Third:-----------------------------------------------------------------------------
      help = function()
      console.log(" - cheats.giveUnit (num, x, y) - Spawn num Unit at X, Y")
      end
      cheats = {
      giveT90 = function(num,locl1,locl2)
      local dist = 5
      local x = locl1 - dist
      local y = locl2 - dist
      if ((num == nil) or (num < 1)) then
      num = 1
      end
      for count = 1, num, 1 do
      local xx = x + count * dist
      local yy = y + count * dist
      local zz = game.getLandHeight(xx, yy)
      game.selectEntity(game.spawnTank("tank_t90", xx, yy, zz, 0, "usa"))
      end
      console.log("CHEATS >> Spawned", num, "T90")
      end,
      giveMi28 = function(num,locl1,locl2)
      local dist = 5
      local x = locl1 - dist
      local y = locl2 - dist
      if ((num == nil) or (num < 1)) then
      num = 1
      end
      for count = 1, num, 1 do
      local xx = x + count * dist
      local yy = y + count * dist
      local zz = game.getLandHeight(xx, yy)
      game.selectEntity(game.spawnHeli("new_vertolet_mi28", xx, yy, zz, 0, "usa"))
      end
      console.log("CHEATS >> Spawned", num, "Mi28")
      end,
      giveBTR80A = function(num,locl1,locl2)
      local dist = 5
      local x = locl1 - dist
      local y = locl2 - dist
      if ((num == nil) or (num < 1)) then
      num = 1
      end
      for count = 1, num, 1 do
      local xx = x + count * dist
      local yy = y + count * dist
      local zz = game.getLandHeight(xx, yy)
      game.selectEntity(game.spawnCar("car_btr80_gun", xx, yy, zz, 0, "usa"))
      end
      console.log("CHEATS >> Spawned", num, "BTR80A")
      end,
      giveVDV = function(num,locl1,locl2)
      local dist = 5
      local x = locl1 - dist
      local y = locl2 - dist
      if ((num == nil) or (num < 1)) then
      num = 1
      end
      for count = 1, num, 1 do
      local xx = x + count * dist
      local yy = y + count * dist
      local zz = game.getLandHeight(xx, yy)
      game.selectEntity(game.spawnSquad("rus_vdv", xx, yy, zz, 0, "usa"))
      end
      console.log("CHEATS >> Spawned", num, "VDV")
      end,
      }
      -- end ------------------------------------------------------------------------------


      IP属地:湖北3楼2024-04-13 09:27
      回复