ajaytrix Posted July 28, 2013 Posted July 28, 2013 Good day! Requesting for this script: When GM account log in, his/her character will be automatically added a "[GM]" in his/her name. Example = char: Test, upon login = [GM] Test When normal characters add : GM, [GM], G M, [Admin], Admin, A dmin, words related to being as a GM account will automatically be banned. Example = normal account created name: "GM Normal Player", upon login, something will pop-up: "You named your char with "GM". You are banned" = then his/her account will be automatically banned. Thank you and sorry for my english. Quote
Patskie Posted July 28, 2013 Posted July 28, 2013 When GM account log in, his/her character will be automatically added a "[GM]" in his/her name. Example = char: Test, upon login = [GM] Test - script GM -1,{ OnPCLoginEvent: if ( !getgmlevel() ) end; atcommand "@fakename [GM] " +strcharinfo(0); end; } Quote
ajaytrix Posted July 28, 2013 Author Posted July 28, 2013 Sir Patskie, is this permanent or temporary? If it's okay, please make it permanent name. Thanks! - script GM -1,{ OnPCLoginEvent: if ( !getgmlevel() ) end; atcommand "@fakename [GM] " +strcharinfo(0); end; } Quote
whitesn Posted July 28, 2013 Posted July 28, 2013 (edited) - script gmrenamer -,{ OnPCLoginEvent: set .nickname$,strcharinfo(0); setarray .banned$[0],"GM","[GM]","Admin","G M","[Admin]","A dmin"; set .bannedamt,getarraysize(.banned$); if(getgmlevel() > 0) { if(compare(.nickname$,"[GM] ") == 0) { query_sql("UPDATE `char` SET name='[GM] "+.nickname$+"' WHERE name='"+.nickname$+"'"); mes "You have to relog to update your nickname to have ^FF0000[GM]^000000 tag"; } } else { for(set .a,0; .a <= .bannedamt; set .a,.a+1) { if(compare(.nickname$,".banned$[.a]") == 1) { atcommand "@block "+.nickname$+""; } } } end; }Haven't tested it yet, try it offline first Edited July 28, 2013 by 2essy2killu Quote
Patskie Posted July 28, 2013 Posted July 28, 2013 An issue with updating name through SQL is that when player name exceeds 23 character it will be deleted instantly so if you would not mind [member=2essy2killu] you can add a check on your script ( getstrlen ) that if player name + GM tag > 23 then the npc should ask player somehow if he or she wants to change his or her name. If not, then don't execute the update command. Otherwise if it is < 23 then there should be no problem Quote
ajaytrix Posted July 28, 2013 Author Posted July 28, 2013 @2essy2killu: Sir, the script when adding a GM tag works on GM. The script for normal char when adding GM names, is not working, can you please make it work? Thanks! @Patskie: Sir, I think that won't work for me. Because I'm still a newbie, I'm still studying regarding SQL & Scripts. XD Quote
Patskie Posted July 28, 2013 Posted July 28, 2013 @2essy2killu: Sir, the script when adding a GM tag works on GM. The script for normal char when adding GM names, is not working, can you please make it work? Thanks! @Patskie: Sir, I think that won't work for me. Because I'm still a newbie, I'm still studying regarding SQL & Scripts. XD Try this i revised 2essy script but like what i've said there's an issue if player name exceeds 23 characters : - script gmrenamer -,{ OnPCLoginEvent: set .nickname$,strcharinfo(0); setarray .banned$[0],"GM","[GM]","Admin","G M","[Admin]","A dmin"; set .bannedamt,getarraysize(.banned$); if( getgmlevel() ) { if( compare(.nickname$,"[GM] ") ) { query_sql("UPDATE `char` SET name='[GM] "+.nickname$+"' WHERE name='"+.nickname$+"'"); mes "You have to relog to update your nickname to have ^FF0000[GM]^000000 tag"; } } else { for ( set .a, 0; .a < .bannedamt; set .a, .a + 1 ) { if( !compare(.nickname$,.banned$[.a]) ) { atcommand "@block "+.nickname$+""; } } } end; } Quote
ajaytrix Posted July 28, 2013 Author Posted July 28, 2013 @Patskie, sir, it's not working but it doesn't show any errors at mapsrvr sql. I also tried to reloadscript and restart my server. Quote
Rebel Posted July 28, 2013 Posted July 28, 2013 why dont you just change your gm's name an add [ GM ] or whatever in your sql database so it will be permanent forever.. no need for script.. just the one for the players who make character with a GM letters .. Quote
ajaytrix Posted July 28, 2013 Author Posted July 28, 2013 why dont you just change your gm's name an add [ GM ] or whatever in your sql database so it will be permanent forever.. no need for script.. just the one for the players who make character with a GM letters .. I thought of that too, the one that 2essy2killu gave was good, but the only problem is that the normal characters doesn't get blocked. Quote
Rebel Posted July 28, 2013 Posted July 28, 2013 why dont you just change your gm's name an add [ GM ] or whatever in your sql database so it will be permanent forever.. no need for script.. just the one for the players who make character with a GM letters .. Quote
Patskie Posted July 28, 2013 Posted July 28, 2013 @Patskie, sir, it's not working but it doesn't show any errors at mapsrvr sql. I also tried to reloadscript and restart my server. I am a bit confuse on what does the compare return. In 2essy script he use if(compare(.nickname$,".banned$[.a]") == 1) and compare said that if you compare the whole string with the substring you specified then the value 1 means substring is not found in the main string Anyway we just go with script since you told me that this is somehow working. Try these : - script gmrenamer -,{ OnPCLoginEvent: set .nickname$,strcharinfo(0); setarray .banned$[0],"GM","[GM]","Admin","G M","[Admin]","A dmin"; set .bannedamt,getarraysize(.banned$); if(getgmlevel() > 0) { if(compare(.nickname$,"[GM] ") == 0) { query_sql("UPDATE `char` SET name='[GM] "+.nickname$+"' WHERE name='"+.nickname$+"'"); mes "You have to relog to update your nickname to have ^FF0000[GM]^000000 tag"; } } else { for(set .a,0; .a < .bannedamt; set .a,.a+1) { if(compare(.nickname$,.banned$[.a]) == 1) { atcommand "@block "+.nickname$+""; } } } end; } 1 Quote
Rebel Posted July 28, 2013 Posted July 28, 2013 why dont you just change your gm's name an add [ GM ] or whatever in your sql database so it will be permanent forever.. no need for script.. just the one for the players who make character with a GM letters .. Quote
ajaytrix Posted July 28, 2013 Author Posted July 28, 2013 Solved! Big thanks to sir 2essy2killu for the script and sir Patskie for making it work! Quote
whitesn Posted July 28, 2013 Posted July 28, 2013 (edited) oh yeah I forgot that was a variable lol thanks for the fix wiki miswrited it I guess This command returns 1 or 0 when the substring is in the main string (1) or not (0).I'm using script_commands doc as my reference Edited July 28, 2013 by 2essy2killu Quote
nanakiwurtz Posted July 29, 2013 Posted July 29, 2013 setarray .banned$[0],"GM","[GM]","Admin","G M","[Admin]","A dmin"; Will the 'compare' also returns 1 if the char name is "abcG Mabc", or "abcGMabc" Quote
whitesn Posted July 29, 2013 Posted July 29, 2013 (edited) setarray .banned$[0],"GM","[GM]","Admin","G M","[Admin]","A dmin";Will the 'compare' also returns 1 if the char name is "abcG Mabc", or "abcGMabc" Yes, it will I believe Examples://dothis; will be executed ('Bloody Murderer' contains 'Blood'). if (compare("Bloody Murderer","Blood")) dothis; //dothat; will not be executed ('Blood butterfly' does not contain 'Bloody'). if (compare("Blood Butterfly","Bloody")) dothat; Edited July 29, 2013 by 2essy2killu Quote
Lil Troll Posted July 30, 2013 Posted July 30, 2013 (edited) Wow i learn alot by just reading in these forums, can i ask out of the topic, is it possible to make a title system using fake names attach in achievement/items/empbreaker etc? Then he can choose his desirable title on a npc? - script gmrenamer -,{ OnPCLoginEvent: set .nickname$,strcharinfo(0); setarray .banned$[0],"GM","[GM]","Admin","G M","[Admin]","A dmin"; set .bannedamt,getarraysize(.banned$); if(getgmlevel() > 0) { if(compare(.nickname$,"[GM] ") == 0) { query_sql("UPDATE `char` SET name='[GM] "+.nickname$+"' WHERE name='"+.nickname$+"'"); mes "You have to relog to update your nickname to have ^FF0000[GM]^000000 tag"; } } else { for(set .a,0; .a < .bannedamt; set .a,.a+1) { if(compare(.nickname$,.banned$[.a]) == 1) { atcommand "@block "+.nickname$+""; } } } end; } Edited July 30, 2013 by Lil Troll Quote
Plank Posted July 30, 2013 Posted July 30, 2013 (edited) nice, thanks Edited July 30, 2013 by Plank Quote
whitesn Posted July 31, 2013 Posted July 31, 2013 Wow i learn alot by just reading in these forums, can i ask out of the topic, is it possible to make a title system using fake names attach in achievement/items/empbreaker etc? Then he can choose his desirable title on a npc? - script gmrenamer -,{ OnPCLoginEvent: set .nickname$,strcharinfo(0); setarray .banned$[0],"GM","[GM]","Admin","G M","[Admin]","A dmin"; set .bannedamt,getarraysize(.banned$); if(getgmlevel() > 0) { if(compare(.nickname$,"[GM] ") == 0) { query_sql("UPDATE `char` SET name='[GM] "+.nickname$+"' WHERE name='"+.nickname$+"'"); mes "You have to relog to update your nickname to have ^FF0000[GM]^000000 tag"; } } else { for(set .a,0; .a < .bannedamt; set .a,.a+1) { if(compare(.nickname$,.banned$[.a]) == 1) { atcommand "@block "+.nickname$+""; } } } end; } fakename isn't permanent they sometime changes on certain circumstances if I recall it right. So the best way is just to update the name on SQL. Quote
Lil Troll Posted July 31, 2013 Posted July 31, 2013 (edited) like this? - script sample { if(strcharinfo(0) == getequipid(4) == 6010) { set .nickname$,strcharinfo(0); query_sql("UPDATE `char` SET name='[Title] "+.nickname$+"' WHERE name='"+.nickname$+"'"); end; } How can i add SQL? I know how to put existing one but i dont know how to make one. Edited July 31, 2013 by Lil Troll Quote
Rain Posted July 31, 2013 Posted July 31, 2013 (edited) THANK I TRY THAT!! Edited July 31, 2013 by Rain Quote
whitesn Posted July 31, 2013 Posted July 31, 2013 like this? - script sample { if(strcharinfo(0) == getequipid(4) == 6010) { set .nickname$,strcharinfo(0); query_sql("UPDATE `char` SET name='[Title] "+.nickname$+"' WHERE name='"+.nickname$+"'"); end; } How can i add SQL? I know how to put existing one but i dont know how to make one. Yeah it's just like that you can do a lot of modification though. Quote
Hiryu Imajin Posted July 31, 2013 Posted July 31, 2013 (edited) Hi guys can you please check this script that I referenced with your post? OnPCLoginEvent: set .nickname$,strcharinfo(0); setarray .banned$[0],"GM","[GM]","Admin","G M","[Admin]","A dmin"; set .bannedamt,getarraysize(.banned$); for(set .a,0; .a < .bannedamt; set .a,.a+1) { if(compare(.nickname$,.banned$[.a]) == 1) { mes "You had been banned for the reason of trying to copy the GM's name"; mes "There has been a notice in our forums about this kind of action"; mes "Please review and post an appeal if you have no intention of trying to do some illicit actions"; close; atcommand "@block "+.nickname$+""; } } } end; } So this is a very Good Script to be used by GMs on their Servers as it will help them prevent scam and other hack cases or even insults. and then we just have to replace this line right? setarray .banned$[0],"GM","[GM]","Admin","G M","[Admin]","A dmin"; Set this accordingly with your GM's names. For example your own GM name is: Hollister There is a big chance for this name to be copied by others. So you would have to set the line accordingly with all possible characters that can be used to flawlessly type the name. setarray .banned$[0],"HoIlister","HolIister","HoIIister"; Hope this makes sense and can help a lot of people. And guys advise your players that this can happen if they try to do that. Depends as well for all of the characters that are allowed when creating characters if there is a "." allowed or even any characters add it on the line above. I'm glad someone did create this kind of stuff. Thank you! Edited July 31, 2013 by redhotzip Quote
whitesn Posted July 31, 2013 Posted July 31, 2013 (edited) Hi guys can you please check this script that I referenced with your post? The reason i don't give any warnings with messages is because they might bypass the script using commands to unbind their character from the script (@go, @warp, @load, etc). Anyway compare check whether you've a specific string on another string On your script I might still bypass using Holl.ister Hollister. .Hollister -Hollister- or much more. for(set .a,0; .a < .bannedamt; set .a,.a+1) {should befor(set .a,0; .a <= .bannedamt; set .a,.a+1) { Edited July 31, 2013 by 2essy2killu Quote
Hiryu Imajin Posted July 31, 2013 Posted July 31, 2013 Hi guys can you please check this script that I referenced with your post? The reason i don't give any warnings with messages is because they might bypass the script using commands to unbind their character from the script (@go, @warp, @load, etc). Anyway compare check whether you've a specific string on another string On your script I might still bypass using Holl.ister Hollister. .Hollister -Hollister- or much more. for(set .a,0; .a < .bannedamt; set .a,.a+1) {should be for(set .a,0; .a <= .bannedamt; set .a,.a+1) { Yes I did thought of it too so maybe we can set a disable command once logged in and then if they had been checked and their out of that kind of a warning the commands will come back. And about this: Anyway compare check whether you've a specific string on another string On your script I might still bypass using Holl.ister Hollister. .Hollister -Hollister- or much more. I did actually say something about the characters allowed. so depends with your setting in char_athena.conf char_name_letters: abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 By those bypass names that you have said. I don't think you can even create your character. So for those people they would have to refer their settings with this configuration in char_athena.conf / char_name_letters Thank you and about the last part of your comment thank you for correcting me about that one im not really sure about it thanks. Quote
Question
ajaytrix
Good day! Requesting for this script:
When GM account log in, his/her character will be automatically added a "[GM]" in his/her name.
Example = char: Test, upon login = [GM] Test
When normal characters add : GM, [GM], G M, [Admin], Admin, A dmin, words related to being as a GM account will automatically be banned.
Example = normal account created name: "GM Normal Player", upon login, something will pop-up:
"You named your char with "GM". You are banned" = then his/her account will be automatically banned.
Thank you and sorry for my english.
25 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.