Jump to content
  • 0

bindatcmd question


Question

Posted

Hey guys, I am trying to create a bindatcmd script that works like @ccommand "options"

Options:

  • market - (warps the player to the market area)
  • bg - (warp the player to the bg area)

In-game will look like this.

Untitled.png.46222c154274c37e1a39ca6cbc9a5318.png

6 answers to this question

Recommended Posts

  • 1
Posted (edited)

Not possible to detect them as of now by scripting (@commands show them well though), you'd have to add them and their descriptions manually.

-	script	CCommand	-1,{

OnCommand:

	if(!.@atcmd_numparameters) {
		message strcharinfo(0),"Use @ccommands options to check the options.";
	} else {
		setarray .@options$[0],"options","bg","market";
		.@str$ = strtolower(.@atcmd_parameters$[0]);
		.@command = inarray(.@options$,.@str$);
		switch(.@command) {
		case 1:
			warp "bg",0,0;
			break;
		case 2:
			warp "market",0,0;
			break;
		default:
			message strcharinfo(0),"Avaiaible commands:";
			message strcharinfo(0),"@market: warps you to the Market.";
			message strcharinfo(0),"@bg: warps you to the BattleGrounds arena.";
			break;
		}
	}
	end;

OnInit:

	bindatcmd "ccommand","CCommand::OnCommand";
	end;

}

 

Edited by n0tttt
  • Upvote 1
  • MVP 1
  • 0
Posted

I don't know if I understood very well.

-	script	CCommand	-1,{

OnCommand:

	if(!.@atcmd_numparameters) {
		message strcharinfo(0),"Use @ccommands options to check the options.";
	} else {
		setarray .@options$[0],"options","bg","market";
		.@str$ = strtolower(.@atcmd_parameter$[0]);
		.@command = inarray(.@options$,.@str$);
		switch(.@command) {
		case 1:
			warp "bg",0,0;
			break;
		case 2:
			warp "market",0,0;
			break;
		default:
			.@mes$ = implode(.@options$,", ");
			message strcharinfo(0),"Avaiaible commands: "+.@mes$;
			break;
		}
	}
	end;

OnInit:

	bindatcmd "ccommand","CCommand::OnCommand";
	end;

}

 

  • MVP 2
  • 0
Posted
16 minutes ago, n0tttt said:

I don't know if I understood very well.


-	script	CCommand	-1,{

OnCommand:

	if(!.@atcmd_numparameters) {
		message strcharinfo(0),"Use @ccommands options to check the options.";
	} else {
		setarray .@options$[0],"options","bg","market";
		.@str$ = strtolower(.@atcmd_parameter$[0]);
		.@command = inarray(.@options$,.@str$);
		switch(.@command) {
		case 1:
			warp "bg",0,0;
			break;
		case 2:
			warp "market",0,0;
			break;
		default:
			.@mes$ = implode(.@options$,", ");
			message strcharinfo(0),"Avaiaible commands: "+.@mes$;
			break;
		}
	}
	end;

OnInit:

	bindatcmd "ccommand","CCommand::OnCommand";
	end;

}

 

Yup this is what i wanted... but it didn't it only reads the default part.

  • 0
Posted (edited)

Is it possible to modify this command in order to consult the custom commands in the server? and also to be able to know what they are for?

Edited by maken06

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