SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 28/03/2018, 04:35 PM   #151
AlejandroOrtega
Banned
 
Join Date: Jan 2017
Location: Bulgaria
Posts: 19
Reputation: 6
Default Re: Discord Connector

I've been waiting on a thing like that for a long time, good job, and thanks!
AlejandroOrtega is offline   Reply With Quote
Old 02/04/2018, 05:54 PM   #152
Mike861
Big Clucker
 
Mike861's Avatar
 
Join Date: Feb 2018
Location: Serbia
Posts: 152
Reputation: 12
Default Re: Discord Connector

Code:
Vault.pwn(17588) : error 017: undefined symbol "msg"
Vault.pwn(17593) : error 021: symbol already defined: "name"
Vault.pwn(17593) : symbol is assigned a value that is never used: "name"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2016, ITB CompuPhase


2 Errors.
I've tried the example from the thread, im getting these errors.What to do?
Edit: Fixed.

Last edited by Mike861; 02/04/2018 at 07:35 PM.
Mike861 is offline   Reply With Quote
Old 11/04/2018, 09:01 PM   #153
DeitY
Huge Clucker
 
DeitY's Avatar
 
Join Date: Aug 2012
Location: Serbia
Posts: 324
Reputation: 14
Default Re: Discord Connector

There is no libssl 1.1.0 for 64 bit?

https://www.openssl.org/source/old/1.1.0/

I've got this, but its x86. Whenever i start server it shows ->
[22:49:00] Loading plugin: discord-connector.so
[22:49:00] Failed (libssl.so.1.1: wrong ELF class: ELFCLASS64)

I'm using debian stretch 64 bit.
__________________
Serbian RolePlay Server! 5+ Years SAMP server, 3+ years highest number of players in balcan!

DeitY is offline   Reply With Quote
Old 12/04/2018, 08:56 PM   #154
RANGER44
Big Clucker
 
RANGER44's Avatar
 
Join Date: Oct 2016
Location: [SA-MP]
Posts: 80
Reputation: 25
Default Re: Discord Connector

I am a experienced member of Discord but never tried to know something like this, Good Job, Feel free to ask me by PM regarding discord error.
RANGER44 is offline   Reply With Quote
Old 25/04/2018, 10:15 AM   #155
LegendAbdullah
Banned
 
Join Date: Dec 2017
Location: Rahim Yar Khan,Pakistan
Posts: 59
Reputation: 10
Default Re: Discord Connector

Quote:
Example code
Code:
new DCC_Channel:g_WelcomeChannelId;

public OnPlayerSpawn(playerid)
{
new name[MAX_PLAYER_NAME + 1];
GetPlayerName(playerid, name, sizeof name);

if (_:g_WelcomeChannelId == 0)
g_WelcomeChannelId = DCC_FindChannelById("388423556721672192"); // Discord channel ID

new str[128];
format(str, sizeof str, "Player %s joined the server.", name);
DCC_SendChannelMessage(g_WelcomeChannelId, msg);
return 1;
}

public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
{
new channel_name[100 + 1];
if(!DCC_GetChannelName(channel, channel_name))
return 0; // invalid channel

new user_name[32 + 1];
if (!DCC_GetUserName(author, user_name))
return 0; // invalid user

new str[145];
format(str, sizeof str, "[Discord/%s] %s: %s", channel_name, user_name, message);
SendClientMessageToAll(-1, str);
return 1;
}
What to do with it
LegendAbdullah is offline   Reply With Quote
Old 30/04/2018, 08:31 AM   #156
QuaTTrO
Gangsta
 
QuaTTrO's Avatar
 
Join Date: Aug 2009
Posts: 575
Reputation: 75
Default Re: Discord Connector

Awesome plugin, i wish it had more control over message reactions and channel pins. Some admin stuff would be neat too.
__________________



Last edited by QuaTTrO; 07/05/2018 at 05:56 PM.
QuaTTrO is offline   Reply With Quote
Old 20/05/2018, 08:34 PM   #157
JR_Junior
Huge Clucker
 
Join Date: Nov 2011
Location: Brazil
Posts: 228
Reputation: 52
Default Re: Discord Connector

Quote:
Originally Posted by Develerux View Post
Please can you update to "special chars"

Chars:
` -> like discord syntax example -> ```text```
б, й, ű, ъ, ő, у, ь, ц
utf-8 maybe or idk
Here is the solution

Download this include: https://github.com/oscar-broman/strl...ter/strlib.inc

Before sending a message to Discord:
PHP Code:
    new str[50],dest[50];
    
format(strsizeof str"б, й, ű, ъ, ő, у, ь, ц");
    
utf8encode(deststr);
    
DCC_SendChannelMessage(YOUR_CHANNEL_IDdest); 
Before sending a message to Server:
PHP Code:
public DCC_OnChannelMessage(DCC_Channel:channelDCC_User:author, const message[])
{
    new 
channel_name[100 1];
    if(!
DCC_GetChannelName(channelchannel_name))
        return 
0// invalid channel

    
new user_name[32 1];
    if (!
DCC_GetUserName(authoruser_name))
        return 
0// invalid user

    
new str[145],dest[145];
    
format(strsizeof str"[Discord: %s] %s: %s"channel_nameuser_namemessage);
    
utf8decode(deststr);
    
SendClientMessageToAll(-1dest);
    return 
1;

This worked perfectly for me!

Last edited by JR_Junior; 20/05/2018 at 11:46 PM. Reason: Small fixes
JR_Junior is offline   Reply With Quote
Old 22/05/2018, 06:11 PM   #158
JR_Junior
Huge Clucker
 
Join Date: Nov 2011
Location: Brazil
Posts: 228
Reputation: 52
Default Re: Discord Connector

Is it possible to mention a user in a message?
Thanks.
JR_Junior is offline   Reply With Quote
Old 22/05/2018, 07:47 PM   #159
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Russia
Posts: 3,353
Reputation: 822
Default Re: Discord Connector

Quote:
Originally Posted by JR_Junior View Post
Is it possible to mention a user in a message?
Thanks.
Try to insert @Username#UserTag or <@!UserId> and see your luck
__________________
Find me on GitHubSEF Community (Official NEF Successor) • SA:MP ReviewsFind me on Steam
Kaperstone is offline   Reply With Quote
Old 22/05/2018, 08:11 PM   #160
maddinat0r
Gangsta
 
maddinat0r's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 892
Reputation: 473
Default Re: Discord Connector

As Kaperstone correctly stated, "<@!UserId>" (without the quotes) is the correct syntax.
maddinat0r is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] Teamspeak Connector maddinat0r Plugin Development 323 03/07/2018 06:24 PM
Route Connector James_Braga Русский/Russian 9 15/05/2015 08:24 AM
[Map] Connector Gas Tellken Maps 4 01/06/2012 03:04 AM
PSU connector help! patchkinson Everything and Nothing 3 20/03/2010 09:24 PM


All times are GMT. The time now is 06:28 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.