[Question] Nick Change

01/08/2012 15:01 spiga#1
Hi guys. I did something in my 5530 source, i did that to change the character name when it upgrades VIP LEVEL and also REINCARN so it must show those on nick, if it is Mystery, it would be like "Mystery v[6] r[0]", now my question is.
In database it looks ok, but in game it shows no nickname, like if show names is disabled in client. I tried many ways, most of the times it showed only "v[6] r[0]" and i figure out if i use the name field of entities it went well but it bugs on next VIP Level Upgrade it becomes "Mystery v[6] r[0] v[7] r[0]" of course :o. Here is my NPC code part for this. Its for trinity 5530 if u guys can see:

Code:
string namefix = "";
var cmd = new Database.MySqlCommand(Database.MySqlCommandType.SELECT);
cmd.Select("entities").Where("UID", client.Entity.UID);
var r = new Database.MySqlReader(cmd);
if (r.Read())
namefix = r.ReadString("NameFix");
r.Close();
string newname = ""+ namefix + " v[" + (int)client.Entity.VIPLevel + "] r[" + (int)client.Entity.Reincarnations + "]";
Database.MySqlCommand cmd2 = new Database.MySqlCommand(Database.MySqlCommandType.UPDATE);
cmd2.Update("entities").Set("Name", newname).Where("UID", client.Entity.UID).Execute();
client.Disconnect();
Btw. Namefix is a new field i made that cointains the original nickname so Npcs can use it. Maybe im messing up with some variable declations, i almost got there when i use client.entity.name instead of Namefix.

The weird thing is in entities database it looks OK, but in game i cant see no nickname like i explained b4, i hope any of u guys can help me figure out whats going ON, ill keep trying when i can, thx!
01/09/2012 07:35 I don't have a username#2
If the charactername is too long, then it will not show up.
01/09/2012 13:40 pro4never#3
As for your other issue (not sure if intended or not), you're continually adding names together instead of continuing to hold onto the original name.

EG: Pro4Never is name and then you have a seperate name to hold nickname which is added on.


If you do something like..


string Name = Pro4Never
Name += [X] [Y];
Name += [X] [Y];

You're obviously going to end up with Pro4Never [X] [Y] [X] [Y]
Instead I'd do something like...

string charName pro4Never;
string nickName = [x];
string Name { get{ return charName + nickName;}}

Now Name cannot be altered, instead you change the nickname as needed (no +=)
01/09/2012 14:11 spiga#4
Quote:
Originally Posted by I don't have a username View Post
If the charactername is too long, then it will not show up.
Thax MAN!! Max is 15 caracteres! Problem Solved, and Pro4never that was just an example im not that noob, thx anyway!!!

Is there any way to make a highter then 15 caracteres nickname to show?
01/09/2012 23:06 .Kinshi#5
Quote:
Originally Posted by spiga View Post
Thax MAN!! Max is 15 caracteres! Problem Solved, and Pro4never that was just an example im not that noob, thx anyway!!!

Is there any way to make a highter then 15 caracteres nickname to show?
Max name length is 16, and no.
01/10/2012 19:40 spiga#6
PROBLEM ALREADY SOLVED!

#REQUEST CLOSE

PROBLEM ALREADY SOLVED!

#REQUEST CLOSE