Jump to content
  • 0

Auto ban a player with "GM" in the name


Sparks

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  50
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

hmmm ..

 

Normal Account creating a GM named character like GM Test , Admin Test and so on = auto ban ..

 

when he create a GM named character and he connects in game in a few second he will be disconnected and when he login again his account will be banned ..

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

OnPCLoginEvent:
if( !getgmlevel() && compare( strcharinfo(0),"GM " ) ){
    mes "You cant use 'GM' in your name.";
    sleep2 3000;
    atcommand "@ban "+strcharinfo(0);
}
end;

try this

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  50
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

its not working si emistry ..

 

hmm .. i want this way .. if you create GM named character at 1st it can connect in game but in a few second you will get disconnected and when you logged in again your account will be banned automatically

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:  

Try :

-    script    Sample    -1,{
    OnPCLoginEvent:
        if ( !getgmlevel() && compare(strcharinfo(0), "GM ") ) {
            mes "You can't use GM in your name.";
            sleep2 3000;
            atcommand "@block " +strcharinfo(0);
        }
        end;
}
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


- script Sample -1,{

OnPCLoginEvent:

if ( !getgmlevel() && compare(strcharinfo(0), "GM ") ) {

if ( getd( ".account_"+ getcharid(3) ) )// 2nd log -> ban

atcommand "@ban " + strcharinfo(0);

else {

setd ".account_"+ getcharid(3), 1;

mes "You can't use GM in your name.";

sleep2 3000;

atcommand "@kick " +strcharinfo(0);

}

}

end;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  50
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

how will it work ? because i try to load that script but it doesnt work .. ive tried to create a character with GM on it but it didnt get banned

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

OnPCLoginEvent:  // Check activates when you log in

!getgmlevel() // Will only run for non-GM accounts

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  50
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

still not working :(

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

This script ban a player with "GM "  in the name. Not "GM", "GM " with a space. Change it at your content.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  50
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

i used it as default only "GM " but when i create a character "GM Stark" it didnt get ban 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  01/29/13
  • Last Seen:  

http://rathena.org/wiki/Compare

Edit: The documentation is really confusing. The examples tells when compare is true that the substring was found, false otherwise, but the documentation tells the opposite...

got fixed in the wiki

Edited by chriser
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

the example was right, compare return true if the substring is in the main string

 

@Sparks

from my test this script seems working... weird

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  50
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

the example was right, compare return true if the substring is in the main string

 

@Sparks

from my test this script seems working... weird

 

when i put it on so i need to @loadnpc npc/blah/blah/blah/ban.txt

then now scripts is loaded when i create a GM named character on my normal account it doesnt do anything .. the acc did not get ban .. :(

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:  

Any error on your console? It works on my test server /hmm

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  49
  • Reputation:   1
  • Joined:  12/09/12
  • Last Seen:  

Yeah it's working on my server too. 

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