[Ajuda] onPlayerText -
rafa3dify - 29.09.2011
Ola gente, eu queria uma ajuda no OnPlayerText.. Instalei a paradinha de sair o id do player no chat, so que eu queria que so o Nome dele ficasse com a cor do player, e o texto saisse branco, mais como faзo??
pawn Код:
new string456[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string456, sizeof(string456), "%s [%i] diz: %s",pName, playerid, text);
new cor123 = GetPlayerColor(playerid);
SendClientMessageToAll(cor123, string456);
Re: Ajuda onPlayerText -
Falcon. - 29.09.2011
Olб
rafa3dify,
aqui estб:
pawn Код:
static _string[128];
GetPlayerName(playerid, pName, 24);
format(_string, sizeof(_string), "%s {FFFFFF}[%i] diz: %s",pName, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), _string);
Atenciosamente,
Falcon.
Re: Ajuda onPlayerText -
[O.z]Caroline - 29.09.2011
Quote:
Originally Posted by [Y]Falcon
Olб rafa3dify,
aqui estб:
pawn Код:
static _string[128]; GetPlayerName(playerid, pName, 24); format(_string, sizeof(_string), "%s {FFFFFF}[%i] diz: %s",pName, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), string456);
Atenciosamente,
Falcon.
|
pawn Код:
if(strlen(text) > 128) return 0;
static _string[128];
GetPlayerName(playerid, pName, 24);
format(_string, sizeof(_string), "%s {FFFFFF}[%i] diz: %s",pName, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string456);
Re: Ajuda onPlayerText -
Falcon. - 29.09.2011
Quote:
Originally Posted by [O.z]Caroline
pawn Код:
if(strlen(text) > 128) return 0; static _string[128]; GetPlayerName(playerid, pName, 24); format(_string, sizeof(_string), "%s {FFFFFF}[%i] diz: %s",pName, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), string456);
|
Me diga como alguйm vai digitar mais que 128 caracteres...
Re: Ajuda onPlayerText -
[O.z]Caroline - 29.09.2011
Quote:
Originally Posted by [Y]Falcon
Me diga como alguйm vai digitar mais que 128 caracteres...
|
consigo escrever mais de 200 ...
Re: Ajuda onPlayerText -
Pharrel - 29.09.2011
Nгo tenho certeza mas acho q o maximo aceito no chat do SAMP й 128...
Re: Ajuda onPlayerText -
Falcon. - 29.09.2011
Chatbox com suporte a mais de 200 caracteres ?! Ok...
Re: Ajuda onPlayerText -
[O.z]Caroline - 29.09.2011
Quote:
Originally Posted by [Y]Falcon
Chatbox com suporte a mais de 200 caracteres ?! Ok...
|
nгo, mais de qualquer forma seu cуdigo estб incorreto, darб undefined symbol 'pName'.
pawn Код:
static _string[128], pName[24];
GetPlayerName(playerid, pName, 24);
format(_string, sizeof(_string), "%s {FFFFFF}[ID:%i] diz: %s",pName, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), _string);
Re: Ajuda onPlayerText -
Falcon. - 29.09.2011
Quote:
Originally Posted by [O.z]Caroline
nгo, mais de qualquer forma seu cуdigo estб incorreto, darб undefined symbol 'pName'.
pawn Код:
static _string[128], pName[24]; GetPlayerName(playerid, pName, 24); format(_string, sizeof(_string), "%s {FFFFFF}[ID:%i] diz: %s",pName, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), _string);
|
Para o caso de nгo tiver percebido, este й uma 'adaptaзгo' do cуdigo que o usuбrio postou.
Obviamente ele jб deve conter a variбvel, por isto mesmo nгo criei outra.
Nгo tente corrigir oque nгo sabe.
Atenciosamente,
Falcon.
Re: Ajuda onPlayerText -
[O.z]Caroline - 29.09.2011
Quote:
Originally Posted by [Y]Falcon
Para o caso de nгo tiver percebido, este й uma 'adaptaзгo' do cуdigo que o usuбrio postou.
Obviamente ele jб deve conter a variбvel, por isto mesmo nгo criei outra.
Nгo tente corrigir oque nгo sabe.
Atenciosamente,
Falcon.
|
se o chat do texto suporta 128 caracteres, e sua string й 21 caracteres a mais.
entгo logo quando o player digitar 107 caracteres provavelmente bugara o xat.
Ps: faзa as liзхes de casa.