(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"