1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  5. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  11. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

SpeedHackDetection v1.1.w3x
Variables
SHDetection
SHDetection
Vars
Demo
---------------------------
OnSpeedHackDetected
OnSoundDisabled
OnSoundEnabled
DisableGame
---------------------------
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.

		
Name Type Is Array Initial Value
DisabledGroup force No
SHD__Checker timer No
SHD__Counter integer No
SHD__Event real No
SHD__EventIndex integer Yes
SHD__EventSync unit No
SHD__EventSyncEnd unit No
SHD__IsSoundEnabled boolean No
SHD__IsSoundPlaying boolean No
SHD__Sound sound No
SHD__TriggeringPlayer player No
//TESH.scrollpos=0
//TESH.alwaysfold=0
   
    // ********************************************************
    //
    //      Speed Hack Detection v1.1
    //
    // ---------------------------------------------------
    //
    // Detects when a player are using speed hacking program
    // to boost up the game speed. The system only works if
    // only the player has the sound system working and enabled.
    // So it's recommended to require them to enable the sound
    // system just like what's demonstrated.
    //
    // Installation:
    // 1. Import the sound file
    // 2. Copy the SHD trigger group to your map
    // 3. Copy SHDetectionDummy unit to your map
    // 4. Configure the system accordingly
    //
    //  Events:
    //      udg_SHD__Event equals to 1.00 => speed hack detected
    //      udg_SHD__Event equals to 2.00 => sound system disabled
    //      udg_SHD__Event equals to 3.00 => sound system enabled
    //
    // ********************************************************
   
    constant function SHD__DummyID takes nothing returns integer
        return 'h000' // SHDetectionDummy raw code
    endfunction
   
    constant function SHD__FilePath takes nothing returns string
        return "war3mapImported\\SpeedHackDetector.mp3"
    endfunction
   
    constant function SHD__FileDuration takes nothing returns real
        return 1.1
    endfunction
   
    constant function SHD__RetryThreshold takes nothing returns integer
        return 25
    endfunction
   
    function SHD__OnSelect takes nothing returns boolean
       
        local unit u = GetTriggerUnit()
        local integer id
       
        set udg_SHD__TriggeringPlayer = GetTriggerPlayer()
        set id = GetPlayerId(udg_SHD__TriggeringPlayer)
        if (u == udg_SHD__EventSync) then
            set udg_SHD__EventIndex[id] = udg_SHD__EventIndex[id] + 1
        elseif (u == udg_SHD__EventSyncEnd) then
            set udg_SHD__Event = udg_SHD__EventIndex[id]
            set udg_SHD__Event = 0
            set udg_SHD__EventIndex[id] = 0
        endif
        set udg_SHD__TriggeringPlayer = null
        set u = null
       
        return false
    endfunction
   
    function SHD__BuildEvent takes integer index returns nothing
        loop
            set index = index-1
            call SelectUnit(udg_SHD__EventSync, true)
            call SelectUnit(udg_SHD__EventSync, false)
            exitwhen index == 0
        endloop
        call SelectUnit(udg_SHD__EventSyncEnd, true)
        call SelectUnit(udg_SHD__EventSyncEnd, false)
    endfunction
   
    function SHD__Check takes nothing returns nothing
       
        if (udg_SHD__IsSoundPlaying and GetSoundIsPlaying(udg_SHD__Sound)) then
            call StopSound(udg_SHD__Sound, false, false)
            call SHD__BuildEvent(1)
        endif
        call StartSound(udg_SHD__Sound)
        set udg_SHD__IsSoundPlaying = GetSoundIsPlaying(udg_SHD__Sound)
        if (not udg_SHD__IsSoundPlaying) then
            if (udg_SHD__IsSoundEnabled) then
                call SHD__BuildEvent(2)
                set udg_SHD__IsSoundEnabled = false
            endif
        elseif (not udg_SHD__IsSoundEnabled) then
            call SHD__BuildEvent(3)
            set udg_SHD__IsSoundEnabled = true
        endif
       
    endfunction
   
    function SHD__Preload takes nothing returns nothing
       
        call StartSound(udg_SHD__Sound)
        if (GetSoundIsPlaying(udg_SHD__Sound)) then
            call StopSound(udg_SHD__Sound, false, false)
            call TimerStart(udg_SHD__Checker, SHD__FileDuration(), true, function SHD__Check)
            debug call BJDebugMsg("Preloading completed after " + I2S(udg_SHD__Counter) + "x attempts")
        elseif (udg_SHD__Counter < SHD__RetryThreshold()) then
            set udg_SHD__Counter = udg_SHD__Counter + 1
        elseif (udg_SHD__IsSoundEnabled) then
            call TimerStart(udg_SHD__Checker, SHD__FileDuration(), true, function SHD__Check)
            call SHD__BuildEvent(2)
            set udg_SHD__IsSoundEnabled = false
        endif
       
    endfunction
   
    function InitTrig_SHDetection takes nothing returns nothing
       
        local trigger t = CreateTrigger()
        local integer i = 0
       
        set udg_SHD__IsSoundEnabled = true
        set udg_SHD__EventSync      = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), SHD__DummyID(), 0, 0, 0)
        set udg_SHD__EventSyncEnd   = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), SHD__DummyID(), 0, 0, 0)
        set udg_SHD__Sound          = CreateSound(SHD__FilePath(), false, false, false, 0, 0, "")
       
        loop
            exitwhen i > 11
            call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SELECTED, null)
            set i = i + 1
        endloop
        call TriggerAddCondition(t, Condition(function SHD__OnSelect))
        call TimerStart(udg_SHD__Checker, 0.01, true, function SHD__Preload)
        call PauseUnit(udg_SHD__EventSync   , true)
        call PauseUnit(udg_SHD__EventSyncEnd, true)
       
    endfunction
   
