I was wondering if there is a feature that prohibits char name creation if the name consists of a word that is listed from a pool.
This is the closest sample code from Emistry but made back in 2013, but I'd like to have multiple words to prohibit not just the GM, and have the player rename rather than banning them.
OnPCLoginEvent:
if( !getgmlevel() && compare( strcharinfo(0),"GM " ) ){
mes "You cant use 'GM' in your name.";
sleep2 3000;
atcommand "@ban "+strcharinfo(0);
}
end;
And this is Technokens script in 2017 that asks the player rename and kicks them after
- script namelengthchk -1,{
OnPCLoginEvent:
OnPCStatCalcEvent:
OnRetry:
.@charname$ = strcharinfo(0);
if( getstrlen(.@charname$) > 4 )end;
mes "Please rename your character,";
mes "Enter new name:";
input .@newname$;
if( getstrlen(.@newname$) < 4 || getstrlen(.@newname$) > 23 ){
mes "You cannot enter less than minimum of 4 and greater than maximum of 23 characters.";
goto OnRetry;
}
.@gid = getcharid(2);
if( .@GID ){
mes "Please leave your guild first before you change name.";
goto OnRetry;
}
query_sql "SELECT `name` FROM `char` WHERE `name` = '"+.@newname$+"'",.@existing$;
if( .@newname$ == .@existing$){
mes "Name already exists.";
goto OnRetry;
}
query_sql("UPDATE `name` FROM `char` SET `name`='"+.@newname$+"' WHERE `name`='"+strcharinfo(0)+"'");
next;
mes "Please relog for the changes to be applied.";
mes "signing out....";
sleep2 3000;
atcommand "@kick " +strcharinfo(0);
end;
}
Maybe someone could help merge the two, specially with the name detection part.
This script will mainly be used on players who names their characters inappropriately.
Question
Gouki
Hi all,
I was wondering if there is a feature that prohibits char name creation if the name consists of a word that is listed from a pool.
This is the closest sample code from Emistry but made back in 2013, but I'd like to have multiple words to prohibit not just the GM, and have the player rename rather than banning them.
OnPCLoginEvent: if( !getgmlevel() && compare( strcharinfo(0),"GM " ) ){ mes "You cant use 'GM' in your name."; sleep2 3000; atcommand "@ban "+strcharinfo(0); } end;
And this is Technokens script in 2017 that asks the player rename and kicks them after
- script namelengthchk -1,{ OnPCLoginEvent: OnPCStatCalcEvent: OnRetry: .@charname$ = strcharinfo(0); if( getstrlen(.@charname$) > 4 )end; mes "Please rename your character,"; mes "Enter new name:"; input .@newname$; if( getstrlen(.@newname$) < 4 || getstrlen(.@newname$) > 23 ){ mes "You cannot enter less than minimum of 4 and greater than maximum of 23 characters."; goto OnRetry; } .@gid = getcharid(2); if( .@GID ){ mes "Please leave your guild first before you change name."; goto OnRetry; } query_sql "SELECT `name` FROM `char` WHERE `name` = '"+.@newname$+"'",.@existing$; if( .@newname$ == .@existing$){ mes "Name already exists."; goto OnRetry; } query_sql("UPDATE `name` FROM `char` SET `name`='"+.@newname$+"' WHERE `name`='"+strcharinfo(0)+"'"); next; mes "Please relog for the changes to be applied."; mes "signing out...."; sleep2 3000; atcommand "@kick " +strcharinfo(0); end; }
Maybe someone could help merge the two, specially with the name detection part.
This script will mainly be used on players who names their characters inappropriately.
Link to comment
Share on other sites
3 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.