SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 01/08/2017, 02:46 PM   #71
Xeon
Banned
 
Join Date: Jul 2017
Location: Earth
Posts: 526
Reputation: 96
Default Re: Discord Connector

Quote:
Originally Posted by kernel32 View Post
Discord incorrectly displays Cyrillic alphabet.
well, at moment even samp doesn't support Cyrillic alphabet only IRC do. because of encoding or something like that.
Xeon is offline   Reply With Quote
Old 01/08/2017, 04:00 PM   #72
Crystallize
High-roller
 
Join Date: Aug 2013
Posts: 1,582
Reputation: 308
Default Re: Discord Connector

Quote:
Originally Posted by XeonMaster View Post
hmm, i have an idea on this.

its possible to create an table on SQLite/MySQL Database named `DDC_Admins` on it you will put columns
Name and Admin level

and you need to use this callback
PHP Code:
forward DCC_OnChannelMessage(DCC_Channel:channel, const author[], const message[]); 
when he use !ban or $ban call it as you want. you should check if author name is exists on DDC_Admins on databse,
if its exists check the level of name. then allow the command

here is an expl of it

PHP Code:
DCCMD:ban(channel[], user[], params[])
{   
    new 
query[71], Cache:getCacherows;
    
mysql_format(querysizeof(query), "SELECT * FROM `DDC_Admins` WHERE `Name` = '%e'"user);
    
getCache mysql_query(connquery);
    
cache_get_row_count(rows);
    if(
rows != 0)
    {
        new 
admin;
        
cache_get_value_int(0"Admin"admin);
        if(
admin 2) return DCC_SendChannelMessage(echo, "Sorry, you can't use this command.");
        
cache_delete(getCache);
        
// Your ban command here
        
return 1;
    }
    else return 
DCC_SendChannelMessage(echo, "Sorry, you can't use this command.");
    return 
1;

or you can use it from your users database directly by adding Discordname column in end of table and add editing it by command ingame

Here's Discord command processor: http://forum.sa-mp.com/showthread.ph...95#post3908995


or simply allow ban command only from crew channel in discord
Cool, thanks
__________________
SAMP BATTLE GROUNDS
87.98.241.207:7780
Crystallize is offline   Reply With Quote
Old 01/08/2017, 07:09 PM   #73
kernel32
Little Clucker
 
kernel32's Avatar
 
Join Date: Sep 2016
Posts: 19
Reputation: 0
Default Re: Discord Connector

Quote:
Originally Posted by XeonMaster View Post
well, at moment even samp doesn't support Cyrillic alphabet only IRC do. because of encoding or something like that.
In SAMP Cyrillic is not supported only in nick's, otherwise everything is ok
kernel32 is offline   Reply With Quote
Old 02/08/2017, 12:16 AM   #74
Zorono
Huge Clucker
 
Zorono's Avatar
 
Join Date: Dec 2015
Location: Africa, Egypt, Alexandria
Posts: 362
Reputation: 30
Default Re: Discord Connector

Quote:
Originally Posted by XeonMaster View Post
hmm, i have an idea on this.

its possible to create an table on SQLite/MySQL Database named `DDC_Admins` on it you will put columns
Name and Admin level

and you need to use this callback
PHP Code:
forward DCC_OnChannelMessage(DCC_Channel:channel, const author[], const message[]); 
when he use !ban or $ban call it as you want. you should check if author name is exists on DDC_Admins on databse,
if its exists check the level of name. then allow the command

here is an expl of it

PHP Code:
DCCMD:ban(channel[], user[], params[])
{   
    new 
query[71], Cache:getCacherows;
    
mysql_format(connquerysizeof(query), "SELECT * FROM `DDC_Admins` WHERE `Name` = '%e'"user);
    
getCache mysql_query(connquery);
    
cache_get_row_count(rows);
    if(
rows != 0)
    {
        new 
admin;
        
cache_get_value_name_int(0"Admin"admin);
        if(
admin 2) return DCC_SendChannelMessage(echo, "Sorry, you can't use this command.");
        
cache_delete(getCache);
        
// Your ban command here
        
return 1;
    }
    else return 
DCC_SendChannelMessage(echo, "Sorry, you can't use this command.");
    return 
1;

or you can use it from your users database directly by adding Discordname column in end of table and add editing it by command ingame

Here's Discord command processor: http://forum.sa-mp.com/showthread.ph...95#post3908995


or simply allow ban command only from crew channel in discord
Good job @Xeon, how ever we can't this Discord command proccessor for administrative use we need something like
Code:
native IsUserInRole(userid, role); --> if(IsUserInRole(userid, 'general')) {...}
i hope to see new Plugin/Include updates as soon as possible
Zorono is offline   Reply With Quote
Old 10/08/2017, 04:06 PM   #75
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 161
Reputation: 0
Default Re: Discord Connector

For what this can by used?
Bussyman is offline   Reply With Quote
Old 11/09/2017, 09:57 AM   #76
maxisaibot
Big Clucker
 
maxisaibot's Avatar
 
Join Date: Jun 2011
Location: Israel
Posts: 62
Reputation: 3
Default Re: Discord Connector

maddinat0r please update logcore
__________________
maxisaibot is offline   Reply With Quote
Old 12/09/2017, 05:20 AM   #77
Arthur Kane
Gangsta
 
Join Date: Sep 2012
Posts: 766
Reputation: 115
Default Re: Discord Connector

Don't know if this is still being actively developed but encountered a crash.
PHP Code:
[00:43:03] [debugServer crashed due to an unknown error
[00:43:03] [debugNative backtrace:
[
00:43:03] [debug#0 e484f180 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so
[00:43:03] [debug#1 e4847064 in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () from plugins/crashdetect.so
[00:43:03] [debug#2 e4847d64 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () from plugins/crashdetect.so
[00:43:03] [debug#3 e4849cdb in _ZN11CrashDetect7OnCrashERKN2os7ContextE () from plugins/crashdetect.so
[00:43:03] [debug#4 e484e4d5 in ?? () from plugins/crashdetect.so
[00:43:03] [debug#5 e4c2f410 in __kernel_rt_sigreturn () from linux-gate.so.1
[00:43:03] [debug#6 e4c2f430 in __kernel_vsyscall () from linux-gate.so.1
[00:43:03] [debug#7 e48a6367 in gsignal () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[00:43:03] [debug#8 e48a7a23 in abort () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[00:43:03] [debug#9 e489f6c7 in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[00:43:03] [debug#10 e489f777 in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[00:43:03] [debug#11 0809634e in ?? () from ./sampsvr-port_434
[00:43:03] [debug#12 e44aa668 in ?? () from plugins/streamer.so
[00:43:03] [debug#13 080966c4 in ?? () from ./sampsvr-port_434
[00:43:03] [debug#14 e47b63e0 in ?? () from plugins/discord-connector.so
[00:43:03] [debugRegisters:
[
00:43:03] [debugEAX00000000 EBX00006fa3 ECX00006fa3 EDX00000006
[00:43:03] [debugESIe476e000 EDIe4a21000 EBPf36c26e8 ESPf36c24f4
[00:43:03] [debugEIPe4c2f430 EFLAGS00200206
[00:43:03] [debugStack:
[
00:43:03] [debugESP+00000000f36c26e8 00000006 00006fa3 e48a6367
[00:43:03] [debugESP+00000020f36c2524 00000000 34313633 f36c2560
[00:43:03] [debugESP+0000004000000000 00000000 00000000 00000000
[00:43:03] [debugESP+0000006000000000 00000000 00000000 00000000
[00:43:03] [debugESP+0000008000000000 00000000 00000000 00000000
[00:43:03] [debugESP+000000a000000000 00000000 00000000 00000000
[00:43:03] [debugESP+000000c0e4a22144 ffffffff 00000000 0b5f0043
[00:43:03] [debugESP+000000e0f36c25f8 f36c25f0 08049bfb 00000004
[00:43:03] [debugESP+0000010008158468 e4a21420 e48e50fe e4a21960
[00:43:03] [debugESP+00000120e4a21000 e4a21960 00000000 00000003
[00:43:03] [debugESP+00000140e4a21000 08158468 e489f6c7 00000000
[00:43:03] [debugESP+0000016000000000 08157e92 e49d7592 08158468
[00:43:03] [debugESP+0000018000000005 0b6def58 00001000 e4a21000
[00:43:03] [debugESP+000001a008158468 0815842d 00000e1e 08157e92
[00:43:03] [debugESP+000001c0e489f726 00000e1e 0809634e 08158468
[00:43:03] [debugESP+000001e00b6de8f8 f36c26e8 e452f0a0 f36c27bc
[00:43:03] [debugESP+0000020000000024 f36c27bc f36c2738 f36c2738
[00:43:03] [debugESP+000002200b6de8f8 f36c2748 080966c4 0b6de8f8
[00:43:03] [debugESP+00000240e4b3f236 0b782f50 e482fe68 0b77229c
[00:43:03] [debugESP+00000260f36c27bc 00000000 df30557c 00000000
[00:43:03] [debugESP+00000280e47b63b6 e482fe68 e47bef9d 0b6de8f8
[00:43:03] [debugESP+000002a000000000 00000000 00000000 00000000
[00:43:03] [debugESP+000002c000000000 00000000 00000000 00000000
[00:43:03] [debugESP+000002e0e4c0ea60 f36c2818 e47ceb54 de900d78
[00:43:03] [debugESP+0000030000000000 00000000 0b783a34 00000000
[00:43:03] [debugESP+0000032008159db3 f36c28a8 e48037d7 0b783a08
[00:43:03] [debugESP+0000034000000000 00000000 00000000 00000000
[00:43:03] [debugESP+0000036000000000 00000000 00000000 00000000
[00:43:03] [debugESP+0000038000000000 00000000 00000000 00000000
[00:43:03] [debugESP+000003a000000005 e48037bb 0b605824 0b5e9800
[00:43:03] [debugESP+000003c000000000 f36c28e8 080aef6c 0b5e9800
[00:43:03] [debugESP+000003e000000000 00000000 037f0f7f 00000000
[00:43:03] [debugLoaded modules:
[
00:43:03] [debug00000000 00187f43 sampsvr-port_434
[00:43:03] [debuge4c31000 e4c3150c linux-gate.so.1
[00:43:03] [debuge4c1f000 e4c2181b /lib/i386-linux-gnu/i686/cmov/libdl.so.2
[00:43:03] [debuge4c03000 e4c1dd2b /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
[00:43:03] [debuge4a88000 e4c0bbb3 /usr/lib32/libstdc++.so.6
[00:43:03] [debuge4a42000 e4a86b43 /lib/i386-linux-gnu/i686/cmov/libm.so.6
[00:43:03] [debuge4a25000 e4a413c4 /lib/i386-linux-gnu/libgcc_s.so.1
[00:43:03] [debuge4878000 e4a2d22f /lib/i386-linux-gnu/i686/cmov/libc.so.6
[00:43:03] [debuge4c30000 e4c50d6c /lib/ld-linux.so.2
[00:43:03] [debuge4831000 e4873ac4 plugins/crashdetect.so
[00:43:03] [debuge479a000 e4831ab0 plugins/discord-connector.so
[00:43:03] [debuge476f000 e4799b45 /home/samp/clients/port_434/plugins/../log-core.so
[00:43:03] [debuge4707000 e4767254 /usr/lib/i386-linux-gnu/i686/cmov/libssl.so.1.0.0
[00:43:03] [debuge46fe000 e470509f /lib/i386-linux-gnu/i686/cmov/librt.so.1
[00:43:03] [debuge4531000 e4714284 /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0
[00:43:03] [debuge4477000 e4531039 plugins/streamer.so
[00:43:03] [debuge3c57000 e3c661d4 plugins/sscanf.so
[00:43:03] [debuge446d000 e44757c4 plugins/Whirlpool.so
[00:43:03] [debuge3be5000 e3c573eb plugins/mysql.so
[00:43:03] [debuge39e3000 e3be4208 /usr/lib/libmysqlclient.so.18
[00:43:03] [debuge37d7000 e37e23ef /lib/i386-linux-gnu/i686/cmov/libnss_files.so.2
[00:43:03] [debuge4c24000 e4c2897b /lib/i386-linux-gnu/i686/cmov/libnss_dns.so.2
[00:43:03] [debuge35c0000 e35d82fb /lib/i386-linux-gnu/i686/cmov/libresolv.so.2 
Don't know what happen but I was trying out a few functions:

PHP Code:
public DCC_OnChannelMessage(DCC_Channel:channel, const author[], const message[])
{
    new
        
channel_name[32];
        
    
DCC_GetChannelName(channelchannel_name); 
    
    if(!
strcmp(channel_name"admin") && strcmp(author"sa-mp bot"))
    {
        
printf("** Admin[Discord] %s: %s"authormessage); 
    }
    return 
1;

May of also occurred when this was done:
PHP Code:
CMD:asdasd(playeridparams[])
{
    if(
_:admin == 0)
        
admin DCC_FindChannelById("357015641275891712"); 
    
    new 
str[128];
    
    
format(strsizeof(str), "%s said: %s"nameparams);
    
DCC_SendChannelMessage(adminstr); 
         return 
1;

Nothing logged in errors, or warnings. Just log-core:
PHP Code:
[09/12/17 00:31:32] [ERRORsignal 6 (SIGABRTcatchedshutting log-core down (errno0signal code: -6, exit status0)
[
09/12/17 00:43:03] [ERRORsignal 6 (SIGABRTcatchedshutting log-core down (errno0signal code: -6, exit status0
Arthur Kane is offline   Reply With Quote
Old 12/09/2017, 10:35 PM   #78
gurmani11
Huge Clucker
 
gurmani11's Avatar
 
Join Date: Dec 2012
Location: SKY
Posts: 358
Reputation: 18
Default Re: Discord Connector

Loading plugin: discord-connector.so
Failed (libssl.so.1.0.0: cannot open shared object file: No such file or directory)

However i have it downloaded in my VPS.

I am using CentOs 7.
gurmani11 is offline   Reply With Quote
Old 13/09/2017, 12:56 PM   #79
Develerux
Little Clucker
 
Join Date: Jan 2017
Posts: 49
Reputation: 0
Default Re: Discord Connector

Quote:
Originally Posted by NicK_ View Post
The plugin does not yet support accents. Examples:
Code:
           
In-game, the message is not sent to the discord.
From discord, the message displayed in the game appears different (as unknown character).


Please can you update to "special chars"

Chars:
` -> like discord syntax example -> ```text```
, , ű, , ő, , ,
utf-8 maybe or idk
__________________
sorry fcking bad english skill
Develerux is offline   Reply With Quote
Old 17/09/2017, 09:28 AM   #80
denNorske
Gangsta
 
denNorske's Avatar
 
Join Date: Nov 2011
Location: Narvik, Norway
Posts: 766
Reputation: 58
Default Re: Discord Connector

I also have an issue when the DCC_Connect is called.



Here is the code i used to debug:




I was curious on the plugin and decided to test it, but didn't get far in the process.
Anyone else who encountered the same problem that figured it out?

If not, I hope that I can be of any help figuring it out.
__________________
Mapping? Check this: Online Map Object Partitioner (Click)
Server Trailer: https://www.youtube.com/watch?v=jSKhbMFvAUs
[Filterscript] Circle Speedo: http://forum.sa-mp.com/showthread.php?p=3861785



Quote of 2018
denNorske 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 322 09/02/2018 11:53 AM
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 05:54 PM.


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