Hercules Posted August 31, 2012 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
Hercules Posted September 1, 2012 Author 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
Mystery Posted September 1, 2012 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
Hercules Posted September 1, 2012 Author 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
Yahiko Posted September 3, 2012 Posted September 3, 2012 (edited) nvm Edited September 3, 2012 by Yahiko Quote
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...
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.