Deprecated: Use of "parent" in callables is deprecated in /var/www/html/forum/src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php on line 431
  • If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN A part of my script does not work

Status
Not open for further replies.

Dimitri

Donor
is awesome!
Hello,

Since my last post, I wanted to start doing my scripts myself, but I had a problem for one of these scripts. As I have an extended license, the subscription Operational by the! Sub /! Unsub. I wanted to do that when someone does this command (! Sub), we add a ServerGroup and that withdraws when he does! Unsub. My script has other features, which works very well, but not this one: / (My bot Has the permissions to add / remove ServerGroup)

If someone could help me :) Thank you in advance

(I'm french, sorry for the mistakes :/)

Code:
registerPlugin({
    name: 'BeyondRpBot',
    version: '1.0',
    description: 'Script d\'administration pour BeyondRp',
    author: 'AndroZz ([email protected])',
    vars: {}
},  function(sinusbot, config) {
    sinusbot.on('chat', function(ev) {
        switch (ev.msg) {
            case '!sub':
        sinusbot.setNick('Take by ' + ev.clientNick);
        sinusbot.addClientToServerGroup(ev.clientId, '57');
                break;
            case '!unsub':
        sinusbot.setNick('Bot n°2');
        sinusbot.removeClientFromServerGroup(ev.clientId, '57');
                break;
    }
    });
});
 

Xuxe

Containerholic
Staff member
is awesome!
V.I.P.
Contributor
Insider
Hi,

you don't tell us what exactly is not working / which error ? But maybe:

sinusbot.setNick('Take by ' + ev.clientNick); sinusbot.addClientToServerGroup(ev.clientId, '57'); break; case '!unsub': sinusbot.setNick('Bot n°2'); sinusbot.removeClientFromServerGroup(ev.clientId, '57');
The Servergroup ID should be a number NOT a string make 57 instead of '' ;)
 
Status
Not open for further replies.
Top