[Ajuda] Colocar um 'Mбximo' de Carбcteres
#1

Bom Galera estou com um problema no meu Server, queria colocar os Carбcteres tudo em uma linha sу, isso й possнvel? tipo um total de Carбcteres !

Reply
#2

Tem
Em onplayertext
cria uma string como maximo de caractere que deseja

new string[caracteres];
format(string,sizeof(string), "%s", text);
SendClientMessageToAll(cor, string);

ou
60 as caracteres
if(strlen(text) > 60)return SendClientMessage(playerid, COR,"[ERRO]: Seu texto atingiu o limite mбximo, resuma!"), false;

da return 0 no onplayertext se for usar o primeiro
Reply
#3

Vocк deve usar um SendClientMessageToAll com uma string formatada em OnPlayerText, nesse caso vocк estб utilizando SendPlayerMessageToAll (ou retornando 1 na callback) que faz o texto ser quebrado.
Код:
public OnPlayerText(playerid, text[])
{
	new str[128], name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(str, sizeof(str), "%s (%i): {FFFFFF}%s", name, playerid, text);
	SendClientMessageToAll(GetPlayerColor(playerid), str);
	return 0;
}
Altere a parte vermelha para o nъmero mбximo de caracteres.
Reply
#4

Obrigado!
Reply
#5

Й novato ?, Ainda tem vaga aberta no projeto que eu fiz olha ai no meu perfil ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)