zmref Posted February 17, 2013 Group: Members Topic Count: 148 Topics Per Day: 0.03 Content Count: 299 Reputation: 6 Joined: 06/14/12 Last Seen: March 30, 2013 Share Posted February 17, 2013 *=================================== * 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; } // 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; } How to put a delay time of 30 seconds per @main shout? what do I put and where? please help Quote Link to comment Share on other sites More sharing options...
Emistry Posted February 17, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2371 Joined: 10/28/11 Last Seen: Tuesday at 12:58 PM Share Posted February 17, 2013 you can refer this ...and edit your @main @go_delay_when_hit Quote Link to comment Share on other sites More sharing options...
zmref Posted February 17, 2013 Group: Members Topic Count: 148 Topics Per Day: 0.03 Content Count: 299 Reputation: 6 Joined: 06/14/12 Last Seen: March 30, 2013 Author Share Posted February 17, 2013 (edited) you can refer this ...and edit your @main @go_delay_when_hit not working We are still in the @go function scroll down until you find this inside the function:nullpo_retr(-1, sd); then add below: if(DIFF_TICK(sd->warpgodelay_tick,tick)>0) { //This is for computing the delay if the cooldown or delay is not yet finish restrict using @go clif_displaymessage(fd,"There is a 5 seconds delay in using @go command"); return 0; } here's mine *=================================== * Main chat [LuzZza] * Usage: @main <on|off|message> *-----------------------------------*/ ACMD_FUNC(main) { unsigned int tick = gettick(); //@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(DIFF_TICK(sd->maindelay_tick,tick)>0) { //This is for computing the delay if the cooldown or delay is not yet finish restrict using @main clif_displaymessage(fd,"There is a 30 seconds delay in using @main command"); return 0; } // 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; } there's no nullpo_retr(-1, sd); so that's why I put the command somewhere please correct me. Edited February 17, 2013 by zmref Quote Link to comment Share on other sites More sharing options...
zmref Posted February 17, 2013 Group: Members Topic Count: 148 Topics Per Day: 0.03 Content Count: 299 Reputation: 6 Joined: 06/14/12 Last Seen: March 30, 2013 Author Share Posted February 17, 2013 Hi can anybody script me the @main with 30 secs delay to use and only the GM can use @main on and off not the normal player. the normal player only uses @main with 30 secs delay Quote Link to comment Share on other sites More sharing options...
Question
zmref
How to put a delay time of 30 seconds per @main shout? what do I put and where? please help
Link to comment
Share on other sites
3 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.