HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Nested If using Custom Script?

06-03-2009, 05:48 AM#1
SmileyJeff
Trigger:
Actions
//Some other codes above....
Custom script: if ( ( GetOwningPlayer(DeadHero) == Player(2) ) ) then
Custom script: if ( ( GetOwningPlayer(DeadHero) == Player(3) ) ) then
Custom script: if ( ( GetOwningPlayer(DeadHero) == Player(4) ) ) then
Custom script: if ( ( GetOwningPlayer(DeadHero) == Player(5) ) ) then
Custom script: if ( ( GetOwningPlayer(DeadHero) == Player(6) ) ) then
Custom script: call ReviveHeroLoc(DeadHero, udg_reviveZone_Red, true)
Custom script: endif
Custom script: endif
Custom script: endif
Custom script: endif
Custom script: else
Custom script: call ReviveHeroLoc(DeadHero, udg_reviveZone_Blue, true)
Custom script: endif
//Some other codes below

Is this the correct way to do nested if? I want it to revive player 3-7 at reviveZone_Red, and the rest will be revived at Blue. But when my hero dies as player 3, it is not reviving. Please help! Thanks in advance!
06-03-2009, 05:57 AM#2
akolyt0r
thats because nested ifs are the same like a normal "AND" ...and the hero surely doesnt belong to Player 2 AND Player 3 AND Player 4 ...
06-03-2009, 06:12 AM#3
SmileyJeff
Ah solved. Thanks alot! +rep