判断玩家是否开全图挂

全图挂检测1.原理:出来就能看到敌对的快乐的小绵羊,故判定为开挂。

//全图挂检测.原理:出来就能看到敌对的快乐的小绵羊,故判定为开挂。
function jiaoyan_kaigua takes nothing returns nothing
	if not IsUnitInvisible(weiguo_kldxmy, Player(1)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 1 楼玩家( "+GetPlayerName (Player(1))+" )有开挂!!!|r"  )
	endif
	if not IsUnitInvisible(weiguo_kldxmy, Player(2)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 2 楼玩家( "+GetPlayerName(Player(2))+" )有开挂!!!|r"  )
	endif
	if not IsUnitInvisible(weiguo_kldxmy, Player(3)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 3 楼玩家( "+GetPlayerName(Player(3))+" )有开挂!!!|r"  )
	endif
	if not IsUnitInvisible(weiguo_kldxmy, Player(4)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 4 楼玩家( "+GetPlayerName(Player(4))+" )有开挂!!!|r"  )
	endif
	if not IsUnitInvisible(weiguo_kldxmy, Player(5)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 5 楼玩家( "+GetPlayerName(Player(5))+" )有开挂!!!|r"  )
	endif
	if not IsUnitInvisible(shuguo_kldxmy, Player(7)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 6 楼玩家( "+GetPlayerName(Player(7))+" )有开挂!!!|r"  )
	endif
	if not IsUnitInvisible(shuguo_kldxmy, Player(8)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 7 楼玩家( "+GetPlayerName(Player(8))+" )有开挂!!!|r"  )
	endif
	if not IsUnitInvisible(shuguo_kldxmy, Player(9)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 8 楼玩家( "+GetPlayerName(Player(9))+" )有开挂!!!|r"  )
	endif
	if not IsUnitInvisible(shuguo_kldxmy, Player(10)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 9 楼玩家( "+GetPlayerName(Player(10))+" )有开挂!!!|r"  )
	endif
	if not IsUnitInvisible(shuguo_kldxmy, Player(11)) then 
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到 10 楼玩家( "+GetPlayerName(Player(11))+" )有开挂!!!|r"  )
	endif
endfunction

全图挂检测2。原理:玩家选择了不可见的单位,故判断该玩家开挂了。

(我没有测试过,所以这种检测不确定是否有用。)

//全图挂检测1。原理:玩家选择了不可见的单位,故判断该玩家开挂了。(我没有测试过,所以这种检测不确定是否有用。)
//(因为是该玩家选中单位触发的事件后马上检测,故基本排除了选中单位后单位移动到不可见位置的情况。)
function Trig_jiaoyan_kaigua takes nothing returns nothing
	local player player_temp = null //触发的玩家
	local trigger trig = GetTriggeringTrigger() //触发的触发器
	local integer playerId = 0 //玩家索引,1楼是2 , 6楼是8 ,10楼是12
	local unit sel_unit = null //被选择的单位
	local integer i = 0
	loop
		set playerId = playerId + 1
		exitwhen trig == gg_jiaoyan_kaigua[playerId]  
	endloop
	set player_temp = Player(playerId-1)
	//call DisplayTimedTextToForce(GetPlayersAll(),5.00,  I2S(playerId) + "开始检测..." + I2S(GetUnitLevel ( GetHeroUnit(playerId)) ))
	if IsUnitSelected( GetHeroUnit(playerId),player_temp) then //选择自己的武将,则不用继续校验了。
		
	elseif playerId < 8 then //蜀国的玩家触发
		if IsUnitSelected( GetHeroUnit(8),player_temp) then 
			set sel_unit = GetHeroUnit(8)
		elseif IsUnitSelected( GetHeroUnit(9),player_temp) then 
			set sel_unit = GetHeroUnit(9)
		elseif IsUnitSelected( GetHeroUnit(10),player_temp) then 
			set sel_unit = GetHeroUnit(10)
		elseif IsUnitSelected( GetHeroUnit(11),player_temp) then 
			set sel_unit = GetHeroUnit(11)
		elseif IsUnitSelected( GetHeroUnit(12),player_temp) then 
			set sel_unit = GetHeroUnit(12)			
		endif
	elseif playerId >= 8 then //魏国的玩家触发
		if IsUnitSelected( GetHeroUnit(2),player_temp) then 
			set sel_unit = GetHeroUnit(2)
		elseif IsUnitSelected( GetHeroUnit(3),player_temp) then 
			set sel_unit = GetHeroUnit(3)
		elseif IsUnitSelected( GetHeroUnit(4),player_temp) then 
			set sel_unit = GetHeroUnit(4)
		elseif IsUnitSelected( GetHeroUnit(5),player_temp) then 
			set sel_unit = GetHeroUnit(5)
		elseif IsUnitSelected( GetHeroUnit(6),player_temp) then 
			set sel_unit = GetHeroUnit(6)			
		endif
	endif
	//sel_unit不为空则进一步检测
	if sel_unit != null and IsUnitInvisible(sel_unit, player_temp) then  //该单位如果对该玩家不可见,但他又选择了,故判断该玩家开挂了。
		call DisplayTimedTextToForce(GetPlayersAll(),10.00,  "|cFFFFFF00检测到玩家( "+GetPlayerName(player_temp)+" )有开挂!!!|r"  )
	else
		//call DisplayTimedTextToForce(GetPlayersAll(),5.00,  "没有检测玩家到开挂。"  )
	endif
	call DisableTrigger(GetTriggeringTrigger())  
endfunction
//玩家选择单位事件,通过 TriggerRegisterPlayerSelectionEventBJ 触发调用该函数
function playerSelectUnitTrigger_Action takes nothing returns nothing
	local player player_temp = GetTriggerPlayer() //触发的玩家
	local integer playerId = GetConvertedPlayerId(player_temp) //玩家索引,1楼是2 , 6楼是8 ,10楼是12
	if not(IsTriggerEnabled(gg_jiaoyan_kaigua[playerId])) then
		call EnableTrigger(gg_jiaoyan_kaigua[playerId])  
	endif
endfunction


初始化一些全家变量

//选择单位触发器
trigger gg_SelectUnitTrigger=null
//判断指定玩家是否开挂触发器
trigger array gg_jiaoyan_kaigua
//蜀国快乐的小绵羊
unit shuguo_kldxmy = null
//魏国快乐的小绵羊
unit weiguo_kldxmy = null

//初始化
function Trig_init_Actions takes nothing returns nothing
local integer i = 0
//全图挂检测1
call jiaoyan_kaigua()
//全图挂检测2
loop 
	set i = i + 1
	set gg_jiaoyan_kaigua[i] = CreateTrigger()
	call DisableTrigger(gg_jiaoyan_kaigua[i])  
	call TriggerRegisterTimerEventPeriodic(gg_jiaoyan_kaigua[i],0.05)  
	call TriggerAddAction(gg_jiaoyan_kaigua[i],function Trig_jiaoyan_kaigua)  
	exitwhen i >= 13
endloop
set gg_SelectUnitTrigger = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_SelectUnitTrigger,EVENT_PLAYER_UNIT_SELECTED)
call TriggerAddAction(gg_SelectUnitTrigger,function playerSelectUnitTrigger_Action)
endfunction


下载了一个全图挂测试了一下。检测技术2有效。但必须玩家点击对方不可见的武将时才能检测出来。

检测技术1无效,可能是外挂没有使用这么粗暴的方法,检测技术1应该是竞技平台会检测。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值