wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 06-03-2009, 05:48 AM   #1
SmileyJeff
User
 
Join Date: Jan 2006
Posts: 139

SmileyJeff is on a distinguished road (11)

Send a message via MSN to SmileyJeff
Default Nested If using Custom Script?

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!
__________________
Disapproving all GUI systems because JASS is more efficient is like asking all people to change from Windows to Command Line Interface.

Last edited by SmileyJeff : 06-03-2009 at 05:57 AM.
SmileyJeff is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 06-03-2009, 05:57 AM   #2
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

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 ...
__________________
akolyt0r is offline   Reply With Quote
Old 06-03-2009, 06:12 AM   #3
SmileyJeff
User
 
Join Date: Jan 2006
Posts: 139

SmileyJeff is on a distinguished road (11)

Send a message via MSN to SmileyJeff
Default

Ah solved. Thanks alot! +rep
__________________
Disapproving all GUI systems because JASS is more efficient is like asking all people to change from Windows to Command Line Interface.

Last edited by SmileyJeff : 06-03-2009 at 06:16 AM.
SmileyJeff is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:55 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services