Jump to content
  • 0

Global Message Command


Hercules

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  104
  • Reputation:   1
  • Joined:  05/04/12
  • Last Seen:  

Hello,I have a request command..

Gmes Command:

Each time a player types ,

@gmes "Message Here"

e.g.

Skypirate types,

@gmes Thank You!!

The players will receive his message like this.

[Global] Skypirate : Thank You!!

[Global] NAME : MESSAGE

~All online players will receive the message with this COLOR but it has an interval of 1minute before he can use @gmes command again.

~A player can still deactivate or activate this command by typing "@gmes" alone.

~The player who deactivates @gmes,the player will not receive the gmes messages.

Thanks in future...

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Isn't this the same thing as @main?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  104
  • Reputation:   1
  • Joined:  05/04/12
  • Last Seen:  

Isn't this the same thing as @main?

Yeah.It is like @main,

How can i rename @main into @gmes and change the color instead of yellow to this COLOR?

And how can i add an interval of 1 minute to prevent spamming?

And also,i want this kind of format.

[Global] NAME : MESSAGE

Please help me..i want it to apply on my server

Edited by Hercules
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

To make an aliases of @main, go here: https://rathena.svn....and_athena.conf go to the end where it says kill: ["die"]

and add:

main: ["gmes"]

save and exit.

/* Command aliases
You can define aliases for any command. Aliases work just like original
command.
Format is
<commandname>: ["<alias>", ...]
*/

However, for the colour and format the way you want it.. you need to go here: https://rathena.svn....map/atcommand.c

and find what to change in here :/


/*===================================
* Main chat [LuzZza]
* Usage: @main <on|off|message>
*-----------------------------------*/
ACMD_FUNC(main)
{
if( message[0] ) {

	if(strcmpi(message, "on") == 0) {
		if(!sd->state.mainchat) {
			sd->state.mainchat = 1;
			clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
		} else {
			clif_displaymessage(fd, msg_txt(381)); // Main chat already activated.
		}
	} else if(strcmpi(message, "off") == 0) {
		if(sd->state.mainchat) {
			sd->state.mainchat = 0;
			clif_displaymessage(fd, msg_txt(382)); // Main chat has been disabled.
		} else {
			clif_displaymessage(fd, msg_txt(383)); // Main chat already disabled.
		}
	} 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;
		}

		if ( battle_config.min_chat_delay ) {
			if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 )
				return 0;
			sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
		}

		// send the message using inter-server system
		intif_main_message( sd, message );
	}

} else {

	if(sd->state.mainchat)
		clif_displaymessage(fd, msg_txt(384)); // Main chat currently enabled. Usage: @main <on|off>, @main <message>.
	else
		clif_displaymessage(fd, msg_txt(385)); // Main chat currently disabled. Usage: @main <on|off>, @main <message>.
}
return 0;
}

.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  104
  • Reputation:   1
  • Joined:  05/04/12
  • Last Seen:  

To make an aliases of @main, go here: https://rathena.svn....and_athena.conf go to the end where it says kill: ["die"]

and add:

main: ["gmes"]

save and exit.

/* Command aliases
You can define aliases for any command. Aliases work just like original
command.
Format is
<commandname>: ["<alias>", ...]
*/

However, for the colour and format the way you want it.. you need to go here: https://rathena.svn....map/atcommand.c

and find what to change in here :/


/*===================================
* Main chat [LuzZza]
* Usage: @main <on|off|message>
*-----------------------------------*/
ACMD_FUNC(main)
{
if( message[0] ) {

	if(strcmpi(message, "on") == 0) {
		if(!sd->state.mainchat) {
			sd->state.mainchat = 1;
			clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
		} else {
			clif_displaymessage(fd, msg_txt(381)); // Main chat already activated.
		}
	} else if(strcmpi(message, "off") == 0) {
		if(sd->state.mainchat) {
			sd->state.mainchat = 0;
			clif_displaymessage(fd, msg_txt(382)); // Main chat has been disabled.
		} else {
			clif_displaymessage(fd, msg_txt(383)); // Main chat already disabled.
		}
	} 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;
		}

		if ( battle_config.min_chat_delay ) {
			if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 )
				return 0;
			sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
		}

		// send the message using inter-server system
		intif_main_message( sd, message );
	}

} else {

	if(sd->state.mainchat)
		clif_displaymessage(fd, msg_txt(384)); // Main chat currently enabled. Usage: @main <on|off>, @main <message>.
	else
		clif_displaymessage(fd, msg_txt(385)); // Main chat currently disabled. Usage: @main <on|off>, @main <message>.
}
return 0;
}

.

i'm sorry but i don't understand this..

What line will i change for the format and the color??

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   14
  • Joined:  08/17/12
  • Last Seen:  

nvm

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