Player names being cut short
#1

Ive just realised that my server is occasionally (and seemingly randomly) shortening players' names and I have no idea why (Or even which function to start with in order to find the problem). As far as I can tell it only happens to 1 player at a time and their name will remain shortened until they rejoin the server.

Has anybody encountered a problem similar to this before? a point in the right direction in where to find the cause of this would be a great help.

Example:
This player's name is Crazy.Ex, however it suddenly starts showing like this and wont revert back to his full name until he quits and rejoins the server:



Example of the way names are given to one of the functions:
Код:
format(string, sizeof(string), "%s (%i) Has Paid $%i In Taxes.",PlayerInfo[playerid][pName],playerid,Taxes);
SendClientMessageToAll(COLOR_SERVER_HELP_MSG, string);
From the player enum:
Код:
pName[MAX_PLAYER_NAME],
OnPlayerConnect:
Код:
GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
EDIT: Their full name appears properly in the Tab playerlist, but shortened in commands like /info (Which use pName to get the player name)
Reply
#2

Maybe the Max_player_name is redefined?
Reply
#3

Check all accesses to the pName array. If this is permanent for each player, there must be place where you accidently alter the array. Maybe a strcat with mixed up arguments?

MAX_PLAYER_NAME cannot be the cause, as he stated that it works for a certain time. It cannot magically change sizes during run time. Also it has the same size for each player, so how would it be smaller for one player but not the other?
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
I'm going to take a bet that your player enum as you call it has a huge number of items in it, instead of correctly splitting and isolating data. This is undoubtedly the problem.
You are correct

I've only been scripting for a short time and still have a lot to learn, I thought keeping everything per-player-related was best suited to stay within the 'player enum'

Is there any fix for this issue short of redoing the enum?

There are currently 261 items in the enum
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)