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...
PvPGN Community Forums |
forums.pvpgn.pro → [EN] The Source Code → 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...
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.
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...
where you have to add the lines ?
I am new in this. sorry
that file is modified
of which folder. pvpgn or d2gs
what do you want?
where add those lines
what file modified?
forums.pvpgn.pro → [EN] The Source Code → its posible ? (new commands)