Jump to content
  • 0

Avoid IG display of command when a GM tries to use one he don't have access.


Auryn

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  147
  • Reputation:   1
  • Joined:  01/26/12
  • Last Seen:  

When I try to use a command that I don't own, !warp, for exemple the command shows up (without effect, sure).

I would like it to do not, displaying something like "(command) is Unknow command.".

Is this possible ?

How could I do it ?

Edited by Auryn
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  213
  • Reputation:   109
  • Joined:  05/21/12
  • Last Seen:  

In atcommand.c find this block of code:

//Grab the command information and check for the proper GM level required to use it or if the command exists
info = get_atcommandinfo_byname(atcommand_checkalias(command + 1));
if (info == NULL)
{
	if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission
   	 sprintf(output, msg_txt(153), command); // "%s is Unknown Command."
   	 clif_displaymessage(fd, output);
   	 atcommand_get_suggestions(sd, command + 1, *message == atcommand_symbol);
		return false;
	} else
		return false;
}

Then, replace with:

//Grab the command information and check for the proper GM level required to use it or if the command exists
info = get_atcommandinfo_byname(atcommand_checkalias(command + 1));
if (info == NULL)
{
	if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission
   	 return false;
	} else
		return false;
}

Lastly, re-compile the server. If you have any other questions, feel free to let me know.

Edited by Cookie
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  147
  • Reputation:   1
  • Joined:  01/26/12
  • Last Seen:  

I think you didn't understood me.

I mean that when a Law enforcer, for exemple, tries to use !goto (for exemple again) when he don't own it in groups.conf, the command shows up, cause it exhists even if he can't use it.

I would like that in this situation, a message returns that the command can't be used, in the same way of "(command) is Unknow command.", for the players not to see this command displaying (avoid a flop).

Like, for exemple "(command) cannot be used.". /hmm

Edited by Auryn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  213
  • Reputation:   109
  • Joined:  05/21/12
  • Last Seen:  

info = get_atcommandinfo_byname(atcommand_checkalias(command + 1));
	if (info == NULL)
	{
			if( pc_get_group_level(sd) )
	{// Show player unknown command
				sprintf(output, msg_txt(153), command); // "%s is Unknown Command."
				clif_displaymessage(fd, output);
				atcommand_get_suggestions(sd, command + 1, *message == atcommand_symbol);
				return false;
	}
			else
					return false;
	}

Ah, well the atcommand.c code above does just that (by default). The unknown command is only shown to people with a group ID above 0 (notice the code if (pc_get_group_level(sd) which means execute the code in the bracket if the data is true/set). You can change in the msg_athena.conf in your /conf/:

153: %s cannot be used.

If it's a player, the player won't see anything and just chat the command because the script return's false with displaying any message.

In other words, just change your msg_athena.conf 153: message.

Edited by Cookie
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  147
  • Reputation:   1
  • Joined:  01/26/12
  • Last Seen:  

Hi again,

I have edit my last post for you to better understand me.

/thx

Edited by Auryn
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...