It's possible to made a script that prevents the people UNREGISTERED to talk and battle? Possibily with a message for advice,and when they register,this "mute" stops. Thanks :)
You can use beforeBattleMatchup and beforeChallengeIssued to prevent battles, using same method with sys.dbRegistered and sys.stopEvent
Code (JAVASCRIPT): beforeChatMessage: function(src, message, chan) { var srcname = sys.name(src); if (!sys.dbRegistered(srcname)) { sys.stopEvent(); sys.sendMessage(src, "+Bot: You need to Register before you can talk! Registering is free and does not require an e-mail. You can find the Register Button at the bottom of your Pokemon Online window!"); return; } } Well, that should work. Add this function to your scripts. If you already have a beforeChatMessage, do NOT add this! Simply remove one '}' after the 'return;' and the 'beforeChatMessage: function(src, message, chan) {' from the snip, and add the rest of the code to your beforeChatMessage. I'm not the best scripter, and it could possibly not work. If it doesn't work, then I'm sorry for the inconvenience. If it does, great! :)
Code (javascript): sys.sendMessage(src, "+Bot: You need to Register before you can talk! Registering is free and does not require an e-mail. You can find the Register Button at the bottom of your Pokemon Online window!"); Change the words in the "quotes." (The blue stuff: Just make sure you KEEP THE QUOTES!) Edit: If you want to HTML the message, change 'sys.sendMessage' to 'sys.sendHtmlMessage'. c:
Yeah is it possible to make it the person IS registered but they still can't talk. Or would only be in massmute/muteAll?
O and muting after long in is easy: Code (JAVASCRIPT): afterLogIn : function(src) { sys.sendMessage(src, "Flareon: Your IP " + sys.name(src) + " is " + sys.ip(src)); sys.sendMessage(src, "Umbreon: Use !commands or /commands to see the commands!"); sys.mute(src) muted[src] = true; and Code (JAVASCRIPT): beforeLogOut : function (src) { if (muted[src] == false) { sys.saveVal("muted*" + sys.ip(src), "true"); } else { sys.removeVal("muted*" + sys.ip(src)); } } }) So yeah :)
No Chat Snip Add Code (JAVASCRIPT): afterLogIn : function(src) { sys.mute(src) muted[src] == true; After afterLongIn. Code (JAVASCRIPT): beforeChatMessage: function(src, message) { if (sys.auth(src) < 0 && muted[src] == true) { sys.stopEvent(); sys.sendMessage(src, "~~Server~~: Sorry, this is not a chatting Server!"); return; After beforeChatMessage Code (JAVASCRIPT): beforeLogOut : function (src) { if (muted[src] == true) { sys.saveVal("muted*" + sys.ip(src), "true"); } else { sys.removeVal("muted*" + sys.ip(src)); } } }) After beforeLogOut Then no one would be able to talk. I might make a No Chat Script, im not sure yet ._. :)
Strange,when i try to edit the message it says Parse Error...maybe that's why my edited text is not blue? D:
You can only edit text inside the quotes ("), but do not remove the quotes itself. Also you shouldn't put another double quotes there. If you need to, prepend them with backslashes (\)
It's an italian translation of that message... "Devi registrarti prima di poter parlare!Registrarsi è gratuito e non richiede e-mail.Puoi trovare il tasto "Registrati" in basso!"
Yeah, I see then, as Kalashnikov said replace one set of double quotes with single quotes (') or put a \ before the quote marks around the word Registrati Like so "Devi registrarti prima di poter parlare!Registrarsi è gratuito e non richiede e-mail.Puoi trovare il tasto \"Registrati\" in basso!" Or "Devi registrarti prima di poter parlare!Registrarsi è gratuito e non richiede e-mail.Puoi trovare il tasto 'Registrati' in basso!"
Code (javascript): if(sys.auth(src) < 1) { sys.stopEvent(); sys.sendMessage(src,"Can't talk right now!"); return; }
Yeah i'm going to in a few days maybe make a No-Chatting-Script. Where only "127.0.0.1." or "localhost" may talk in Main Chat or any Channels. Give me a few days and I can make on with basic commands like: /authlist /players /rules * /kick [player] ** /ban [player] /unban [player] *** /changeauth So yeah with just some lil commands :)
That was addressed in this thread... http://pokemon-online.eu/forums/showthread.php?9044-No-Chat-Script.js