Convert a Source Code to Hercules

Clare

New member
Messages
52
Points
0
Location
Brazil
Emulator
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
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   },
 
Code:
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;}
 
Code:
ACMD_DEF(order),
 
and this can be done easily with bindcommand as well xD

 
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?
 
Last edited by a moderator:
Back
Top