hi !! i need some help with this script i have the createchan command but i don't know how to make it permanent and only for invited users anyone can help me ??
Perm channel script Hi. I am trying to create a script for permanent channels. I have managed to make it until here. // esto es la propiedad para que sean permanentes Reg.init("permChan", "{}"); if (typeof permChan == 'undefined') { permChan = {}; try { permChan = JSON.parse(Reg.get("permChan")); } catch (e) { permChan = {}; } } // comandos quitar y poner permanente if (command == "perm") { if (sys.auth(src) >= 1) { if (commandData != undefined) { if (sys.existChannel(commandData)) { var canal = sys.channel(commandData).toLowerCase(); if (permChan[canal] == false || permChan[canal] == undefined) { permChan[canal] = true; sys.sendMessage(src, "El canal " + commandData + " es ahora permanente.", chan); } else { sys.sendMessage(src, "el canal " + commandData + " ya era permanente.", chan); } } else { sys.sendMessage(src, "El canal no existe.", chan); } } else { sys.sendMessage(src, "Necesitas especificar un canal.", chan); } } else { sys.sendMessage(src, "Tu no tienes autoridad para hacer esto.", chan); } } if (command == "unperm") { if (sys.auth(src) >= 1) { if (commandData != undefined) { if (sys.existChannel(commandData)) { var canal = sys.channel(commandData).toLowerCase(); if (permChan[canal] = true) { permChan[canal] = false; sys.sendMessage(src, "El canal " + commandData + " ya no es permanente.", chan); } else { sys.sendMessage(src, "El canal " + commandData + " no es permanente.", chan); } } else { sys.sendMessage(src, "El canal no existe.", chan); } } else { sys.sendMessage(src, "Necesitas especificar un canal.", chan); } } else { sys.sendMessage(src, "Tu no tienes autoridad para hacer esto.", chan); } } // para que al salir no se destruyan beforeChannelDestroyed : function(chan) { var canal = sys.channel(); if (permChan[canal] == true) { sys.stopEvent(); } } It seems like I need a valid function for var canal = sys.channel();. which is meant to identify the current channel, or the channel being closed, but I cant make it work... can someone please help me? :c
Code (text): Reg.init("permChan", "{}"); if (typeof permChan == 'undefined') { permChan = {}; try { permChan = JSON.parse(Reg.get("permChan")); } catch (e) { permChan = {}; } } if (command == "perm") { if (sys.auth(src) >= 1) { if (commandData != undefined) { if (sys.existChannel(commandData)) { var canal = sys.channel(commandData).toLowerCase(); if (permChan[canal] == false || permChan[canal] == undefined) { permChan[canal] = true; sys.sendMessage(src, "El canal " + commandData + " es ahora permanente.", chan); } else { sys.sendMessage(src, "el canal " + commandData + " ya era permanente.", chan); } } else { sys.sendMessage(src, "El canal no existe.", chan); } } else { sys.sendMessage(src, "Necesitas especificar un canal.", chan); } } else { sys.sendMessage(src, "Tu no tienes autoridad para hacer esto.", chan); } } if (command == "unperm") { if (sys.auth(src) >= 1) { if (commandData != undefined) { if (sys.existChannel(commandData)) { var canal = sys.channel(commandData).toLowerCase(); if (permChan[canal] = true) { permChan[canal] = false; sys.sendMessage(src, "El canal " + commandData + " ya no es permanente.", chan); } else { sys.sendMessage(src, "El canal " + commandData + " no es permanente.", chan); } } else { sys.sendMessage(src, "El canal no existe.", chan); } } else { sys.sendMessage(src, "Necesitas especificar un canal.", chan); } } else { sys.sendMessage(src, "Tu no tienes autoridad para hacer esto.", chan); } } beforeChannelDestroyed : function(chan) { var canal = sys.channel(); if (permChan[canal] == true) { sys.stopEvent(); } } It seems like I need a valid function for var canal = sys.channel();. which is meant to identify the current channel, or the channel being closed, but I cant make it work... can someone please help me? :c