• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Plugin] [HELP] Discord connector.
#1
I need help in this area, do not do anything about this and I need to do it urgently, I would like it if you could help me.



https://github.com/maddinat0r/samp-discord-connector
[Image: oN9R4KR.gif]

Away
  Reply
#2
What's the problem?
  Reply
#3
(2019-04-14, 10:16 AM)SyS Wrote: What's the problem?



Google translator



I would need the basics to adapt it to my GM, because I do not understand anything. An example, when a user sends an advertisement in SAMP, which is also sent in discord, for example in the channel # announcements-samp. I do not know if you can understand me.
[Image: oN9R4KR.gif]

Away
  Reply
#4
Supongo que ser?s hispanohablante. El enlace de github que has proporcionado es el Source Code para desarrolladores, aqu? te dejo el enlace que te dar? opci?n a elegir el plugin para la versi?n del SO que est?s usando para tu servidor (Debian, Linux, Windows) https://github.com/maddinat0r/samp-disco...r/releases.



Si tienes dudas col?calas y te ayudar?.
[Image: 9ea500ab1c153189c5497f141908ffab.png]

  Reply
#5
(2019-04-14, 10:28 AM)James Wrote: Supongo que ser?s hispanohablante. El enlace de github que has proporcionado es el Source Code para desarrolladores, aqu? te dejo el enlace que te dar? opci?n a elegir el plugin para la versi?n del SO que est?s usando para tu servidor (Debian, Linux, Windows) https://github.com/maddinat0r/samp-disco...r/releases.



Si tienes dudas col?calas y te ayudar?.



Muchas gracias.



Ya tengo descargada la versi?n de Windows, y acabo de colocar todos los archivos en la GM, hasta ahi llego, pero luego estoy super perdido, es mi primera vez haciendo esto, eso si tengo ya el bot creado y dentro de mi discord, pero esta OFFLINE, como procedo ahora.
[Image: oN9R4KR.gif]

Away
  Reply
#6
Add this plugin?

Code:
plugins?discord-connector



Add this line on your server.cfg

Code:
discord_bot_token TOKEN BOT



Add the include on your gamemode

Code:
#include <discord-connector>
[Image: 9ea500ab1c153189c5497f141908ffab.png]

  Reply
#7
(2019-04-14, 10:41 AM)James Wrote: Despu?s de a?adir a tu proyecto los archivos tendr?s que a?adir lo siguiente a tu server.cfg:

Code:
plugins?discord-connector (Tendr?s m?s de un plugin lo a?ades al final)



Creas abajo del todo de tu server.cfg una nueva l?nea con esto:

Code:
discord_bot_token INTRODUCE AQU? EL TOKEN DE TU BOT



Con pawnoscript abres tu proyecto .pwn y a?ades estos includes:

Code:
#include <discord-connector>



Cuando tengas todo esto implementado resp?ndeme y vamos con las funciones.



Listo, lo tengo, pero te aviso que mi BOT no tiene nada de codigo eh. Pasemos a lo siguiente :)
[Image: oN9R4KR.gif]

Away
  Reply
#8
Are compiled your gamemode?
[Image: 9ea500ab1c153189c5497f141908ffab.png]

  Reply
#9
(2019-04-14, 11:22 AM)James Wrote: ?Has compilado tu gamemode con el include a?adido?



Si, no da error.
[Image: oN9R4KR.gif]

Away
  Reply
#10
It's great that you're getting help but you're gonna have to keep the discussion in English in these sections.
  Reply
#11
Perfect, you can test the comun code for this plugin. This code send message of your channel when a user login.





Code:
new DCC_Channel:g_WelcomeChannelId;



public OnGameModeInit()

{

? ?DCC_Connect("El token de tu BOT que has a?adido a tu server.cfg ahora aqu?");

? ?return 1;

}



public OnPlayerSpawn(playerid)

{

? ?new name[MAX_PLAYER_NAME  1];

? ?GetPlayerName(playerid, name, sizeof name);

? ?

? ?if (_:g_WelcomeChannelId == 0)

? ? ? ?g_WelcomeChannelId = DCC_FindChannelById("PON LA ID"); // Introduce aqu? el ID del canal donde quieras que aparezca el mensaje. Tendr?s que tener el modo developer activado de Discord.

? ?

? ?new str[128];

? ?format(str, sizeof str, "El jugador %s ha entrado a Nombre de tu servidor.", name); // El %s se reemplazar? por el nick que tenga el jugador.

? ?DCC_SendChannelMessage(g_WelcomeChannelId, msg);

? ?return 1;

}



