[Ajuda] onPlayerText
#1

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

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

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);
Reply
#4

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

Quote:
Originally Posted by [Y]Falcon
Посмотреть сообщение
Me diga como alguйm vai digitar mais que 128 caracteres...
consigo escrever mais de 200 ...
Reply
#6

Nгo tenho certeza mas acho q o maximo aceito no chat do SAMP й 128...
Reply
#7

Chatbox com suporte a mais de 200 caracteres ?! Ok...
Reply
#8

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);
Reply
#9

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

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.
pawn Код:
new string[128 +21];
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)