研究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 ------------------------------------------------------------------------------
第一种:在(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 ------------------------------------------------------------------------------