[DUV] Retirar Underline.. -
Ryan_Howllet - 19.01.2011
Ae galera, estou com uma dъvida..
Como eu faзo para remover o underline do nome de um player?
Por exemplo, quando ele loga, se nгo tiver o underline no nome ele й kickado, por nome nao rpg.
Atй ai tudo bem, o que eu quero fazer й que quando ele mande alguma mensagem nao apareзa o underline..
Код:
if(strfind(pNome(playerid), "_", true) == -1) // Assim verifica se tem o underline
mas como eu faзo para tira-lo apenas em mensagens ou algo do tipo?
Код:
EX:
Fula_No diz: Errado.
Fula No diz: Certo
Tem como fazer isso?
vlw.
Re: [DUV] Retirar Underline.. -
Fabricio_Rios - 19.01.2011
eu axo que nгo tem como mudar sу no chat sу se vc mudar o nome ): ai teria como vc substitui o _ por um espaзo
Re: [DUV] Retirar Underline.. -
Yakushi Icefox - 19.01.2011
pawn Код:
new string[126];
new nome = GetPlayerName(playerid);
new i = strfind(nome, "_", true);
strdel(nome, i, i+1);
strins(nome, " ", i);
format(string, sizeof(string), %s diz: %s, nome, text);
Creio que й esse cуdigo. Dai nгo sei se vocк utiliza ProxDetector, mas a String formatada com espaзo й - se meu cуdigo estiver certo - essa "string".
Att.
Yakushi Icefox
@Edit: Isso no "OnPlayerText". E nгo sei se vocк jб fez isso, mas troque o "return 1" por "return 0", para desabilitar o Chat Global. Nгo creio que dб para usar o Chat Global Padrгo, alterando o nome.
Re: [DUV] Retirar Underline.. -
Ryan_Howllet - 19.01.2011
Quote:
Originally Posted by Yakushi Icefox
pawn Код:
new string[126]; new nome = GetPlayerName(playerid); new i = strfind(nome, "_", true); strdel(nome, i, i+1); strins(nome, " ", i); format(string, sizeof(string), %s diz: %s, nome, text);
Creio que й esse cуdigo. Dai nгo sei se vocк utiliza ProxDetector, mas a String formatada com espaзo й - se meu cуdigo estiver certo - essa "string".
Att.
Yakushi Icefox
@Edit: Isso no "OnPlayerText". E nгo sei se vocк jб fez isso, mas troque o "return 1" por "return 0", para desabilitar o Chat Global. Nгo creio que dб para usar o Chat Global Padrгo, alterando o nome.
|
Nгo funcionou, continua o underline.
vlw pela ajuda.
Re: [DUV] Retirar Underline.. - rjjj - 19.01.2011
Estou com sono jб, nгo deu pra testar, qualquer coisa os outros membros do fуrum o ajudam
pawn Код:
new Nick2[MAX_PLAYER_NAME], Nick3[MAX_PLAYER_NAME];
if(strfind(pNome(playerid), "_", true) == -1)
{
format(Nick2, sizeof(Nick2), pNome(playerid));
strdel(pNome(playerid),0,GetPosStringChar(pNome(playerid),"_"));
format(Nick3, sizeof(Nick3), pNome(playerid));
strdel(Nick2,GetPosStringChar(pNome(playerid),"_"),strlen(Nick2));
format(pNome(playerid), MAX_PLAYER_NAME, "%s %s",Nick3,Nick2);
}
Coloque no Fim do GM tambйm:
pawn Код:
stock GetPosStringChar(texto[],caractere[])//Crйditos б [FeK]Ken ou rjjj, por essa funзгo =]
{
if(strfind(texto, caractere, true) != -1)
{
for(new x = 0; x <= strlen(texto); x++)
{
strdel(texto, 0, x);
if(strcmp(texto,caractere,true)==0)
{
return x;
}
}
}
return 1;
}
Espero ter ajudado
Re: [DUV] Retirar Underline.. -
Trinix_PoS [Bizu] - 19.01.2011
Lol Cria um comando /mudarnickplayer dai tu muda
Re: [DUV] Retirar Underline.. -
Ryan_Howllet - 19.01.2011
Quote:
Originally Posted by Trinix_PoS [Bizu]
Lol Cria um comando /mudarnickplayer dai tu muda
|
Se toda vez que vocк tiver uma dъvida e nгo conseguir resolve-la e criar uma ganbiarra para fazer aquilo que vocк gostaria, teu GM fica um lixo, cheio de cуdigos inъteis.
@ Ainda nгo tentei o Cуdigo, vou pra escola, quando chegar eu tento.
Re: [DUV] Retirar Underline.. -
Macintosh - 19.01.2011
Quote:
Originally Posted by Trinix_PoS [Bizu]
Lol Cria um comando /mudarnickplayer dai tu muda
|
Se o cara for mudar o nick de todos que entrarem tб й fudido .-.
Respuesta: [DUV] Retirar Underline.. -
ipsBruno - 19.01.2011
Nossa quanta falta de otimizaзгo..
pawn Код:
stock RetireUnderlineFromName(playerid,forchar)
{
static Name[24],sIndex = 0;
GetPlayerName(playerid,Name,24);
while(Name[sIndex])
{
if(Name[sIndex] == '_')
{
Name[sIndex] = forchar;
break;
}
++sIndex;
}
return Name;
}
Dai sу usa:
Код:
SetPlayerName(playerid,RetireUnderlineFromName(playerid,'-')); // '-' mude
Removerб '_' para '-'
Re: [DUV] Retirar Underline.. -
Ricop522 - 19.01.2011
pawn Код:
stock NickPlayer(playerid)
{
new string[24];
GetPlayerName(playerid,string,24);
new str[24];
strmid(str,string,0,strlen(string),24);
for(new i = 0; i < MAX_PLAYER_NAME; ++i)
{
if (str[i] == '_') str[i] = ' ';
}
return str;
}
... ,NickPlayer(playerid)