Posts: 66
Threads: 18
Joined: Mar 2010
Reputation:
0
How can I remove the "_" in names? that is, when writing in chat eg Firstname_Lastname not occur, appear FirstName Lastname .. I hope you understand
Thanks
Posts: 2,268
Threads: 89
Joined: Apr 2009
Reputation:
0
I think it's not possible, im not fully sure.
Posts: 66
Threads: 18
Joined: Mar 2010
Reputation:
0
I have a GM with something, but do not know how to look ..
Posts: 6,129
Threads: 36
Joined: Jan 2009
It's done by exploding the two values in to two separate strings, or removing the "_" (underscore) from the string. I have created a function, which will do this:
pawn Код:
stock ReturnPlayerName( playerid )
{
new
NameString[ MAX_PLAYER_NAME ],
stringPos;
GetPlayerName( playerid, NameString, MAX_PLAYER_NAME );
stringPos = strfind( NameString, "_" );
NameString[ stringPos ] = ' ';
return NameString;
}
Thanks to Norn for releasing a similar function in Carlitos Roleplay, note if there's only
one underscore, this will work - if there's more, it will only remove the first instance.
Norn's code:
pawn Код:
stock GetPlayerNameEx(playerid)
{
new string[MAX_PLAYER_NAME];
GetPlayerName(playerid, string, sizeof(string));
for(new i; i < MAX_PLAYER_NAME; i++) if (string[i] == '_') string[i] = ' ';
return string;
}
Posts: 1,110
Threads: 33
Joined: Nov 2007
Reputation:
0
Just replace your GetPlayerName with GetPlayerNameEx
Posts: 66
Threads: 18
Joined: Mar 2010
Reputation:
0
Replace everywhere there "GetPlayerName" ?