Clare 0 Posted April 19, 2015 someone could help me make this code work in Hercules? I've tried some times, but no have success, so if possible I would be grateful if can show me where also made changes to make the functional code.yes, I am using a translator Here the full code @@ -8634,6 +8665,46 @@ } /*==========================================+* @order [Shiraz]+* --> Pequena mod para aparecer nome do líder [Hold]+*------------------------------------------*/+ACMD_FUNC(order)+{+ struct s_mapiterator* count = mapit_getallusers();+ struct map_session_data *pl_sd;+ struct guild* member;+ int len;++ memset(atcmd_output, '0', sizeof(atcmd_output));+ + if(!(member = guild->search(sd->status.guild_id)) || !strstr(member->master,sd->status.name))+ {+ clif_displaymessage(sd->fd, "Você não é o líder do clã.");+ return -1;+ }+ + if(!(strlen(message)))+ {+ clif_displaymessage(sd->fd, "Você precisa digitar uma mensagem.");+ return -1;+ }++ sprintf(atcmd_output, "[Líder] %s : %s", sd->status.name, message);++ len = strlen(atcmd_output);++ for(pl_sd = (TBL_PC*)mapit_first(count); mapit_exists(count); pl_sd = (TBL_PC*)mapit_next(count))+ {+ if(pl_sd->status.guild_id != sd->status.guild_id)+ continue;+ clif_broadcast(&pl_sd->bl, atcmd_output, len, 0x10, SELF);+ }+ + mapit_free(count);+ return 0;+}++/*========================================== @@ -8937,6 +9009,7 @@ { "font", 1,1, atcommand_font }, // brAthena Modificações { "whosell", 1,1, atcommand_whosell },+ { "order", 0,99, atcommand_order }, Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted April 19, 2015 ACMD(order){ struct s_mapiterator* count = mapit_getallusers(); struct map_session_data *pl_sd; struct guild* member; int len; memset(atcmd_output, '0', sizeof(atcmd_output)); if(!(member = guild->search(sd->status.guild_id)) || !strstr(member->master,sd->status.name)) { clif->message(sd->fd, "Voce nao e o lider do cla."); return -1; } if(!(strlen(message))) { clif->message(sd->fd, "Voce precisa digitar uma mensagem."); return -1; } sprintf(atcmd_output, "[Lider] %s : %s", sd->status.name, message); len = strlen(atcmd_output); for(pl_sd = (TBL_PC*)mapit->first(count); mapit->exists(count); pl_sd = (TBL_PC*)mapit->next(count)) { if(pl_sd->status.guild_id != sd->status.guild_id) continue; clif->broadcast(&pl_sd->bl, atcmd_output, len, 0x10, SELF); } mapit->free(count); return 0;} ACMD_DEF(order), 1 Clare reacted to this Quote Share this post Link to post Share on other sites
0 evilpuncker 503 Posted April 19, 2015 and this can be done easily with bindcommand as well xD 1 Clare reacted to this Quote Share this post Link to post Share on other sites
0 Clare 0 Posted April 19, 2015 (edited) I swear I spent two hours trying to make it work, but not really have no experience with the source editing, thank you for help if it is not too much to ask, could help me with this other code? Edited April 20, 2015 by Suzuya Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted April 20, 2015 I recommend you to install this command http://herc.ws/board/topic/3285-script-command-addrid/ Quote Share this post Link to post Share on other sites
0 Clare 0 Posted April 20, 2015 Thank you very much @@Angelmelodyyou solved my problem Quote Share this post Link to post Share on other sites
yes, I am using a translator
Here the full code
Share this post
Link to post
Share on other sites