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 :/)
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;
}
});
});