Lord Ganja 5 Posted July 4, 2015 (edited) Can anyone test this script and see if you experience what im experiencing.. Coz the OnPCDieEvent is always triggered twice.. Idk why. I already checked if I might have duplicates of the script on other files but there's none. So I was wondering why is it triggered twice? Help will always be appreciated. Thanks in advance. Here's the script: OnPCDieEvent: if( strcharinfo(3) == "guild_vs1" && ) { @dead_pts += 1; if ( @dead_pts == 1 ) { message strcharinfo(0), "Reviving. . . . . . ."; sleep2 3000; atcommand "@alive"; message strcharinfo(0), "1 more life left."; end; } if ( @dead_pts >= 2 ) { @dead_pts = 0; message strcharinfo(0), "Sorry, but you failed the quest. Better luck next time!"; sleep2 5000; warp "SavePoint",0,0; end; } } end; Here's the result: Edited July 4, 2015 by Lord Ganja Quote Share this post Link to post Share on other sites
0 4144 364 Posted July 4, 2015 Probably this is parser issue. You have syntax error in if condition if( strcharinfo(3) == "guild_vs1" && ) { Try delete "&&" from here Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted July 4, 2015 I can't see any error that 4144 didn't mention before, but is it intended to use a temporary character variable? Since anyone could reset the @dead_pts variable just by returning to char select and log back in. Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted July 4, 2015 And then you have to comment out the gvg mapflag of guild_vs1 Quote Share this post Link to post Share on other sites
0 Lord Ganja 5 Posted July 4, 2015 @@4144 Sorry, that was a typo coz I used to put another variable there. guess I haven't removed it when I paste it here. Anyway even if I removed that, it is still triggered twice :/ @@Winterfox Yes, I intend to use a temporary character variable, since I want to to reset whenever they logged out. @@Angelmelody I already removed the gvg mapflag but it is still triggered twice. anyway will it really be triggered twice when I don't remove the gvg mapflag? Quote Share this post Link to post Share on other sites
0 4144 364 Posted July 4, 2015 Try remove warp command. Probably if you using warp for dead player and it called second time after warp. Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted July 4, 2015 (edited) I tested it and it worked fine for me. If you did what the people here told you and did it correctly, it seems there has to be another script or a part of your script you didn't show, that causes your problem. Here is what i did to test your snippet: 1. I went to mapflag/gvg.txt and changed the line guild_vs1 to //guild_vs1. 2. I added this script: - script test -1,{ OnPCDieEvent: if( strcharinfo(3) == "guild_vs1" ) { @dead_pts += 1; if ( @dead_pts == 1 ) { message strcharinfo(0), "Reviving..."; sleep2(3000); atcommand("@alive"); message(strcharinfo(0), "1 more life left."); end; } if ( @dead_pts >= 2 ) { @dead_pts = 0; message(strcharinfo(0), "Sorry, but you failed the quest. Better luck next time!"); sleep2(5000); warp("SavePoint",0,0); end; } } end;} 3. Warped to guild_vs1 and died 2 times and it worked as intended. 4. Repeated step 3 for 2 times to be sure. Maybe someone else could give it a shot and test if he gets the same issue as @@Lord Ganja. Edited July 4, 2015 by Winterfox Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted July 4, 2015 Add atcommand "@alive"; Before warping, It may be due to as he dies , warp out as dead, and server might recognize as he died on new location.(just assumptions) Quote Share this post Link to post Share on other sites
0 Garr 117 Posted July 5, 2015 Actually, no, there is a part inside warp command (pc_setpos in pc.c) that revives the person it's warping when dead. My wild guess would be that there's some other label that triggers before, and it might be falling through to this one. In short, you might've forgotten to end/close piece of code above this part? Quote Share this post Link to post Share on other sites
Can anyone test this script and see if you experience what im experiencing..
Coz the OnPCDieEvent is always triggered twice.. Idk why. I already checked if I might have duplicates of the script on other files but there's none.
So I was wondering why is it triggered twice? Help will always be appreciated. Thanks in advance.
Here's the script:
Here's the result:
Edited by Lord Ganja
Share this post
Link to post
Share on other sites