2 #include "cmd_neonserv.h"
8 CMD_BIND(neonserv_cmd_help) {
11 ident = merge_argv(argv, 0, argc);
16 printf_mysql_query("SELECT `user_lang` FROM `users` WHERE `user_user` = '%s'", escape_string(user->auth));
19 if ((row = mysql_fetch_row(res)) != NULL)
23 printf_mysql_query("SELECT `text` FROM `help` WHERE `lang` = '%s' AND `ident` = '%s'", escape_string(lang), escape_string(ident));
25 if ((row = mysql_fetch_row(res)) == NULL) {
26 if(stricmp(lang, "en")) {
27 printf_mysql_query("SELECT `text` FROM `help` WHERE `lang` = 'en' AND `ident` = '%s'", escape_string(ident));
30 if ((row = mysql_fetch_row(res)) == NULL) {
31 reply(getTextBot(), user, "NS_HELP_TOPIC");
38 for(i = 0; i < strlen(row[0]); i++) {
42 sendBuf[sendBufPos] = '\0';
43 reply(getTextBot(), user, "%s", sendBuf);
50 sendBuf[sendBufPos++] = '\002';
54 sendBuf[sendBufPos++] = '\003';
58 sendBuf[sendBufPos++] = '\031';
63 sendBufPos += sprintf(sendBuf + sendBufPos, "%s", client->user->nick);
67 sendBuf[sendBufPos++] = '$';
72 sendBuf[sendBufPos++] = row[0][i];
77 sendBuf[sendBufPos] = '\0';
78 reply(getTextBot(), user, "%s", sendBuf);