Jump to content
  • 0

Can anyone find any errors in this script?


Raikumi

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   0
  • Joined:  06/28/12
  • Last Seen:  

For some reason, when trying to choose the "Final Destination" option, you are not warped and the NPC window is forced to stay on your screen with no buttons, forcing you to log out because you can not click "enter" to type any commands or ESC to go to the Character Screen.

Also, is there a way I can limit the Final Destination room to 2 people, and also put a 60 second time limit inside of that room?

Thanks everyone!

caspen.gat,160,214,5 script PvP Warper 730,{
if (.pvp_square$=="") donpcevent "Ultimate PVP warper::OnClock0000";
 mes "[PvP Warper]";
mes "Which arena do you want to go to?";
switch(select("Final Destination ["+getmapusers(.pvp_square$)+"/100]:Platform ["+getmapusers("guild_vs3")+"/100]:No Potion PVP ["+getmapusers("guild_vs5")+"/100]: ")) {
case 1: // Final Destination
 if (getmapusers(.pvp_square$) > 99) callsub S_full;
 callsub S_payment;
 warp .pvp_square$,0,0;
 announce "[ "+strcharinfo(0)+" ] has joined the Final Destination PVP room.",0;
 end;

case 2: // Platform
 if (getmapusers("guild_vs3") > 99) callsub S_full;
 callsub S_payment;
 warp "guild_vs3",0,0;
 announce "[ "+strcharinfo(0)+" ] has joined the Platform PVP room.",0;
 end;
case 3: // PVP NoPotion
 if (getmapusers("guild_vs5") > 99) callsub S_full;
 for( set .@i,0; .@i<getarraysize(.NoPotion_ids); set .@i,.@i+1 ) {
  if (countitem(.NoPotion_ids[.@i])) {
mes "You can not bring potions in this pvp.";
close;
  }
 }
 callsub S_payment;
 warp "guild_vs5",0,0;
 announce "[ "+strcharinfo(0)+" ] has joined the No Potion PVP room.",0;
 end;
}

S_full:
mes " ";
mes "I'm sorry, this arena is full.  Please try again later...";
close;
S_payment:
if (Zeny < (0)) {
 mes "You don't have enough zeny.";
 mes "It costs "+(0)+" zeny for you to enter.";
 close;
}
set Zeny, Zeny - (0);
return;

OnInit:
	end;
OnClock0000:
// set the "PVP Square" map, based on day of the weeek
switch(gettime(4)) {
case 0: // Sunday
case 1: // Monday
 set .pvp_square$, "final_dest";
 break;
case 2: // Tuesday
case 3: // Wednesday
 set .pvp_square$, "final_dest";
 break;
case 4: // Thursday
case 5: // Friday
 set .pvp_square$, "final_dest";
 break;
case 6: // Saturday
 set .pvp_square$, "final_dest";
 break;
}

// items not allowed in PVP NoPotion
setarray .NoPotion_ids[0], 607, 608, 504;

// items not allowed in Non Donator PVP
setarray .NoDonator_ids[0], 2410, 1530;
end;
}

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  658
  • Reputation:   57
  • Joined:  11/20/11
  • Last Seen:  

OnClock0000:
// set the "PVP Square" map, based on day of the weeek
switch(gettime(4)) {
case 0: // Sunday
case 1: // Monday
 set .pvp_square$, "final_dest";
 break;
case 2: // Tuesday
case 3: // Wednesday
 set .pvp_square$, "final_dest";
 break;
case 4: // Thursday
case 5: // Friday
 set .pvp_square$, "final_dest";
 break;
case 6: // Saturday
 set .pvp_square$, "final_dest";
 break;
}

The map for .pvp_square$ is just defined when OnClock00 is true,so you have to wait for OnClock00 to define the map to final_dest

just use set .pvp_square$,"final_dest"; at the beginning of the Script.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   0
  • Joined:  06/28/12
  • Last Seen:  

Thank you @Rikimaru

Do you know why for Final Destination it always says [-1/100]?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

@Rikimaru: No, that's not correct, the first script line forces the map to be defined if it isn't already.

The error lies in this section:

caspen.gat,160,214,5	script    PvP Warper	730,{
if (.pvp_square$=="") donpcevent "Ultimate PVP warper::OnClock0000";

You're calling a nonexistent NPC, that's all. ;3

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   0
  • Joined:  06/28/12
  • Last Seen:  

Thank you Euphy!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...