Auryn Posted June 13, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 147 Reputation: 1 Joined: 01/26/12 Last Seen: April 27, 2018 Share Posted June 13, 2012 (edited) 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 June 14, 2012 by Auryn Quote Link to comment Share on other sites More sharing options...
Cookie Posted June 29, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 213 Reputation: 109 Joined: 05/21/12 Last Seen: December 27, 2014 Share Posted June 29, 2012 (edited) 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 June 29, 2012 by Cookie Quote Link to comment Share on other sites More sharing options...
Auryn Posted June 29, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 147 Reputation: 1 Joined: 01/26/12 Last Seen: April 27, 2018 Author Share Posted June 29, 2012 (edited) 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.". Edited June 29, 2012 by Auryn Quote Link to comment Share on other sites More sharing options...
Cookie Posted June 29, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 213 Reputation: 109 Joined: 05/21/12 Last Seen: December 27, 2014 Share Posted June 29, 2012 (edited) 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 June 29, 2012 by Cookie Quote Link to comment Share on other sites More sharing options...
Auryn Posted June 29, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 147 Reputation: 1 Joined: 01/26/12 Last Seen: April 27, 2018 Author Share Posted June 29, 2012 (edited) Hi again, I have edit my last post for you to better understand me. Edited June 29, 2012 by Auryn Quote Link to comment Share on other sites More sharing options...
Question
Auryn
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 AurynLink to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.