Can't get this "and" to work right.

Evan1993

Ultra Cool Member
Reaction score
30
All Jass craft tells me is "syntax error" I tried using both the native “And” and the normal and.

Code:
function IsBad takes nothing returns boolean
    return ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), ConvertedPlayer(udg_Numb[1])) == true )
endfunction
function IsGood takes nothing returns boolean
    return ( IsPlayerAlly(GetTriggerPlayer(), ConvertedPlayer(udg_Numb[1])) == true )
endfunction

function Attack takes nothing returns nothing
    call IssuePointOrderLocBJ( GetEnumUnit(), "attack", udg_Point )
endfunction
[B]function Noworkers takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) != 'uaco' ) and GetUnitStateSwap(UNIT_STATE_LIFE, GetFilterUnit()) >= 10 )
endfunction[/B]
function Trig_LaunchAttacks_Actions takes nothing returns nothing
    local location array l
    local integer i = GetRandomInt(1, 5)
    local integer start = 1
    local integer end = 12
    local boolean stop
    local integer count = 0
    local group a
    local group e
    set l[1] = GetPlayerStartLocationLoc(Player(0))
    set l[2] = GetPlayerStartLocationLoc(Player(3))
    set l[3] = GetPlayerStartLocationLoc(Player(6))
    set l[4] = GetPlayerStartLocationLoc(Player(9))
    set l[5] = GetRectCenter(gg_rct_Region_001)
    loop
        exitwhen start > end
        set start = start + 1
        set udg_Spawns[start] = GetUnitsOfPlayerMatching(ConvertedPlayer(start), Condition(function Noworkers))
        loop
            set udg_Numb[1] = start
            call DisplayTextToForce( GetPlayersAll(), I2S(CountUnitsInGroup(GetUnitsInRangeOfLocMatching(655.0, l[i], Condition (function IsBad) ))))
            set e = GetUnitsInRangeOfLocAll(655.0, l[i]) 
            call PolledWait(2.0)
            if CountUnitsInGroup(GetUnitsInRangeOfLocMatching(655.0, l[i], Condition(function IsBad) )) == 0 then
                set i = GetRandomInt(1, 5)
                set stop = false
            else
                set stop = true
            endif
            exitwhen stop == true
        endloop
        set udg_Point = l[i]
        call ForGroupBJ( udg_Spawns[start], function Attack )
    endloop
endfunction

//===========================================================================
function InitTrig_LaunchAttacks takes nothing returns nothing
    set gg_trg_LaunchAttacks = CreateTrigger(  )
    call TriggerAddAction( gg_trg_LaunchAttacks, function Trig_LaunchAttacks_Actions )
endfunction
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top