Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] The Source Code → its posible ? (new commands)

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 8

1

Topic: its posible ? (new commands)

you can create new commands in pvpgn
to send messages all server.

Example:

/1
Welcome to server d2 .....

/2
Have a nice day...

2

Re: its posible ? (new commands)

Yes it is possible. You mean write message to all users.  Isn't it? You should add command like an announce but it should work work green color and it should send message by pvpgn in message type.

livestar@mail.ua

3

Re: its posible ? (new commands)

static int _handle_command1_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: /command1 <text>");
    return 0;
  }

  snprintf(msgtemp, sizeof(msgtemp), "%.128s", &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;
}

For example:

/command1 Have a nice day...

In server answer:

Have a nice day...

4

Re: its posible ? (new commands)

where you have to add the lines ?

5

Re: its posible ? (new commands)

Commands.cpp

6

Re: its posible ? (new commands)

I am new in this. sorry
that file is modified
of which folder. pvpgn or d2gs

7

Re: its posible ? (new commands)

what do you want?

8

Re: its posible ? (new commands)

where  add those lines
what file modified?

Posts: 8

Pages 1

You must login or register to post a reply

Who now at forum

Currently view post: 0 guests, 0 registered users

forums.pvpgn.pro → [EN] The Source Code → its posible ? (new commands)