Topic: [ask]how to make a command
hello
i want to ask how to make a command like /ann ?
if /ann, it will broadcast to all user.
but if /ann1, it will message to a person
i use command: /ann1 Hello.. How are you ?
you whisper to BOT: Hello.. How are you ?
this is my code
static int _handle_ann1_command(t_connection * c, char const *text)
{
unsigned int i;
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: /ann1 <text>");
return 0;
}
snprintf(msgtemp, sizeof(msgtemp), "BOT");
do_whisper(c,msgtemp,"%.128s",&text[i]);
return 0;
}
but when i use like this..
it will says "
1>..\..\..\src\bnetd\command.cpp(616) : error C2660: 'pvpgn::bnetd::do_whisper' : function does not take 4 arguments
1>..\..\..\src\bnetd\command.cpp(840) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
please correct my code
Thanks~