PDA

View Full Version : Problem removing pvp flags!


Gonkers
03-31-2004, 07:21 PM
if($1-=~"interested"){say("First i'll add you to the Pvp guild. Then

i'll turn on your pvp flag. If at any point, you wish to return to

non-pvp, you come back here and tell me that you [wish to return]. Now,

lets get started... Do you [want to become pvp]?"); }
if($1-=~"want to become pvp") {say("I'll set your guild");

setguild(3,0);
}{say ("Now i'll set your pvp flag"); pvp(on);
}
{say ("there you go, have fun!"); }
if($1-=~"want to return") {say("so be it, first i'll remove you from

the guild"); setguild(0,0); }
{say ("then i'll remove your precious pvp flag, you may need to zone

once I do, it may say you follow the ways of discord, but just zone and

you'll be fine"); pvp(off); }

}


everything works, but after he says "but just zone and you'll be fine" it does not show nothing about not becomming non pvp. Even when I zone, i'm still pvp. Please help :).

Monrezz
04-01-2004, 09:57 AM
pvp(off) is broken I think, at least it was a while ago and by the looks of this it still is :P

Ask a Dev.

RangerDown
04-01-2004, 10:41 AM
You're closing and reopening braces in what should be the middle of what it executes, and this might be causing it to evaluate the if() part wrong. Below is your code with my comments to show how I predict the system is gonna execute the code (I've broken up the lines differently than what you submitted so you can see my comments more easily):



if($1-=~"want to become pvp")
{ say("I'll set your guild");
setguild(3,0);
} # This closing bracket ends what it will execute for the player saying "want to become pvp". Why did you end it here? Shouldn't the other 3 statements below also be a part of this condition?
{ say ("Now i'll set your pvp flag");
pvp(on);
} # Again, why end it here? Shouldn't the next statement below also be a part of this condition?
{say ("there you go, have fun!");
}

elsif($1-=~"want to return")
# Since you ended the if() statement way back up there, and executed more statements
# after the if(){} block, Perl's probly wondering what this elsif goes to.
# THIS is probly the root of your problem.
{say("so be it, first i'll remove you from the guild");
setguild(0,0);
} # Shouldn't be closing the bracket here
{say ("then i'll remove your precious pvp flag, you may need to zone once I do, it may say you follow the ways of discord, but just zone and you'll be fine");
pvp(off);
} # This is the right spot to close the bracket



So here's what I propose your code look like:
if($1-=~"want to become pvp")
{ say("I'll set your guild");
setguild(3,0); # Notice there's no closing brace here
say ("Now i'll set your pvp flag");
pvp(on);
say ("there you go, have fun!");
} # <--- The if() condition doesn't end till here.

elsif($1-=~"want to return") # NOW Perl should properly evaulate this elsif()
{say("so be it, first i'll remove you from the guild");
setguild(0,0); # No closing brace here.
say ("then i'll remove your precious pvp flag, you may need to zone once I do, it may say you follow the ways of discord, but just zone and you'll be fine");
pvp(off);
} # End the elsif() part

killspree
04-01-2004, 11:13 AM
elseif works for sure? haven't played around with pearl questing much but I don't remember it working in the old system.

m0oni9
04-01-2004, 03:16 PM
elseif works for sure?
Fer sure. :wink: As long as the perl interpreter is running with no errors, it should work fine.

Gonkers
04-01-2004, 07:28 PM
im not running the pearl quest.......I'm running a regular quest. the .qst extention..

Thank you for your input though, i'll mess with this in the morning, I'll apply your feedback and see the results I get and post them here in the morning!

Thank you also for running down a example, This will help me learn the quest system better. I am visual learner so over time i'll be good............hopefully hah.

RangerDown
04-02-2004, 03:51 AM
Ah, I assumed you were using Perl. Not sure if that works with the .qst system but let me know how it goes.

Gonkers
04-02-2004, 06:54 AM
only thing that does not work is pvp(off), i confirmed that sadly,