Jump to content
The forums will be going offline for an extended maintenance period at 1400hrs GMT on 19th June 2025. The number of hours for this downtime is intentionally not advertised due to the nature of these upgrades. ×
  • 0

R> Char. Name Check


Mansome

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  01/31/17
  • Last Seen:  

First. My Englisg isn't that good

.

I need this script
______________________________________

OnPcLoadMapEvent  :  if  charector name < 4 letters   =  Block them

 

 

 

Help me pls,  /sob

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   127
  • Joined:  04/04/16
  • Last Seen:  

Do you already have a live server running with character name that has 4 letters?

If not you can just diff a new client on nemo and UNBUTTON "Disable 4 Letter Character Name Limit"

If yes you can try to create a script that let's the players rename their character that has 4 letters and below.

Try this and let me know if it works

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

 

Edited by Technoken
Forgot to do some checking XD
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  01/31/17
  • Last Seen:  

Thank you, this script can working on my server /thx

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