SA-MP Forums Archive
[HELP] Player Name ! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Player Name ! (/showthread.php?tid=559876)



[HELP] Player Name ! - M0HAMMAD - 25.01.2015

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 !
pawn Код:
stock PlayerName(playerid) {
  new name[255];
  GetPlayerName(playerid, name, 255);
  return name;
}



Re: [HELP] Player Name ! - CalvinC - 25.01.2015

Use strreplace and replace all "_" with " " (nothing).
pawn Код:
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.


Re: [HELP] Player Name ! - M0HAMMAD - 26.01.2015

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Use strreplace and replace all "_" with " " (nothing).
pawn Код:
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 !