PDA

View Full Version : [HELP] Player Name !


M0HAMMAD
25/01/2015, 06:30 PM
hi everybody !
first, I'm working at a RP Gamemode, So in rp mode, player must have a nick like "samp_samp".
when player chat, chat will be send like "samp_samp(ID): message".
i don't know how delete "_" between player name ("samp samp(ID): message")
this is my stock, i'm using it for Playername so i don't add GetPlayerName and ... in all script !
stock PlayerName(playerid) {
new name[255];
GetPlayerName(playerid, name, 255);
return name;
}

CalvinC
25/01/2015, 06:31 PM
Use strreplace and replace all "_" with " " (nothing).
strreplace(name, '_', ' ');
Also the max name of a player is 24, there's no reason to use 255, that'll just slow your script down.

M0HAMMAD
26/01/2015, 05:01 PM
Use strreplace and replace all "_" with " " (nothing).
strreplace(name, '_', ' ');
Also the max name of a player is 24, there's no reason to use 255, that'll just slow your script down.

thanks very much !