SA-MP Forums Archive
Removing " _ " in player name help pls.! - 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: Removing " _ " in player name help pls.! (/showthread.php?tid=651756)



Removing " _ " in player name help pls.! - TitoRayne - 27.03.2018

Код:
format(namadetag, sizeof(nametag), "{%06x} %s (%i)\n{DB816F}HP: %.0f {FFFFFF}- AR: %.0f", GetPlayerColor(i) >>> 8, playername, i, hp, armour);
Please tell me how to remove the " _ " in name its annoying xD, help pls.


Re: Removing " _ " in player name help pls.! - Amagida - 27.03.2018

PHP код:
stock ConvertInRPStyle(player_name[MAX_PLAYER_NAME])
{
      for(new 
iMAX_PLAYER_NAMEi++)
      {
           if(
player_name[i] == '_')   player_name[i] = ' ';
      }
      return 
player_name;

PHP код:
format(nametagsizeof(nametag), "{%06x} %s (%i)\n{DB816F}HP: %.0f {FFFFFF}- AR: %.0f"GetPlayerColor(i) >>> 8ConvertInRPStyle(playername), ihparmour); 



Re: Removing " _ " in player name help pls.! - TitoRayne - 27.03.2018

Quote:
Originally Posted by Amagida
Посмотреть сообщение
PHP код:
stock ConvertInRPStyle(player_name[MAX_PLAYER_NAME])
{
      for(new 
iMAX_PLAYER_NAMEi++)
      {
           if(
player_name[i] == '_')   player_name[i] = ' ';
      }
      return 
player_name;

PHP код:
format(nametagsizeof(nametag), "{%06x} %s (%i)\n{DB816F}HP: %.0f {FFFFFF}- AR: %.0f"GetPlayerColor(i) >>> 8ConvertInRPStyle(playername), ihparmour); 
Should've show the full name, but it only shows the first name

https://imgur.com/a/cTmhJ


Re: Removing " _ " in player name help pls.! - Amagida - 27.03.2018

This is working Ok from me, i don't know why it shows only first name for you.


Re: Removing " _ " in player name help pls.! - TitoRayne - 27.03.2018

Код:
stock RemoveUnderLine(name[MAX_PLAYER_NAME])
{
  for(new i; i < MAX_PLAYER_NAME; i++)
  {
    if(name[i] == '_') name[i] = ' ';
  }
  return name;
}
how about this?


Re: Removing " _ " in player name help pls.! - Amagida - 27.03.2018

This code and mine, actually looks similiar. we can say, those are same.


Re: Removing " _ " in player name help pls.! - TitoRayne - 27.03.2018

Quote:
Originally Posted by Amagida
Посмотреть сообщение
This code and mine, actually looks similiar. we can say, those are same.
Your server is running? may i able to check it?


Re: Removing " _ " in player name help pls.! - Amagida - 27.03.2018

I don't own server.


Re: Removing " _ " in player name help pls.! - Kane - 27.03.2018

PHP код:
stock GetICName        playerid ) {
    new 
szICNameMAX_PLAYER_NAME+];
    
GetPlayerNameplayeridszICNamesizeofszICName ) );
    for( new 
i=0strlenszICName ); ++) {
        if( 
szICName] == '_' ) {
            
szICName] = ' ';
        }
    }
    return 
szICName;




Re: Removing " _ " in player name help pls.! - AlamoTR - 27.03.2018

Код:
stock GetPlayerNameEx(playerid)
{
	new name[MAX_PLAYER_NAME + 1];
	GetPlayerName(playerid, name, sizeof(name));
 	for (new i = 0, len = strlen(name); i < len; i ++)
	 {
  		if (name[i] == '_') name[i] = ' ';
	}
	return name;
}