Jump to content
  • 0

@main command


Question

Posted

is it possible if i use @main command and have a message with column symbol " : " it will not send but you will receive a message saying " Not allowed using special characters "

Example:

Player 1 use @main

@main HELLO WORLDDD :(

the @main message will not be send rather the one using @main will receive a message.

14 answers to this question

Recommended Posts

Posted

Hi x13th

for @main to work

the Receiver must open @main

via @main on

now the receiver's @main is on

you gm = check if @main is on too

then to send message to all people whom @main is on

is [Main] : [<Message>]

Posted

you don't get it.

if people use @main they are going to type a message ,right? so if they type a message with column symbol the message will not be send rather they will get dispbotton message saying not allowed special char

Posted

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

Posted

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

actually even having 24character+++ it doesn't give errors with @main

Posted (edited)

i think he is requesting for some modification for the @main command that restrict certain special character that occur in string...

For Example :

Current Command ( included / extra 1 column symbol in message

@main  Main: blabla : haha 

it work currently...

After Modified

@main  Main: blabla : haha 

will not work anymore...because of the existance of the Colum Symbol in the message....

well...just a noob scracthing...( perhaps it wont works )

if( strcmpi( message ,":" ) ) return 0;

check for the column symbol before announce the @main message...

if the condition is true..then dispbottom a message for unable to use special character in mesage..

Edited by Emistry
Posted

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

yes. i'm asking for this one >.<

Posted

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

yes. i'm asking for this one >.<

way too different @ post #1

Posted
is it possible if i use @main command and have a message with column symbol " : " it will not send but you will receive a message saying " Not allowed using special characters "

you guys misinterprete his posts.....:(

Posted (edited)

Try to convert it to integer Iam not sure on what I remember I just read it on C for Dummies :( I remember that when you parse a character value to integer it gives you its ASCII code...

int myvar = int(characterVar);

Well I guess you need to Iterate to the char variable to make this work

ASCII table reference:

http://web.cs.mun.ca...scii-table.html

Edited by JayPeeMateo
Posted
is it possible if i use @main command and have a message with column symbol " : " it will not send but you will receive a message saying " Not allowed using special characters "

you guys misinterprete his posts..... :(

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

yes. i'm asking for this one >.<

How so?

Posted (edited)

src/map/atcommand.c

In the function ACMD_FUNC(main)

search for:

 } else {
  if(!sd->state.mainchat) {
sd->state.mainchat = 1;
clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
  }
  if (sd->sc.data[sC_NOCHAT] && sd->sc.data[sC_NOCHAT]->val1&MANNER_NOCHAT) {
clif_displaymessage(fd, msg_txt(387));
return -1;
  }
  sprintf(atcmd_output, msg_txt(386), sd->status.name, message);
  // I use 0xFE000000 color for signalizing that this message is
  // main chat message. 0xFE000000 is invalid color, same using
  // 0xFF000000 for simple (not colored) GM messages. [LuzZza]
  intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0, 0, 0, 0);
  // Chat logging type 'M' / Main Chat
  log_chat(LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
 }

and replace it with the following:

 } else {
  if(!strstr(message, ":")) {
  if(!sd->state.mainchat) {
sd->state.mainchat = 1;
clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
  }
  if (sd->sc.data[sC_NOCHAT] && sd->sc.data[sC_NOCHAT]->val1&MANNER_NOCHAT) {
clif_displaymessage(fd, msg_txt(387));
return -1;
  }
  sprintf(atcmd_output, msg_txt(386), sd->status.name, message);
  // I use 0xFE000000 color for signalizing that this message is
  // main chat message. 0xFE000000 is invalid color, same using
  // 0xFF000000 for simple (not colored) GM messages. [LuzZza]
  intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0, 0, 0, 0);
  // Chat logging type 'M' / Main Chat
  log_chat(LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
 } else {
  clif_displaymessage(fd, "Invalid characters");
  }

 }

This will result in ignoring all messages containing ":" and displaying "Invalid characters" as a dispbottom instead.

Edited by Realusion
Posted
src/map/atcommand.c In the function ACMD_FUNC(main) search for:
 } else { if(!sd->state.mainchat) { sd->state.mainchat = 1; clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated. } if (sd->sc.data[sC_NOCHAT] && sd->sc.data[sC_NOCHAT]->val1&MANNER_NOCHAT) { clif_displaymessage(fd, msg_txt(387)); return -1; } sprintf(atcmd_output, msg_txt(386), sd->status.name, message); // I use 0xFE000000 color for signalizing that this message is // main chat message. 0xFE000000 is invalid color, same using // 0xFF000000 for simple (not colored) GM messages. [LuzZza] intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0, 0, 0, 0); // Chat logging type 'M' / Main Chat log_chat(LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); } 

and replace it with the following:

 } else { if(!strstr(message, ":")) { if(!sd->state.mainchat) { sd->state.mainchat = 1; clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated. } if (sd->sc.data[sC_NOCHAT] && sd->sc.data[sC_NOCHAT]->val1&MANNER_NOCHAT) { clif_displaymessage(fd, msg_txt(387)); return -1; } sprintf(atcmd_output, msg_txt(386), sd->status.name, message); // I use 0xFE000000 color for signalizing that this message is // main chat message. 0xFE000000 is invalid color, same using // 0xFF000000 for simple (not colored) GM messages. [LuzZza] intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0, 0, 0, 0); // Chat logging type 'M' / Main Chat log_chat(LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); } else { clif_displaymessage(fd, "Invalid characters"); } } 

This will result in ignoring all messages containing ":" and displaying "Invalid characters" as a dispbottom instead.

Thank you so much <3

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...