|
正在测试呵呵:
【------------------------------------------
function CheckSelectUnit takes nothing
local integer i
local integer numplayer
local unit unitcheck
local boolean rcheck
local group groupcheck
set groupcheck = CreateGroup()
set numplayer = GetPlayers() //获得玩家数量
set i = 0
loop //循环检测每个玩家目前选中单位是否可见start
exitwhen i>numplayer
call GroupEnumUnitsSelected(groupcheck,Player(i),null)
call CountUnitsInGroupEnum()
if bj_groupCountUnits==1 then //若玩家所选单位数量为1则检测
set unitcheck = GroupPickRandomUnit(groupcheck)
set rcheck = IsUnitVisible(unitcheck,Player(i))
if rcheck == false then //若单位对玩家不可见
call DisplayTextToPlayer(Player(i),0,0, "selected invisible Unit" ) //显示作弊-
endif
endif
set i = i + 1
endloop //循环检测END
set unitcheck = null //清除变量
set groupcheck = null
endfunction
---------------------------------】
1 |
|