Warcraft III resources & community, 2003–2006 · archived

PreventUnitSelection

not rated
Submitted by KaTTaNaFunctions0 downloads
Prevents the given unit from being selected by any player. If a player attempts to select it, it will immediately get deselected, but we have it selected for a very, very brief time.
I suggest that the unit has no sound set, and selection scale set to 0.00.

Source

function PreventUnitSelection_Child takes nothing returns nothing
    call SelectUnit(GetTriggerUnit(), false)
endfunction

function PreventUnitSelection takes unit whichUnit returns nothing
    local trigger trg = CreateTrigger()
    call TriggerRegisterUnitEvent(trg, whichUnit, EVENT_UNIT_SELECTED)
    call TriggerAddAction(trg, function PreventUnitSelection_Child)
endfunction

Comments

1
memory leak!!