16.01.2016, 01:09
pawn Код:
stock GetName(playerid, bool:initialize = false);
{
new szName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szName, sizeof(szName));
if(!initialize)
return szName;
else {
format(szName, sizeof szName, "%c. %s", szName[0], szName[strfind(szName, "_") + 1]);
return szName;
}
}
To use the regular name, don't change anything, just use the function as normal: GetName(playerid);
Ex.
pawn Код:
new string[128];
//Will print: "C. Crayder says: text"
format(string,sizeof(string) ,"%s says: %s", GetName(playerid, true), text);
//Both will print: "Crayder Crayder says: text"
format(string,sizeof(string) ,"%s says: %s", GetName(playerid), text);
format(string,sizeof(string) ,"%s says: %s", GetName(playerid, false), text);