Posts: 273
Threads: 4
Joined: Nov 2007
Reputation:
0
11.10.2010, 22:40
(
Последний раз редактировалось XGh0stz; 11.10.2010 в 22:53.
)
I have a script that changes your playername when you connect to the server which only seems to work (For me as the host anyways) if nobody else is on the server. When I connect with anyone else on the server though, it won't work correctly, everyone on the server will see my old name after it has been changed to something else. However, when I check who's on the server through the server list, it'll display me as my new changed name...
I've done quite a bit of testing, the script verifies that my name was actually changed although everyone including myself still sees my old name instead of the changed name. I was thinking maybe it might have been because of me having ID 0? Well anyways, I've done alot of searching, even tried putting that SetPlayerName to a timer, but no solution could be found. So has anyone ever had a similar problem with this sort of thing?
Update: Sorry, other players do see the changed name, only myself see my old name still on chat & in the TAB list
Posts: 212
Threads: 15
Joined: Jan 2008
Reputation:
0
What are you changing it to?
Posts: 380
Threads: 11
Joined: Feb 2010
Reputation:
0
Very difficult to help you without any code posted.
Posts: 212
Threads: 15
Joined: Jan 2008
Reputation:
0
Are you sure you're not changing the name of the player to something similar or the same as what someone else is already named on the server?
You can't have two "Carl", for example, and you can't have one "Carl" and one "cArl"
Posts: 273
Threads: 4
Joined: Nov 2007
Reputation:
0
As the function is used, I have it message the player whether the name change was successful, is not a valid name or that name is already used with a switch/case. It always returns that the name change was successful, it's a valid name & nobody else on the server is using it. There are NO changes at all when I log on the server alone which then it works & when I log on the server with other players which is does not work (Only the player cant see the changes, everyone else can)... So there's no reason to display any code because there's nothing wrong with the way it's scripted else it wouldnt work at all etc.
I also tried putting it in a timer to constantly change your name which didn't work. You know that console message you get when you do sucessfully change your name, I also get that everytime. It's NOT a script error, just a bug of some sort.
Just like the SetPlayerTeam doesn't always work as it should, people suggest you throw it in a timer to make it work
Posts: 380
Threads: 11
Joined: Feb 2010
Reputation:
0
ok well without the code, it is STILL difficult to help, because I (or we) have nothing to base our assumprions / ideas on.
When you use SetPlayerName(), I believe there should be an echo in the logs '[nick] player changed to other'
( or something like that ) Are you getting this message?
You mentioned that you see the new name in the tab list, but the old name when you talk?. Is that Global chat? what function are you referring to? SendClientMessageToall? SendPlayerMessageToall? or a custom function. Perhaps the problem is there.
This sounds like a problem which nearly drove me mad a while ago, a tiny error was hanging my script and not crashing it, in the end I found it by inserting about 50 sequential printf commands.
If you can't find the problem in the SetPlayerName() part of the script, check the other areas I guess.
Posts: 273
Threads: 4
Joined: Nov 2007
Reputation:
0
I do get the server's echo log messages about the player's name being changed, but the player whose name was changed is the only one who does not see the changes... The name in chat and in the TAB list are always the same, I just said I could code a work around so the updated name displays in chat correctly for the player. There is no special/custom chat code, just uses the default chat style.
I'll try a few more tests, some methods I didnt try yet, create a very simple name change for example just in case, then when complete, I'll edit this post with the results...
Posts: 380
Threads: 11
Joined: Feb 2010
Reputation:
0
This is stupid, if you don't post code you are just wasting our time, and should just fix the problem yourself.