Jump to content
  • 0
Sign in to follow this  
MikZ

Name with spaces,

Question

Good day Herc master scripters,

Requesting for a script where it can detect names with spaces, 
and remove the spaces in their name:

example:
onnpcloginevent:


1.detect name:   "S P A C E"
2. inform to change name without spaces.
3.Player input old or new name without space. SPACE (new name)

4.check if name already exist if not then update.

5.your name has been change to _______; are you sure you want this name?;
4.Kick. relog. to update the name
5.Only players with spaces in their name will be affected with the script.
Thank you!


 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Here's something that basically works with exactly what you're looking for.

So either you let it check all names each time the server restarts (close and restart or @reloadscript) it will delete any name inside SQL database that got spaces and automatically fix them. like "R A G    N A" would become "RAGNA". or "M O N K E Y" would become "MONKEY". If you ever want to just load the script inside of a MySQL program to query, I gave you the raw version to.

After using my script, this is what I was able to do:

Before: (Notice all the names)

PS: Inside of script change `hercules` to whatever database name yours is.

OodW8ks.png

 

 

After: (Notice names)

qSXFf5k.png

 

 

 

Here's the script:
 

// Created by Aeromesi
// Deletes the spaces inside of your name as a player everytime the server restart, 
 
/* Raw Version, just load into any MySQL program (HeidiSQL, MySQL administrator to run this query...)
    MAKE SURE TO CHANGE 'hercules' to your database name.
 
    SELECT * FROM `hercules`.`char` WHERE `name` LIKE '% %';
    update `char` set `name` = REPLACE(name,' ','')
 
*/
// OnInit will allow everytime your server go in maintenance restart etc when it starts up it automatically fix any name with spaces.
prontera,0,0,0    script    SpaceDeleter    -1,{
OnInit:
query_sql("SELECT * FROM `hercules`.`char` WHERE `name` LIKE '% %'");
query_sql("update `char` set `name` = REPLACE(name,' ','')");
debugmes "All accounts with spaces fixed";
end;
}

anyone?


Also I just figured out if I fix a character that was "W O W" and became "WOW" if I make another "W O W" he won't be fixed.


UPDATE:
Isn't there like a way to choose in your client hex the allowed characters for character creation? I might be wrong. I might have to find a way where if there converted name equals that of something that already exist they must change their name, maybe get a free name changer ticket? Not sure how to work my way around this one.

Share this post


Link to post
Share on other sites
  • 0

 

Isn't there like a way to choose in your client hex the allowed characters for character creation?

no need for hexing it's a config in the char-server.conf file

// Manage possible letters/symbol in the name of charater. Control character (0x00-0x1f) are never accepted. Possible values are:
// NOTE: Applies to character, party and guild names.
// 0: no restriction (default)
// 1: only letters/symbols in 'char_name_letters' option.
// 2: Letters/symbols in 'char_name_letters' option are forbidden. All others are possibles.
char_name_option: 0

// Set the letters/symbols that you want use with the 'char_name_option' option.
// Note: Don't add spaces unless you mean to add 'space' to the list.
char_name_letters: abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.