Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] The Source Code → How to create command /history <ID> = /w Bot !history <ID>

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 5

1

Topic: How to create command /history <ID> = /w Bot !history <ID>

How to create command /history <ID> = /w bot !history <ID> ?

this is my code but error:

static int _handle_history_command(t_connection * c, char const *text)
{
   unsigned int i;
  t_connection *    user;
  t_game     *    game;
  for (i=0; text[i]!=' ' && text[i]!='\0'; i++); /* skip command */
  for (; text[i]==' '; i++);

  if (text[0]=='*')
    text++;

  if (text[0]=='\0')
    {
      message_send_text(c,message_type_info,c,"usage: /history <username>");
      return 0;
    }
{    
if ((user = connlist_find_connection_by_accountname("BOT")))
do_whisper(c,"BOT","!history %.128s",&text[i]);
else
snprintf(msgtemp, sizeof(msgtemp), "");
message_send_text(c,message_type_info,c,msgtemp);
return 0;
}
return 0;
}

error:

2>..\..\..\source\src\bnetd\command.cpp(723): error C2660: 'pvpgn::bnetd::do_whisper' : function does not take 4 arguments
2>..\..\..\source\src\bnetd\command.cpp(1306): warning C4146: unary minus operator applied to unsigned type, result still unsigned

please help me HarpyWar smile

2

Re: How to create command /history <ID> = /w Bot !history <ID>

Added:

char const * bot="NameBot";

and change this

if ((user = connlist_find_connection_by_accountname("BOT")))
do_whisper(c,"BOT","!history %.128s",&text[i]);
else{
snprintf(msgtemp, sizeof(msgtemp), "");
message_send_text(c,message_type_info,c,msgtemp);
}
return 0;

change to

snprintf(msgtemp, sizeof(msgtemp), "!history %s",&text[i]);
do_whisper(c,bot,msgtemp);

3

Re: How to create command /history <ID> = /w Bot !history <ID>

ok...

nice share zeloit

iam chat your fb ..
please reply smile

4 (edited by Zeloit 23.05.2013 10:28)

Re: How to create command /history <ID> = /w Bot !history <ID>

Zeloit wrote:

not now..

i'm broken heart now

5

Re: How to create command /history <ID> = /w Bot !history <ID>

Zeloit thx ! I'm done

Posts: 5

Pages 1

You must login or register to post a reply

Who now at forum

Currently view post: 1 guest, 0 registered users

forums.pvpgn.pro → [EN] The Source Code → How to create command /history <ID> = /w Bot !history <ID>



Generated in 0.072 seconds (81% PHP - 19% DB) with 20 queries