06.12.2013, 19:57
It's simple, you can get player name and clean player name once, then just call it.
Fast and easy, just have to get and clean name once, making your server a little faster ^^
@edit
Sorry, removed an unnecessary placeholder.
pawn Код:
new pName[MAX_PLAYERS][24];
new cName[MAX_PLAYERS][24];
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid,pName[playerid],24);
ClearName(playerid);
// Other shit
return 1;
}
stock ClearName(playerid)
{
cName[playerid] = pName[playerid];
new pos = strfind(pName[playerid],"_");
if(pos != -1)
cName[playerid][pos] = 32;
}
// Now you can use pName[playerid] to get a player name
// And you also can use cName[playerid] to get his name without underlines.
// example
CMD:example(playerid)
{
printf("Player Name: %s | Clean Name: %s",pName[playerid],cName[playerid]);
return 1;
}
@edit
Sorry, removed an unnecessary placeholder.