HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What the

07-21-2007, 12:42 AM#1
Beardo
Collapse JASS:
//********************
//* Flash Heal
//********************
elseif id == 852073 then
    if GetUnitState(target, UNIT_STATE_LIFE) == GetUnitState(target, UNIT_STATE_MAX_LIFE) then
        //debug call BJDebugMsg("HIT2")
        call PauseUnit(u, true)
        call IssueImmediateOrder(u, "stop")
        call PauseUnit(u, false)        
        call DisplayTextToPlayer(p, 0, 0, "|CFFED1C24That unit already has full life.|r")
    endif



This fragment of this function (theoretically) prevents a user from casting a spell when the targets life is full. It works, however, it'll prevets the unit from casting the spell even when the targets life isnt full. Am I missing something here? I hate wasting time on (seemingly) simple things like this
07-21-2007, 12:48 AM#2
Naakaloh
Are you certain that you've assigned the correct unit to "target"?
07-21-2007, 02:04 AM#3
fps-doug
maybe there should be parenthesis surrounding the if statement ?

for example yours says

Collapse JASS:
if (blah) == (blah)


maybe try making it like this:

Collapse JASS:
if ( (blah) == (blah) )

Im not sure but thats my guess.



also how come you pause the unit to order it to stop, then unpause?
07-21-2007, 02:15 AM#4
Dil999
Make sure you have u and target assigned correctly, and if that doesnt work do what doug said (the second one), WE is annoying sometimes that way.