Hercules Posted August 31, 2012 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 104 Reputation: 1 Joined: 05/04/12 Last Seen: November 16, 2012 Share Posted August 31, 2012 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... Quote Link to comment Share on other sites More sharing options...
Euphy Posted August 31, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted August 31, 2012 Isn't this the same thing as @main? Quote Link to comment Share on other sites More sharing options...
Hercules Posted September 1, 2012 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 104 Reputation: 1 Joined: 05/04/12 Last Seen: November 16, 2012 Author Share Posted September 1, 2012 (edited) 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 September 1, 2012 by Hercules Quote Link to comment Share on other sites More sharing options...
Mystery Posted September 1, 2012 Group: Members Topic Count: 94 Topics Per Day: 0.02 Content Count: 2192 Reputation: 253 Joined: 11/11/11 Last Seen: June 24, 2020 Share Posted September 1, 2012 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; } . Quote Link to comment Share on other sites More sharing options...
Hercules Posted September 1, 2012 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 104 Reputation: 1 Joined: 05/04/12 Last Seen: November 16, 2012 Author Share Posted September 1, 2012 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?? Quote Link to comment Share on other sites More sharing options...
Yahiko Posted September 3, 2012 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 81 Reputation: 14 Joined: 08/17/12 Last Seen: April 19, 2013 Share Posted September 3, 2012 (edited) nvm Edited September 3, 2012 by Yahiko Quote Link to comment Share on other sites More sharing options...
Question
Hercules
Hello,I have a request command..
Gmes Command:
Each time a player types ,
e.g.
Skypirate types,
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.