Jump to content
  • 0
Sign in to follow this  
ThyroDree

Adding Custom Command on command list

Question

anyone can teach me how can i add my custom command can be view if a player type @commands

 

my custom commands is :

@world , @sample

 

 

up?

 

 

help

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

scripting ... easiest way

-	script	kjdfkjdfkjsdf	-1,{OnInit:	bindatcmd "world", strnpcinfo(0)+"::Onaaa";	bindatcmd "sample", strnpcinfo(0)+"::Onbbb";	end;Onaaa:	dispbottom "Hello World !";	end;Onbbb:	dispbottom "This is a sample";	end;}
.


.

atcommands

.

 

 

groups: ({	id: 0 /* group 0 is the default group for every new account */	name: "Player"	level: 0	inherit: ( /*empty list*/ )	commands: {		world: true		sample: true	}	permissions: {		/* without this basic permissions regular players could not 		trade or party */		can_trade: true		can_party: true	}},

 

 

.

patch

 src/map/atcommand.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex b5e8fa7..9da02ac 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -9374,6 +9374,17 @@ static inline void atcmd_channel_help(int fd, const char *command, bool can_crea 	clif->message(fd,atcmd_output); 	return true; }++ACMD(world)	{+	clif->message( fd, "Hello World !" );+	return true;+}++ACMD(sample) {+	clif->message( fd, "this is a sample." );+	return true;+}+ /**  * Fills the reference of available commands in atcommand DBMap  **/@@ -9384,6 +9395,8 @@ void atcommand_basecommands(void) { 	 * Command reference list, place the base of your commands here 	 **/ 	AtCommandInfo atcommand_base[] = {+		ACMD_DEF(world),+		ACMD_DEF(sample), 		ACMD_DEF2("warp", mapmove), 		ACMD_DEF(where), 		ACMD_DEF(jumpto),
.

---- OR ----

.

plugin

#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/clif.h"#include "../common/HPMi.h"#include "../common/HPMDataCheck.h" // should always be the last file included! (if you don't make it last, it'll intentionally break compile time)HPExport struct hplugin_info pinfo = {	"world",	// Plugin name	SERVER_TYPE_MAP,// Which server types this plugin works with?	"0.1",			// Plugin version	HPM_VERSION,	// HPM Version (don't change, macro is automatically updated)};ACMD(world)	{	clif->message( fd, "Hello World !" );	return true;}ACMD(sample) {	clif->message( fd, "this is a sample." );	return true;}HPExport void plugin_init (void) {	clif = GET_SYMBOL("clif");	addAtcommand( "world", world );	addAtcommand( "sample", sample );}

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.