May want to consider something simpler, like a HUD on the left or right side of the screen that shows all players and their skills. This would be easy to implement, and you can do things like show only alive players, show only team-mates, etc.
Also, my above code did not account for setting skill if the name already had the skill in it, I assumed you were handling this somehow. I know your problem is solved but you can use this as a backup if needed. I also added the ability to easily customize how the skill is displayed, see szSkillPrefix[] and szSkillSuffix[]. This is what encloses the skill at the end of the players name.
PHP Code:
public SetSkillInName( id , szOutput[] , maxchars )
{
new iNameLen , szSkill[ 10 ] , iSkillLen , iSetPos , Float:fSkill , iBracketStart , iBracketEnd , iBracketSize;
new const szSkillPrefix[] = " [ ";
new const szSkillSuffix[] = " ]";
iNameLen = get_user_name( id , szOutput , maxchars );
iBracketStart = strfind( szOutput , szSkillPrefix );
iBracketEnd = strfind( szOutput , szSkillSuffix , .pos=iBracketStart + charsmax( szSkillPrefix ) );
iBracketSize = charsmax( szSkillPrefix ) + charsmax( szSkillSuffix );
if ( ( iBracketStart > -1 ) && ( iBracketEnd > -1 ) && ( ( iBracketEnd + charsmax( szSkillSuffix ) ) == iNameLen ) )
iNameLen = iBracketStart;
get_user_skill( id , fSkill );
iSkillLen = formatex( szSkill , charsmax( szSkill ) , "%0.2f" , fSkill );
iSetPos = ( ( iNameLen + iSkillLen + iBracketSize ) > maxchars ) ? maxchars - ( iSkillLen + iBracketSize ) : iNameLen;
return formatex( szOutput[ iSetPos ] , maxchars - iSetPos , "%s%s%s" , szSkillPrefix , szSkill , szSkillSuffix );
}
__________________