Jump to content
  • 0

How to add @joinevent and warp to event area


fallen0519

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

Hi, may I ask a favor about bindatcmd, is something like players can type @joinevent, and the NPC will ask them whether want to warp to the Event Area. "Yes" or "No" as selection.

 

Hope some pro-scripter can help me about this. Thanks much~

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  135
  • Reputation:   41
  • Joined:  02/05/14
  • Last Seen:  

Here's a sample of what you've described:

-	script	joinevent	-1,{
	
	// Configuration
	OnInit:
		// Map settings
		.map_name$ = "payon";
		.map_x = 20;
		.map_y = 20;
	
		// Command
		bindatcmd "joinevent", strnpcinfo(3) +"::OnCommand";
		end;
		
	
	// Script
	OnCommand:
		// Confirm warp
		if (select("Warp to event area:End session") != 2) {
			// Warp to preset destination
			warp .map_name$, .map_x, .map_y;
			end;
		}
		
		close;

}


...though I would probably just go without the confirmation, since the implementation is via atcommand:

-	script	joinevent	-1,{
	
	// Configuration
	OnInit:
		// Map settings
		.map_name$ = "payon";
		.map_x = 20;
		.map_y = 20;
	
		// Command
		bindatcmd "joinevent", strnpcinfo(3) +"::OnCommand";
		end;
		
	
	// Script
	OnCommand:
		// Warp to preset destination
		warp .map_name$, .map_x, .map_y;
		end;
		
		close;

}
 


I've left some comments so you can get an idea of what each section of code does.

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...