Jump to content
  • 0

How to add @joinevent and warp to event area


Question

Posted

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~

1 answer to this question

Recommended Posts

Posted

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.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...