Jump to content
  • 0

R> GM script


ajaytrix

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

@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 /hmm 

 

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;
     
}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

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;
}
 

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  193
  • Reputation:   14
  • Joined:  12/02/11
  • Last Seen:  

    -       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 by 2essy2killu
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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 :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

 @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 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

 @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;    
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

@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. 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  436
  • Reputation:   31
  • Joined:  02/19/12
  • Last Seen:  

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 ..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

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. /wah

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  436
  • Reputation:   31
  • Joined:  02/19/12
  • Last Seen:  

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 ..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  436
  • Reputation:   31
  • Joined:  02/19/12
  • Last Seen:  

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 ..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

Solved!

Big thanks to sir 2essy2killu for the script and sir Patskie for making it work! :D 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  193
  • Reputation:   14
  • Joined:  12/02/11
  • Last Seen:  

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 by 2essy2killu
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

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" /?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  193
  • Reputation:   14
  • Joined:  12/02/11
  • Last Seen:  

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 by 2essy2killu
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

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 by Lil Troll
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   2
  • Joined:  02/28/13
  • Last Seen:  

nice, thanks :)

Edited by Plank
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  193
  • Reputation:   14
  • Joined:  12/02/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

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 by Lil Troll
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   1
  • Joined:  01/20/12
  • Last Seen:  

THANK I TRY THAT!!

Edited by Rain
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  193
  • Reputation:   14
  • Joined:  12/02/11
  • Last Seen:  

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.

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

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 by redhotzip
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  193
  • Reputation:   14
  • Joined:  12/02/11
  • Last Seen:  

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) {
Edited by 2essy2killu
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...