Topic: how to make ann
Example :
Grade of Venomous- is Pro
so how can i make announcement like this
Announcement from Pro Venomous-: Test
this is my source code
static int _handle_announce_command(t_connection * c, char const *text)
{
unsigned int i;
t_message * message;
for (i=0; text[i]!=' ' && text[i]!='\0'; i++); /* skip command */
for (; text[i]==' '; i++);
if (text[i]=='\0')
{
message_send_text(c,message_type_info,c,"usage: /announce <announcement>");
return 0;
}
snprintf(msgtemp, sizeof(msgtemp), "Announcement from %.14 %.64s: %.128s",account_get_grade(account),conn_get_username(c),&text[i]);
if (!(message = message_create(message_type_broadcast,c,msgtemp)))
message_send_text(c,message_type_info,c,"Could not broadcast message.");
else
{
if (message_send_all(message)<0)
message_send_text(c,message_type_info,c,"Could not broadcast message.");
message_destroy(message);
}
return 0;
}
but that code is error
anyone can help me?