28.08.2011, 15:55
(
Последний раз редактировалось Basicz; 29.08.2011 в 02:17.
)
Another version ( loops ), tested with Slice's benchmark code, it's faster.
( Also removed invalid character checks for the test on both function; nor the oneCharAllowed ).
And thanks for the help!
( Also removed invalid character checks for the test on both function; nor the oneCharAllowed ).
pawn Код:
stock getPlayerFirstName( playerid )
{
new
playerName[ 24 ]
;
GetPlayerName( playerid, playerName, 24 );
for ( new i, nameLen = strlen( playerName ); i != nameLen; ++ i )
{
if ( playerName[ i ] == '_' && i > 0 )
{
playerName[ i ] = EOS;
}
}
return playerName;
}