unit type (or)

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

JustANewbie
Forum Spammer
Posts: 510
Joined: August 18th, 2012, 2:32 am

unit type (or)

Post by JustANewbie »

i'm making a trigger which move unit to another region when a unit enters the region, but i want to allow only 2 unit types to move to that region, this is the condition i used, but only unit type Hpal move to that region when enter the region i specified, unit type H016 does not, am i doing anything wrong? please correct me. thanks in advance.

Code: Select all

if(not((GetUnitTypeId(GetTriggerUnit())=='Hpal'))or((GetUnitTypeId(GetTriggerUnit())=='H016')))then
return false
endif
return true
Last edited by JustANewbie on November 28th, 2013, 5:12 am, edited 1 time in total.
zUsername
Forum Addict
Posts: 407
Joined: February 25th, 2011, 3:16 am
Location: Unknown

Re: unit type (or)

Post by zUsername »

Code: Select all

    if ( not GetBooleanOr( ( GetUnitTypeId(GetEnteringUnit()) == 'Hpal' ), ( GetUnitTypeId(GetEnteringUnit()) == 'H016' ) ) ) then
        return false
    endif
    return true

try this
JustANewbie
Forum Spammer
Posts: 510
Joined: August 18th, 2012, 2:32 am

Re: unit type (or)

Post by JustANewbie »

it works! thank you very much