Jump to content
  • 0

bindatcmd question


Radian

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

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

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Sorry.

.@str$ = strtolower(.@atcmd_parameter$[0]);

Change to:

.@str$ = strtolower(.@atcmd_parameters$[0]);
  • Love 2
Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Thank you @n0tttt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  234
  • Reputation:   113
  • Joined:  02/24/15
  • Last Seen:  

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