12.05.2009, 06:36
Ive edited YSF to allow spaces but im wandering if its possible to Check if a players name contains _ and change it to a space?
new i = -1; while (string[++i]) if (string[i] == '_') string[i]= ' ';
stock PlayerName(playerid)
{
new n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,sizeof(n));
for(new name=0;name<strlen(n);name++)
if(n[name]=='_') n[name]=' ';
return n;
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Hello %s", name);
SendClientMessageToAll(COLOR_YELLOW, string);
format(string, sizeof(string), "Hello %s", PlayerName(playerid));
SendClientMessageToAll(COLOR_YELLOW, string);