Vars
  Events
  Conditions
  Actions
    Set SHD__Checker = (Last started timer)
    Set SHD__Counter = 0
    Set SHD__Event = 0.00
    Set SHD__IsSoundPlaying = False
    Set SHD__Sound = (Last played sound)
OnSpeedHackDetected
  Events
    Game - SHD__Event becomes Equal to 1.00
  Conditions
  Actions
    Trigger - Turn off (This trigger)
    Game - Display to (All players) for 0.00 seconds the text: ((Name of SHD__TriggeringPlayer) + has been suspected to use speed hacking program! The game has been stopped permanently!)
    Game - Pause the game
OnSoundDisabled
  Events
    Game - SHD__Event becomes Equal to 2.00
  Conditions
    (SHD__TriggeringPlayer is in DisabledGroup) Equal to False
  Actions
    Game - Display to (All players) for 0.00 seconds the text: ((Name of SHD__TriggeringPlayer) + has the sound system disabled. Please turn it on to continue playing.)
    Selection - Clear selection for SHD__TriggeringPlayer
    Player Group - Add SHD__TriggeringPlayer to DisabledGroup
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in DisabledGroup) Equal to 1
      Then - Actions
        Trigger - Turn on DisableGame <gen>
      Else - Actions
OnSoundEnabled
  Events
    Game - SHD__Event becomes Equal to 3.00
  Conditions
    (SHD__TriggeringPlayer is in DisabledGroup) Equal to True
  Actions
    Game - Display to (All players) for 0.00 seconds the text: ((Name of SHD__TriggeringPlayer) + has enabled the sound system thus he can continue playing.)
    Camera - Reset camera for SHD__TriggeringPlayer to standard game-view over 0 seconds
    Player Group - Remove SHD__TriggeringPlayer from DisabledGroup
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in DisabledGroup) Equal to 0
      Then - Actions
        Trigger - Turn off DisableGame <gen>
      Else - Actions
DisableGame
  Events
    Time - Every 0.03 seconds of game time
  Conditions
  Actions
    Player Group - Pick every player in DisabledGroup and do (Actions)
      Loop - Actions
        Camera - Apply gg_cam_Camera_001 for (Picked player) over 0 seconds