SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 13/07/2017, 10:21 PM   #61
UberEverywhere
Big Clucker
 
UberEverywhere's Avatar
 
Join Date: Aug 2016
Location: Dubai, UAE
Posts: 76
Reputation: 4
Default Re: Discord Connector

sorry for the double post but i need some help on this

I use this plugin only to send messages from server to discord and vice versa
i'm not familiar with this kind of plugin so i saw an example on the first page to send a message from server to discord

Which is this:
PHP Code:
public OnPlayerSpawn(playerid)
{
    new 
name[MAX_PLAYER_NAME 1];
    
GetPlayerName(playeridnamesizeof name);
    
    if (
_:g_WelcomeChannelId == 0)
        
g_WelcomeChannelId DCC_FindChannelById("388423556721672192"); // Discord channel ID
    
    
new str[128];
    
format(strsizeof str"Player %s joined the server."name);
    
DCC_SendChannelMessage(g_WelcomeChannelIdmsg);
    return 
1;

I started using this for all my messages

example:

PHP Code:
    if (_:DisconnectMessage == 0)
    {
        
DisconnectMessage DCC_FindChannelById("334727038436900865"); // Discord channel ID
        
new name[MAX_PLAYER_NAME 1], str[128];
        
GetPlayerName(playeridnamesizeof name);
        
format(strsizeof(str), "**[QUIT]** %s (%d) has quit the server."nameplayerid);
        
DCC_SendChannelMessage(DisconnectMessagestr);
    } 
however it is annoying and i sometimes get this warning
Code:
 warning 219: local variable "str" shadows a variable at a preceding level
i get this warning because i use a str[128]; on all those functions (sending messages to discord)
is there any solution?
Like the IRC one, example:
PHP Code:
            format(msgsizeof(msg), "[TEST] Blah Blah "userparams);
            
IRC_GroupSay(groupIDchannelmsg); 
Hmm?
UberEverywhere is offline   Reply With Quote
Old 14/07/2017, 12:22 AM   #62
Gforcez1337
Gangsta
 
Gforcez1337's Avatar
 
Join Date: Jul 2010
Location: The Netherlands.
Posts: 941
Reputation: 290
Default Re: Discord Connector

Quote:
Originally Posted by UberEverywhere View Post
Loading plugin: discord-connector
Failed.

Windows 10 with all Microsoft C++ redistributables.
Why won't it work

EDIT: works, nvm
What did you do? I have the same thing for some reason.
__________________

Gforcez1337 is offline   Reply With Quote
Old 14/07/2017, 12:47 AM   #63
UberEverywhere
Big Clucker
 
UberEverywhere's Avatar
 
Join Date: Aug 2016
Location: Dubai, UAE
Posts: 76
Reputation: 4
Default Re: Discord Connector

there's a file called log-core.dll with the download, extract it in the server directory (where samp-server.exe is)
UberEverywhere is offline   Reply With Quote
Old 14/07/2017, 12:14 PM   #64
Gforcez1337
Gangsta
 
Gforcez1337's Avatar
 
Join Date: Jul 2010
Location: The Netherlands.
Posts: 941
Reputation: 290
Default Re: Discord Connector

Quote:
Originally Posted by UberEverywhere View Post
there's a file called log-core.dll with the download, extract it in the server directory (where samp-server.exe is)
Ah I see. Thanks that fixed it
__________________

Gforcez1337 is offline   Reply With Quote
Old 14/07/2017, 04:37 PM   #65
Zorono
Huge Clucker
 
Zorono's Avatar
 
Join Date: Dec 2015
Location: GetPlayerPos(271055, Float:xCord, Float:yCord, Float:zCord);
Posts: 349
Reputation: 25
Default Re: Discord Connector

hello sir, great job working on this project and it 'd be much better if you added administration Commands scripting method and add DCC_OnERROR(...) Callback which detects every Error/Warning and send it as an parameter with full info so it might help loggingevery error/warning && fixing them easily.

Last edited by Zorono; 14/07/2017 at 11:33 PM.
Zorono is offline   Reply With Quote
Old 14/07/2017, 11:34 PM   #66
Zorono
Huge Clucker
 
Zorono's Avatar
 
Join Date: Dec 2015
Location: GetPlayerPos(271055, Float:xCord, Float:yCord, Float:zCord);
Posts: 349
Reputation: 25
Default Re: Discord Connector

Removed...

Last edited by Zorono; 15/07/2017 at 10:22 AM.
Zorono is offline   Reply With Quote
Old 15/07/2017, 03:33 PM   #67
supernerd2000
Big Clucker
 
Join Date: Jun 2014
Posts: 66
Reputation: 3
Default Re: Discord Connector

Any change of seeing a DCC_Disconnect function? Would be nice to make a status-checker.
supernerd2000 is offline   Reply With Quote
Old 22/07/2017, 06:56 PM   #68
[G]am3r
Huge Clucker
 
[G]am3r's Avatar
 
Join Date: Nov 2016
Location: Graveyard
Posts: 204
Reputation: 21
Default Re: Discord Connector

I got some error, when I start my server using the plugin and my filterscript with the code maddinat0r provided. I also edited the token and server id. My samp server dosen't starts. Happened on windows, didn't tried on linux.
[G]am3r is offline   Reply With Quote
Old 22/07/2017, 07:54 PM   #69
SmileJack
Little Clucker
 
SmileJack's Avatar
 
Join Date: Jul 2017
Posts: 46
Reputation: 0
Default Re: Discord Connector

Nice plugin!
SmileJack 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:56 PM.


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