ajaytrix Posted July 28, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Share 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 Link to comment Share on other sites More sharing options...
Patskie Posted July 28, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share 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 Link to comment Share on other sites More sharing options...
Patskie Posted July 28, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share 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 Link to comment Share on other sites More sharing options...
ajaytrix Posted July 28, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
whitesn Posted July 28, 2013 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 193 Reputation: 14 Joined: 12/02/11 Last Seen: October 30, 2018 Share 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 Link to comment Share on other sites More sharing options...
Patskie Posted July 28, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share 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 Link to comment Share on other sites More sharing options...
ajaytrix Posted July 28, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
Patskie Posted July 28, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share 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 Link to comment Share on other sites More sharing options...
ajaytrix Posted July 28, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
Rebel Posted July 28, 2013 Group: Members Topic Count: 68 Topics Per Day: 0.01 Content Count: 436 Reputation: 32 Joined: 02/19/12 Last Seen: May 22, 2024 Share 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 Link to comment Share on other sites More sharing options...
ajaytrix Posted July 28, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
Rebel Posted July 28, 2013 Group: Members Topic Count: 68 Topics Per Day: 0.01 Content Count: 436 Reputation: 32 Joined: 02/19/12 Last Seen: May 22, 2024 Share 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 Link to comment Share on other sites More sharing options...
Rebel Posted July 28, 2013 Group: Members Topic Count: 68 Topics Per Day: 0.01 Content Count: 436 Reputation: 32 Joined: 02/19/12 Last Seen: May 22, 2024 Share 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 Link to comment Share on other sites More sharing options...
ajaytrix Posted July 28, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Author Share Posted July 28, 2013 Solved! Big thanks to sir 2essy2killu for the script and sir Patskie for making it work! Quote Link to comment Share on other sites More sharing options...
whitesn Posted July 28, 2013 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 193 Reputation: 14 Joined: 12/02/11 Last Seen: October 30, 2018 Share 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 Link to comment Share on other sites More sharing options...
nanakiwurtz Posted July 29, 2013 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share 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 Link to comment Share on other sites More sharing options...
whitesn Posted July 29, 2013 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 193 Reputation: 14 Joined: 12/02/11 Last Seen: October 30, 2018 Share 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 Link to comment Share on other sites More sharing options...
Lil Troll Posted July 30, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Share 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 Link to comment Share on other sites More sharing options...
Plank Posted July 30, 2013 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 44 Reputation: 2 Joined: 02/28/13 Last Seen: July 15, 2017 Share Posted July 30, 2013 (edited) nice, thanks Edited July 30, 2013 by Plank Quote Link to comment Share on other sites More sharing options...
whitesn Posted July 31, 2013 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 193 Reputation: 14 Joined: 12/02/11 Last Seen: October 30, 2018 Share 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 Link to comment Share on other sites More sharing options...
Lil Troll Posted July 31, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Share 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 Link to comment Share on other sites More sharing options...
Rain Posted July 31, 2013 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 95 Reputation: 1 Joined: 01/20/12 Last Seen: June 2, 2015 Share Posted July 31, 2013 (edited) THANK I TRY THAT!! Edited July 31, 2013 by Rain Quote Link to comment Share on other sites More sharing options...
whitesn Posted July 31, 2013 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 193 Reputation: 14 Joined: 12/02/11 Last Seen: October 30, 2018 Share 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 Link to comment Share on other sites More sharing options...
Hiryu Imajin Posted July 31, 2013 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 58 Reputation: 4 Joined: 07/10/13 Last Seen: December 15, 2018 Share 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 Link to comment Share on other sites More sharing options...
whitesn Posted July 31, 2013 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 193 Reputation: 14 Joined: 12/02/11 Last Seen: October 30, 2018 Share 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 Link to comment Share on other sites More sharing options...
Hiryu Imajin Posted July 31, 2013 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 58 Reputation: 4 Joined: 07/10/13 Last Seen: December 15, 2018 Share 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 Link to comment Share on other sites More sharing options...
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.
Link to comment
Share on other sites
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.