Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Plugin] [HELP] Discord connector.

 
  • 0 Vote(s) - 0 Average
Plugin [HELP] Discord connector.
Mugsy Away

Desarollador
Posts: 171
Threads: 10
Joined: Apr 2019
Reputation: 0
Location: Spain
#1
2019-04-14, 10:03 AM
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]
SyS
Offline

Burgershot Member
Posts: 37
Threads: 5
Joined: Apr 2019
Reputation: 4
#2
2019-04-14, 10:16 AM
What's the problem?
Mugsy Away

Desarollador
Posts: 171
Threads: 10
Joined: Apr 2019
Reputation: 0
Location: Spain
#3
2019-04-14, 10:20 AM
(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]
James
Offline

Developer of Port Royal
Posts: 31
Threads: 4
Joined: Apr 2019
Reputation: 3
#4
2019-04-14, 10:28 AM
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]
Mugsy Away

Desarollador
Posts: 171
Threads: 10
Joined: Apr 2019
Reputation: 0
Location: Spain
#5
2019-04-14, 10:33 AM
(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]
James
Offline

Developer of Port Royal
Posts: 31
Threads: 4
Joined: Apr 2019
Reputation: 3
#6
2019-04-14, 10:41 AM (This post was last modified: 2019-04-14, 12:54 PM by James.)
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]
Mugsy Away

Desarollador
Posts: 171
Threads: 10
Joined: Apr 2019
Reputation: 0
Location: Spain
#7
2019-04-14, 10:45 AM
(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]
James
Offline

Developer of Port Royal
Posts: 31
Threads: 4
Joined: Apr 2019
Reputation: 3
#8
2019-04-14, 11:22 AM (This post was last modified: 2019-04-14, 12:53 PM by James.)
Are compiled your gamemode?
[Image: 9ea500ab1c153189c5497f141908ffab.png]
Mugsy Away

Desarollador
Posts: 171
Threads: 10
Joined: Apr 2019
Reputation: 0
Location: Spain
#9
2019-04-14, 11:26 AM
(2019-04-14, 11:22 AM)James Wrote: ¿Has compilado tu gamemode con el include añadido?

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

discord-connector #1 fan

Posts: 34
Threads: 3
Joined: Feb 2019
Reputation: 6
Location: Texas, USA
#10
2019-04-14, 12:43 PM (This post was last modified: 2019-04-14, 12:45 PM by TommyB.)
It's great that you're getting help but you're gonna have to keep the discussion in English in these sections.
James
Offline

Developer of Port Royal
Posts: 31
Threads: 4
Joined: Apr 2019
Reputation: 3
#11
2019-04-14, 12:46 PM (This post was last modified: 2019-04-14, 12:50 PM by James.)
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]
Mugsy Away

Desarollador
Posts: 171
Threads: 10
Joined: Apr 2019
Reputation: 0
Location: Spain
#12
2019-04-14, 12:57 PM (This post was last modified: 2019-04-14, 12:59 PM by Mugsy.)
(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]
James
Offline

Developer of Port Royal
Posts: 31
Threads: 4
Joined: Apr 2019
Reputation: 3
#13
2019-04-14, 06:43 PM
Change 'msg' for 'str2'. With this change you're can't have error.
[Image: 9ea500ab1c153189c5497f141908ffab.png]
BlackBank
Offline

Burgershot Member
Posts: 13
Threads: 0
Joined: Apr 2019
Reputation: 0
Location: The Netherlands
#14
2019-04-14, 07:21 PM
(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
Mugsy Away

Desarollador
Posts: 171
Threads: 10
Joined: Apr 2019
Reputation: 0
Location: Spain
#15
2019-04-14, 09:06 PM
tomorrow test
[Image: oN9R4KR.gif]
Mugsy Away

Desarollador
Posts: 171
Threads: 10
Joined: Apr 2019
Reputation: 0
Location: Spain
#16
2019-04-15, 11:53 AM
closed pls, thanks all
[Image: oN9R4KR.gif]
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode