[Jass] Anti Maphack System

Post Reply
User avatar
Site Admin
Site Admin
Posts: 202
Joined: Sat Sep 15, 2018 1:57 pm
Location: Florida, U.S.A.
Website: http://chaosrealm.co/memberlist.php?mod ... rofile&u=2
Discord: https://discord.gg/BUEZkef
Twitch: https://www.twitch.tv/enalias
Contact:

[Jass] Anti Maphack System

#1

Post by Enalias »

Nothing special just a general anti maphack system.
This system will work when you click a unit in fog, black mask or click invisible unit.

How to use
just copy MHChecker Trigger to your map and create variable name "HS" type Hashtable

Code:
Spoiler
Show
[jass]function MHChecker_Periodic takes nothing returns nothing
local integer i = 0
local timer z = GetExpiredTimer()
local player p = LoadPlayerHandle(udg_HS,GetHandleId(z),0)
loop
exitwhen i > 11
call DisplayTimedTextToPlayer(Player(i),0,0,5,"|cffffcc00Player |r" + GetPlayerName(p)+"|r|cffffcc00 have been kick because of using maphack|r")
set i = i + 1
endloop
if GetLocalPlayer() == p then
call EndGame(false)
endif
call DestroyTimer(z)
call FlushChildHashtable(udg_HS,GetHandleId(z))
set z = null
set p = null
endfunction

function MHChecker_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local unit c = GetTriggerUnit()
local integer ip = GetPlayerId(p)
local timer z
local real r = GetRandomReal(3,6)
if GetRandomInt(1,100) <= 50 then
if GetTriggerEventId()== EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER then
set c = GetOrderTargetUnit()
set p = GetOwningPlayer(GetTriggerUnit())
endif
if not IsUnitOwnedByPlayer(c,p) then
if IsUnitFogged(c,p) or IsUnitMasked(c,p) or IsUnitInvisible(c,p) then
set z = CreateTimer()
call SavePlayerHandle(udg_HS,GetHandleId(z),0,p)
call TimerStart(z,r,false,function MHChecker_Periodic)
endif
endif
endif
set p = null
set c = null
set z = null
endfunction

function InitTrig_MHChecker takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i
set udg_HS = InitHashtable()
loop
exitwhen i > 11
call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SELECTED,null)
call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null)
set i = i + 1
endloop
call TriggerAddAction(t,function MHChecker_Actions)
set t = null
endfunction[/jass]
Credits: nookaiser
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Systems”