[Ajuda] Definir Total de Caracteres
#1

Tem como definir o total de caracteres de uma linha?
Exemplo, no server o player digita normal e quando passa de 30 caracteres e frase continua em outra linha abaixo..
Como mudar isso, quero que a frase permaneзa na primeira linha apos ultrapassar 30 caracteres..!

Reply
#2

Procure sua callback OnPlayerText, provavelmente й ela que estб fazendo esta funзгo caso passar de 30 caracteres mandar outra mensagem com o resto dos caracteres.

@EDIT

Se nгo me engano o mбximo de caracteres em uma linha й 145. Nгo tenho certeza.
Reply
#3

Parece que nгo, se tiver n consigo identificar !!
Se puder ajudar ta ai a callback!!

Quote:

public OnPlayerText(playerid, text[])
{
if (strlen(text) > 50) {
SendClientMessage(playerid, 0xFF0000FF, "Seu texto estб muito grande, por favor reduza-o!");
return false;
}
if(APlayerData[playerid][LoggedIn] == true)
{
new MsgText[128];
for(new fdp=0;fdp<124;fdp++)
{
if(strfind(text, IP[fdp], true) != -1)
{
new string[300];
new string2[300];
format(string2, sizeof(string2), "|- O jogador {FFffff}%s{ff0000} foi kickado (Razгo: {ffffff}Divulgando IP{ff0000}) -|",rNome(playerid));
SendClientMessageToAll(0xFF0000FF, string2);
new nomefdp[300], ipdivulgado[300], ipfdp[300], iplolol[300];
GetPlayerIp(playerid,iplolol,300);
GetPlayerName(playerid, nomefdp, 300);
format(ipdivulgado, 300, "%s", text);
format(ipfdp, 300, "%s", iplolol);
new Filefdp=fopen("ServerData/Divulgando/Divulgadores.txt", io_append);
new iFDP = strval(ipfdp);
format(string, 300, "Nome Do FDP: %s - Ip Divulgado: %s - Ip do FDP: %s \n", nomefdp ,ipdivulgado, iFDP);
fwrite(ofdp, string);
print(string);
fclose(ofdp);
TimerFDP = SetTimerEx("FDP", 1, 0, "i", playerid);
return 0;
}
}
if(GetTickCount() > FloodTimer[playerid])
{
FloodAlert[playerid] = 0;
}
FloodTimer[playerid] = GetTickCount() + TimerFlood;
FloodAlert[playerid] ++;
if(FloodAlert[playerid] > 1 && FloodAlert[playerid] < AlertFlood-1)
{
}
else if(FloodAlert[playerid] == AlertFlood-1)
{
}
else if(FloodAlert[playerid] == AlertFlood)
{
new string[1000];
new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "|- {ffffff}%s {ff0000}foi calado automaticamente por {ffffff}2 {ff0000}minutos por floodar no chat -|", pname);
SendClientMessageToAll(0xFF0000FF, string);
APlayerData[playerid][Muted] = true;
SetTimer("LiberarChat",2*60*1000,0);
SendClientMessage(playerid, 0xFF0000FF, "FLOOD: Vocк foi calado por 2 minutos.");
return 0;
}
if (APlayerData[playerid][Muted] == true)
{
SendClientMessage(playerid, 0xFF0000FF, "ERRO: Vocк estб calado, e nгo pode usar o chat.");
return false;
}
if (APlayerData[playerid][Muted] == true || APlayerData[playerid][LoggedIn] == false)
{
SendClientMessage(playerid, 0xFF0000FF, "ERRO: Logue-se primeiro.");
return false;
}
/* --------------------------------------------------------*/
// Anti Capslock
/* --------------------------------------------------------*/
for(new x, y = strlen(text); x != y; ++x)
{
text[x] = tolower(text[x]);
}
/* --------------------------------------------------------*/

/* --------------------------------------------------------*/
// Tag Chat: STAFF, DONO, VIP //
/* --------------------------------------------------------*/
if(APlayerData[playerid][PlayerLevel] ==
{
SetPlayerChatBubble(playerid, text, 0xFFFDE8AA, 100.0, 10000);
format(MsgText, sizeof (MsgText), "{FFFFFF}[ID:%d]{EE0000}[FUNDADOR]{ffffff}: %s", playerid, text);
SendPlayerMessageToAll(playerid,MsgText);
return 0;
}
if(APlayerData[playerid][PlayerLevel] == 7)
{
SetPlayerChatBubble(playerid, text, 0xFFFDE8AA, 100.0, 10000);
format(MsgText, sizeof (MsgText), "{FFFFFF}[ID:%d]{00FF00}[DONO]{ffffff}: %s", playerid, text);
SendPlayerMessageToAll(playerid,MsgText);
return 0;
}
if(APlayerData[playerid][PlayerLevel] >= 2)
{
SetPlayerChatBubble(playerid, text, 0xFFFDE8AA, 100.0, 10000);
format(MsgText, sizeof (MsgText), "{FFFFFF}[ID:%d]{00EE76}[STAFF]{ffffff}: %s", playerid, text);
SendPlayerMessageToAll(playerid,MsgText);
return 0;
}
if(APlayerData[playerid][PlayerLevel] == 1)
{
SetPlayerChatBubble(playerid, text, 0xFFFDE8AA, 100.0, 10000);
format(MsgText, sizeof (MsgText), "{FFFFFF}[ID:%d]{9400D3}[DJ]{ffffff}: %s", playerid, text);
SendPlayerMessageToAll(playerid,MsgText);
return 0;
}
else if(APlayerData[playerid][VIPLevel] >= 1)
{
SetPlayerChatBubble(playerid, text, 0xFFFDE8AA, 100.0, 10000);
format(MsgText, sizeof (MsgText), "{FFFFFF}[ID:%d]{ffff00}[VIP]{FFFFFF}: %s", playerid, text);
SendPlayerMessageToAll(playerid,MsgText);
return 0;
}
/* --------------------------------------------------------*/
if(Chat[bloqueado] == true)
{
SendClientMessage(playerid, 0xFF0000FF, "ERRO: O chat foi bloqueado por um administrador.");
return 0;
}
else if(APlayerData[playerid][PlayerName])
{
SetPlayerChatBubble(playerid, text, 0xFFFDE8AA, 100.0, 10000);
format(MsgText, sizeof (MsgText), "{FFFFFF}[ID:%d]: %s", playerid, text);
SendPlayerMessageToAll(playerid,MsgText);
return 0;
}
}
else{
SendClientMessage(playerid, 0xFF0000FF, "ERRO: Logue-se primeiro.");
}
return 0;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)