SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 01/08/2017, 09:48 AM   #71
EmrySH
Little Clucker
 
Join Date: Oct 2016
Posts: 1
Reputation: 0
Default Re: Discord Connector

Can I redirect users from one channel to another? Depending on the conditions inside Gamemode/
EmrySH is offline   Reply With Quote
Old 01/08/2017, 10:50 AM   #72
Crystallize
High-roller
 
Join Date: Aug 2013
Posts: 1,420
Reputation: 279
Default Re: Discord Connector

Quote:
Originally Posted by Crystallize View Post
It's possible yet to issue ban commands through discord?
Any answers on this?
__________________
Quote:
Originally Posted by Meller View Post
I thought you were supposed to work at the job?
Crystallize is online now   Reply With Quote
Old 01/08/2017, 11:52 AM   #73
XeonMaster
Big Clucker
 
XeonMaster's Avatar
 
Join Date: Jul 2017
Location: Earth
Posts: 191
Reputation: 13
Default Re: Discord Connector

Quote:
Originally Posted by Crystallize View Post
Any answers on this?
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

Last edited by XeonMaster; 01/08/2017 at 04:25 PM.
XeonMaster is offline   Reply With Quote
Old 01/08/2017, 02:09 PM   #74
kernel32
Little Clucker
 
kernel32's Avatar
 
Join Date: Sep 2016
Posts: 12
Reputation: 0
Default Re: Discord Connector

Discord incorrectly displays Cyrillic alphabet.
kernel32 is offline   Reply With Quote
Old 01/08/2017, 02:46 PM   #75
XeonMaster
Big Clucker
 
XeonMaster's Avatar
 
Join Date: Jul 2017
Location: Earth
Posts: 191
Reputation: 13
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.
XeonMaster is offline   Reply With Quote
Old 01/08/2017, 04:00 PM   #76
Crystallize
High-roller
 
Join Date: Aug 2013
Posts: 1,420
Reputation: 279
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
__________________
Quote:
Originally Posted by Meller View Post
I thought you were supposed to work at the job?
Crystallize is online now   Reply With Quote
Old 01/08/2017, 07:09 PM   #77
kernel32
Little Clucker
 
kernel32's Avatar
 
Join Date: Sep 2016
Posts: 12
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   #78
Zorono
Huge Clucker
 
Zorono's Avatar
 
Join Date: Dec 2015
Location: GetPlayerPos(271055, Float:xCord, Float:yCord, Float:zCord);
Posts: 356
Reputation: 26
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   #79
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 152
Reputation: 0
Default Re: Discord Connector

For what this can by used?
Bussyman 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 314 09/06/2017 07:46 AM
[FilterScript] 0.3.7 Tube Connector 1.10 (Matite tubes) adri1 Lanzamientos/Releases 9 01/07/2015 11:36 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 10:28 AM.


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