diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-27 14:10:29 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-27 14:10:29 +0000 |
commit | 578728adfd125eeac56150705b41e05cd4d970e4 (patch) | |
tree | ceebfb17f07585a25282ac14241f85cd1b34ea3c /src/map/atcommand.c | |
parent | 4d51983e59c4d4008c7ed83380588959be7fad0c (diff) | |
download | hercules-578728adfd125eeac56150705b41e05cd4d970e4.tar.gz hercules-578728adfd125eeac56150705b41e05cd4d970e4.tar.bz2 hercules-578728adfd125eeac56150705b41e05cd4d970e4.tar.xz hercules-578728adfd125eeac56150705b41e05cd4d970e4.zip |
- Added at command @commands, displays the list of commands available to you.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6313 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index af87efa99..c2d1d0d2f 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -293,6 +293,7 @@ ACMD_FUNC(main); // LuzZza ACMD_FUNC(clone); // [Valaris]
ACMD_FUNC(tonpc); // LuzZza
+ACMD_FUNC(commands); // LuzZza
/*==========================================
*AtCommandInfo atcommand_info[]�\���̂̒�`
@@ -607,6 +608,7 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_Clone, "@slaveclone", 50, atcommand_clone },
{ AtCommand_Clone, "@evilclone", 50, atcommand_clone }, // [Valaris]
{ AtCommand_ToNPC, "@tonpc", 40, atcommand_tonpc }, // LuzZza
+ { AtCommand_Commands, "@commands", 1, atcommand_commands }, // [Skotlex]
// add new commands before this line
{ AtCommand_Unknown, NULL, 1, NULL }
@@ -1158,6 +1160,39 @@ int duel_reject( */
/*==========================================
+ * @commands Lists available @ commands to you.
+ *------------------------------------------
+ */
+int atcommand_commands(const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ int i,count=0,level;
+ nullpo_retr(-1, sd);
+ level = pc_isGM(sd);
+
+ clif_displaymessage(fd, msg_txt(273));
+ memset(atcmd_output, 0, sizeof atcmd_output);
+ for (i = 0; atcommand_info[i].type != AtCommand_None; i++)
+ if (atcommand_info[i].level <= level) {
+ count++;
+ strcat(atcmd_output, atcommand_info[i].command);
+ strcat(atcmd_output, " ");
+ if (!(count%10)) {
+ clif_displaymessage(fd, atcmd_output);
+ memset(atcmd_output, 0, sizeof atcmd_output);
+ }
+ }
+
+ if (count) {
+ sprintf(atcmd_output, msg_txt(274), count);
+ clif_displaymessage(fd, atcmd_output);
+ } else
+ clif_displaymessage(fd, msg_txt(275));
+
+ return 0;
+}
+
+/*==========================================
* @send (used for testing packet sends from the client)
*------------------------------------------
*/
|