[HELP] Player Name !
#1

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;
}
Reply
#2

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.
Reply
#3

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 !
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)