public DCC_OnChannelMessage(DCC_Channel:channel, const author[], const message[])

{

? ?new channel_name[32];

? ?DCC_GetChannelName(channel, channel_name);



? ?new str[145];

? ?format(str, sizeof str, "[Discord/%s] %s: %s", channel_name, author, message);

? ?SendClientMessageToAll(-1, str);

? ?return 1;

} ?



Edit: I translate this message for respect the Burgershot's rules.
[Image: 9ea500ab1c153189c5497f141908ffab.png]

  Reply
#12
(2019-04-14, 12:43 PM)TommyB Wrote: It's great that you're getting help but you're gonna have to keep the discussion in English in these sections.

OK sorry.

(2019-04-14, 12:46 PM)James Wrote: Perfect, you can test the comun code for this plugin. This code send message of your channel when a user login.


Code:
new DCC_Channel:g_WelcomeChannelId;

public OnGameModeInit()
{
? ?DCC_Connect("El token de tu BOT que has a?adido a tu server.cfg ahora aqu?");
? ?return 1;
}

public OnPlayerSpawn(playerid)
{
? ?new name[MAX_PLAYER_NAME  1];
? ?GetPlayerName(playerid, name, sizeof name);
? ?
? ?if (_:g_WelcomeChannelId == 0)
? ? ? ?g_WelcomeChannelId = DCC_FindChannelById("PON LA ID"); // Introduce aqu? el ID del canal donde quieras que aparezca el mensaje. Tendr?s que tener el modo developer activado de Discord.
? ?
? ?new str[128];
? ?format(str, sizeof str, "El jugador %s ha entrado a Nombre de tu servidor.", name); // El %s se reemplazar? por el nick que tenga el jugador.
? ?DCC_SendChannelMessage(g_WelcomeChannelId, msg);
? ?return 1;
}

public DCC_OnChannelMessage(DCC_Channel:channel, const author[], const message[])
{
? ?new channel_name[32];
? ?DCC_GetChannelName(channel, channel_name);

? ?new str[145];
? ?format(str, sizeof str, "[Discord/%s] %s: %s", channel_name, author, message);
? ?SendClientMessageToAll(-1, str);
? ?return 1;
} ?

Edit: I translate this message for respect the Burgershot's rules.

I already did, I put that in the GM.
error: error 017: undefined symbol "DCC_Connect"
error: error 017: undefined symbol "msg"
[Image: oN9R4KR.gif]

Away
  Reply
#13
Change 'msg' for 'str2'.?With this change you're can't have error.
[Image: 9ea500ab1c153189c5497f141908ffab.png]

  Reply
#14
(2019-04-14, 12:46 PM)James Wrote: Perfect, you can test the comun code for this plugin. This code send message of your channel when a user login.





Code:
new DCC_Channel:g_WelcomeChannelId;



public OnGameModeInit()

{

? ?DCC_Connect("El token de tu BOT que has a?adido a tu server.cfg ahora aqu?");

? ?return 1;

}



public OnPlayerSpawn(playerid)

{

? ?new name[MAX_PLAYER_NAME  1];

? ?GetPlayerName(playerid, name, sizeof name);

? ?

? ?if (_:g_WelcomeChannelId == 0)

? ? ? ?g_WelcomeChannelId = DCC_FindChannelById("PON LA ID"); // Introduce aqu? el ID del canal donde quieras que aparezca el mensaje. Tendr?s que tener el modo developer activado de Discord.

? ?

? ?new str[128];

? ?format(str, sizeof str, "El jugador %s ha entrado a Nombre de tu servidor.", name); // El %s se reemplazar? por el nick que tenga el jugador.

? ?DCC_SendChannelMessage(g_WelcomeChannelId, msg);

? ?return 1;

}



public DCC_OnChannelMessage(DCC_Channel:channel, const author[], const message[])

{

? ?new channel_name[32];

? ?DCC_GetChannelName(channel, channel_name);



? ?new str[145];

? ?format(str, sizeof str, "[Discord/%s] %s: %s", channel_name, author, message);

? ?SendClientMessageToAll(-1, str);

? ?return 1;

} ?



Edit: I translate this message for respect the Burgershot's rules.

I don't know which version you use of the Discord plugin, but DCC_Connect doesn't exists.



I have it kinda like this in my server, maybe you can use it:?https://pastebin.com/hwsWbRr4
  Reply
#15
tomorrow test
[Image: oN9R4KR.gif]

Away
  Reply
#16
closed pls, thanks all
[Image: oN9R4KR.gif]

Away
  Reply


Forum Jump: