[Ajuda] Chat Erro
#1

Estou com Esse erro no chat, alguma soluзгo? Sou Novato!!
https://prnt.sc/ih25c1

Code:

public OnPlayerText(playerid, text[])
{
new string[256];
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);

if(PlayerInfo[playerid][Logged] == 0)
{
SendClientMessage(playerid, Vermelho, "Logue-se antes.");
return 0;
}

if(Mute[playerid] == 1)
{
SendClientMessage(playerid, Vermelho, "|_ ANTI-FLOOD _| Vocк nгo pode falar enquanto estб mudo!");
return 0;
}
Reply
#2

Mande a OnPlayerText completa, estб faltando coisas ai.
Reply
#3

public OnPlayerText(playerid, text[])
{
new string[256];
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);

if(PlayerInfo[playerid][Logged] == 0)
{
SendClientMessage(playerid, Vermelho, "Logue-se antes.");
return 0;
}

if(Mute[playerid] == 1)
{
SendClientMessage(playerid, Vermelho, "|_ ANTI-FLOOD _| Vocк nгo pode falar enquanto estб mudo!");
return 0;
}

if(AFK[playerid] == 1)
{
SendClientMessage(playerid, Vermelho, "{FFFFFF}Para voltar ao jogo digite {00FF00}/on");
return 0;
}

if(NaFaculdade[playerid] == 1)
{
Conversa[playerid] = Conversa[playerid]++;
if(Conversa[playerid] == 3)
{
minutos[playerid] = 0;
NaFaculdade[playerid] = 0;
SpawnPlayer(playerid);
SendClientMessage(playerid, Vermelho, "Vocк conversou muito e foi expulso da biblioteca!");
}
format(string, sizeof(string), "Vocк estб conversando. Vocк recebeu um aviso, agora vocк estб com %d/3 aviso(s).", Conversa[playerid]);
SendClientMessage(playerid, Aviso, string);
return 0;
}

if(GetTickCount() > FloodTimer[playerid])
{
FloodAlert[playerid] = 0;
}

FloodTimer[playerid] = GetTickCount() +TimerFlood;
FloodAlert[playerid]++;

if(FloodAlert[playerid] > 1 && FloodAlert[playerid] < AlertFlood-1)
{
format(string, sizeof(string), "|_ ANTI-FLOOD _| Vocк tem %d/%d avisos.", FloodAlert[playerid], AlertFlood);
SendClientMessage(playerid, Amarelo, string);
}
else if(FloodAlert[playerid] == AlertFlood-1)
{
format(string, sizeof(string), "|_ ANTI-FLOOD _| Vocк tem %d/%d avisos. Mais um e vocк serб kickado.", FloodAlert[playerid], AlertFlood);
SendClientMessage(playerid, Amarelo, string);
}
else if(FloodAlert[playerid] == AlertFlood)
{
format(string, sizeof(string), "O(A) jogador(a) %s foi kickado(a) por BPSBot. Motivo: Flood Chat", GetPlayerNameEx(playerid));
SendClientMessageToAll(Amarelo, string);
KickLog(string);
Kick(playerid);
return 0;
}

if(!(pAdmin[playerid] >= 1))
{
for(new p = 0; p < sizeof Palavroes; p++)
{
new fp = strfind(text, Palavroes[p], true);
while(fp != -1)
{
for(new i = 0; i < strlen(Palavroes[p]); i++)
{
text[fp + i] = '_';
}
fp = strfind(text, Palavroes[p], true);
}
}

if(VBIsIP(text))
{
SendClientMessage(playerid, Amarelo, "|_ ANTI-SPAM _| Vocк nгo pode fazer spam no servidor.");
return 0;
}
}

if(InCall[playerid] == 1)
{
format(str3, 128, " [Celular] %s (%d): %s", GetPlayerNameEx(playerid), playerid, text);
SendClientMessage(gc, BLUEWHITE, str3);
format(str3, 128, " [Celular] %s (%d): %s", GetPlayerNameEx(playerid), playerid, text);
SendClientMessage(sender, BLUEWHITE, str3);
return 0;
}

if(dini_Int(file, "Entrevista") == 1)
{
format(string,sizeof(string), "[»] O entrevistado %s responde: %s", aname, text);
SendPlayerMessageToAll(playerid, string);
return 0;
}

if(dini_Int(file, "Entrevista") == 2)
{
format(string,sizeof(string), "[»] O reporter %s pergunta: %s", aname, text);
SendPlayerMessageToAll(playerid, string);
return 0;
}

SetPlayerChatBubble(playerid, text, Azul, 50.0, 10000);

if(pAdmin[playerid] == 1)
{
format(string, 256, "[ID: %d] :::. {F34F00}Auxiliar {FFFFFF}.:::™ {00FF80}%s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

if(pAdmin[playerid] == 2)
{
format(string, 256, "[ID: %d] :::. {6A5ACD}Moderador {FFFFFF}.:::™ {00FF80}%s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

if(pAdmin[playerid] == 3)
{
format(string, 256, "[ID: %d] :::. {00FF80}Master {FFFFFF}.:::™ {00FF80}%s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

if(pAdmin[playerid] == 4)
{
format(string, 256, "[ID: %d] :::. {D7DF01}Anti-Cheat {FFFFFF}.:::™ %s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

if(pAdmin[playerid] ==5)
{
format(string, 256, "[ID: %d] :::. {00FFFF}Coord {FFFFFF}.:::™ %s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

if(pAdmin[playerid] == 6)
{
format(string, 256, "[ID: %d] :::. {01DF01}Sub-Dono {FFFFFF}.:::™ {045FB4}%s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

if(pAdmin[playerid] == 7)
{
format(string, 256, "[ID: %d] :::. {FFCA86}Scripter {FFFFFF}.:::™ %s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

if(pAdmin[playerid] ==
{
format(string, 256, "[ID: %d] :::. {1602F4}Dono {FFFFFF}.:::™ {00FF80}%s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

if(vip[playerid] == 1)
{
format(string, 256, "[ID: %d] {FF0000}[PREMIUM]: {FF8000}%s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

if(Chatlb == 1)
{
format(string, sizeof(string), "[{DF0101}ID: {2E9AFE}%d{FFFFFF}] %s", playerid, text);
SendPlayerMessageToAll(playerid, string);
}
else
{
ChatProximo(playerid, text);
}
return 0;
}
Reply
#4

Continua pulando linha
Reply
#5

PHP код:
public OnPlayerText(playeridtext[])
{
new 
string[256];
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(playeridanameMAX_PLAYER_NAME);
format(filesizeof(file), PASTA_CONTASaname);
if(
PlayerInfo[playerid][Logged] == 0)
{
SendClientMessage(playeridVermelho"Logue-se antes.");
return 
0;
}
if(
Mute[playerid] == 1)
{
SendClientMessage(playeridVermelho"|_ ANTI-FLOOD _| Vocк nгo pode falar enquanto estб mudo!");
return 
0;
}
if(
AFK[playerid] == 1)
{
SendClientMessage(playeridVermelho"{FFFFFF}Para voltar ao jogo digite {00FF00}/on");
return 
0;
}
if(
NaFaculdade[playerid] == 1)
{
Conversa[playerid] = Conversa[playerid]++;
if(
Conversa[playerid] == 3)
{
minutos[playerid] = 0;
NaFaculdade[playerid] = 0;
SpawnPlayer(playerid);
SendClientMessage(playeridVermelho"Vocк conversou muito e foi expulso da biblioteca!");
}
format(stringsizeof(string), "Vocк estб conversando. Vocк recebeu um aviso, agora vocк estб com %d/3 aviso(s)."Conversa[playerid]);
SendClientMessage(playeridAvisostring);
return 
0;
}
if(
GetTickCount() > FloodTimer[playerid])
{
FloodAlert[playerid] = 0;
}
FloodTimer[playerid] = GetTickCount() +TimerFlood;
FloodAlert[playerid]++;
if(
FloodAlert[playerid] > && FloodAlert[playerid] < AlertFlood-1)
{
format(stringsizeof(string), "|_ ANTI-FLOOD _| Vocк tem %d/%d avisos."FloodAlert[playerid], AlertFlood);
SendClientMessage(playeridAmarelostring);
}
else if(
FloodAlert[playerid] == AlertFlood-1)
{
format(stringsizeof(string), "|_ ANTI-FLOOD _| Vocк tem %d/%d avisos. Mais um e vocк serб kickado."FloodAlert[playerid], AlertFlood);
SendClientMessage(playeridAmarelostring);
}
else if(
FloodAlert[playerid] == AlertFlood)
{
format(stringsizeof(string), "O(A) jogador(a) %s foi kickado(a) por BPSBot. Motivo: Flood Chat"GetPlayerNameEx(playerid));
SendClientMessageToAll(Amarelostring);
KickLog(string);
Kick(playerid);
return 
0;
}
if(!(
pAdmin[playerid] >= 1))
{
for(new 
0sizeof Palavroesp++)
{
new 
fp strfind(textPalavroes[p], true);
while(
fp != -1)
{
for(new 
0strlen(Palavroes[p]); i++)
{
text[fp i] = '_';
}
fp strfind(textPalavroes[p], true);
}
}
if(
VBIsIP(text))
{
SendClientMessage(playeridAmarelo"|_ ANTI-SPAM _| Vocк nгo pode fazer spam no servidor.");
return 
0;
}
}
if(
InCall[playerid] == 1)
{
format(str3128" [Celular] %s (%d): %s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessage(gcBLUEWHITEstr3);
format(str3128" [Celular] %s (%d): %s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessage(senderBLUEWHITEstr3);
return 
0;
}
if(
dini_Int(file"Entrevista") == 1)
{
format(string,sizeof(string), "[»] O entrevistado %s responde: %s"anametext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
if(
dini_Int(file"Entrevista") == 2)
{
format(string,sizeof(string), "[»] O reporter %s pergunta: %s"anametext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
SetPlayerChatBubble(playeridtextAzul50.010000);
if(
pAdmin[playerid] == 1)
{
format(stringsizeof(string), "[ID: %d] :::. {F34F00}Auxiliar {FFFFFF}.:::™ {00FF80}%s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
if(
pAdmin[playerid] == 2)
{
format(stringsizeof(string), "[ID: %d] :::. {6A5ACD}Moderador {FFFFFF}.:::™ {00FF80}%s"playeridtext);
SendPlayerMessageToAll(playerid,string);
return 
0;
}
if(
pAdmin[playerid] == 3)
{
format(stringsizeof(string), "[ID: %d] :::. {00FF80}Master {FFFFFF}.:::™ {00FF80}%s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
if(
pAdmin[playerid] == 4)
{
format(stringsizeof(string), "[ID: %d] :::. {D7DF01}Anti-Cheat {FFFFFF}.:::™ %s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
if(
pAdmin[playerid] ==5)
{
format(stringsizeof(string), "[ID: %d] :::. {00FFFF}Coord {FFFFFF}.:::™ %s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
if(
pAdmin[playerid] == 6)
{
format(stringsizeof(string), "[ID: %d] :::. {01DF01}Sub-Dono {FFFFFF}.:::™ {045FB4}%s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
if(
pAdmin[playerid] == 7)
{
format(stringsizeof(string), "[ID: %d] :::. {FFCA86}Scripter {FFFFFF}.:::™ %s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
if(
pAdmin[playerid] == 8)
{
format(stringsizeof(string), "[ID: %d] :::. {1602F4}Dono {FFFFFF}.:::™ {00FF80}%s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
if(
vip[playerid] == 1)
{
format(stringsizeof(string), "[ID: %d] {FF0000}[PREMIUM]: {FF8000}%s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}
if(
Chatlb == 1)
{
format(stringsizeof(string), "[{DF0101}ID: {2E9AFE}%d{FFFFFF}] %s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
}
else
{
ChatProximo(playeridtext);
}
return 
0;

SendClientMessageToAll

@Off

Sempre use [pawn*] Cуdigo [/pawn*] (tire os *), ficarб assim:
pawn Код:
Cуdigo
Reply
#6

Sу pra lembrar que client messages suportam atй 144 caracteres (incluindo cуdigo de cores), por isso o sistema que vocк pegou pronto, faz isto de pular linha, jб que o possui mais firulas que a mensagem de texto do jogador.

Ao faze do jeito acima, sempre limite a quantidade de caracteres para 144, para evitar que a mensagem seja ignorada pelo servidor.

PHP код:
static string[144]; 
Reply
#7

Allan Parou de pular linha, porйm o Nome do Admin/player n aparece '-'
Reply
#8

PHP код:
public OnPlayerText(playeridtext[])
{
new 
string[256];
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(playeridanameMAX_PLAYER_NAME);
format(filesizeof(file), PASTA_CONTASaname);

if(
PlayerInfo[playerid][Logged] == 0)
{
SendClientMessage(playeridVermelho"Logue-se antes.");
return 
0;
}

if(
Mute[playerid] == 1)
{
SendClientMessage(playeridVermelho"|_ ANTI-FLOOD _| Vocк nгo pode falar enquanto estб mudo!");
return 
0;
}

if(
AFK[playerid] == 1)
{
SendClientMessage(playeridVermelho"{FFFFFF}Para voltar ao jogo digite {00FF00}/on");
return 
0;
}

if(
NaFaculdade[playerid] == 1)
{
Conversa[playerid] = Conversa[playerid]++;
if(
Conversa[playerid] == 3)
{
minutos[playerid] = 0;
NaFaculdade[playerid] = 0;
SpawnPlayer(playerid);
SendClientMessage(playeridVermelho"Vocк conversou muito e foi expulso da biblioteca!");
}
format(stringsizeof(string), "Vocк estб conversando. Vocк recebeu um aviso, agora vocк estб com %d/3 aviso(s)."Conversa[playerid]);
SendClientMessage(playeridAvisostring);
return 
0;
}

if(
GetTickCount() > FloodTimer[playerid])
{
FloodAlert[playerid] = 0;
}

FloodTimer[playerid] = GetTickCount() +TimerFlood;
FloodAlert[playerid]++;

if(
FloodAlert[playerid] > && FloodAlert[playerid] < AlertFlood-1)
{
format(stringsizeof(string), "|_ ANTI-FLOOD _| Vocк tem %d/%d avisos."FloodAlert[playerid], AlertFlood);
SendClientMessage(playeridAmarelostring);
}
else if(
FloodAlert[playerid] == AlertFlood-1)
{
format(stringsizeof(string), "|_ ANTI-FLOOD _| Vocк tem %d/%d avisos. Mais um e vocк serб kickado."FloodAlert[playerid], AlertFlood);
SendClientMessage(playeridAmarelostring);
}
else if(
FloodAlert[playerid] == AlertFlood)
{
format(stringsizeof(string), "O(A) jogador(a) %s foi kickado(a) por BPSBot. Motivo: Flood Chat"GetPlayerNameEx(playerid));
SendClientMessageToAll(Amarelostring);
KickLog(string);
Kick(playerid);
return 
0;
}

if(!(
pAdmin[playerid] >= 1))
{
for(new 
0sizeof Palavroesp++)
{
new 
fp strfind(textPalavroes[p], true);
while(
fp != -1)
{
for(new 
0strlen(Palavroes[p]); i++)
{
text[fp i] = '_';
}
fp strfind(textPalavroes[p], true);
}
}

if(
VBIsIP(text))
{
SendClientMessage(playeridAmarelo"|_ ANTI-SPAM _| Vocк nгo pode fazer spam no servidor.");
return 
0;
}
}

if(
InCall[playerid] == 1)
{
format(str3128" [Celular] %s (%d): %s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessage(gcBLUEWHITEstr3);
format(str3128" [Celular] %s (%d): %s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessage(senderBLUEWHITEstr3);
return 
0;
}

if(
dini_Int(file"Entrevista") == 1)
{
format(string,sizeof(string), "[»] O entrevistado %s responde: %s"anametext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

if(
dini_Int(file"Entrevista") == 2)
{
format(string,sizeof(string), "[»] O reporter %s pergunta: %s"anametext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

SetPlayerChatBubble(playeridtextAzul50.010000);

if(
pAdmin[playerid] == 1)
{
format(stringsizeof(string), "%s [ID: %d] :::. {F34F00}Auxiliar {FFFFFF}.:::™ {00FF80}%s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

if(
pAdmin[playerid] == 2)
{
format(stringsizeof(string), "%s [ID: %d] :::. {6A5ACD}Moderador {FFFFFF}.:::™ {00FF80}%s"GetPlayerNameEx(playerid), playeridtext);
SendPlayerMessageToAll(playerid,string);
return 
0;
}

if(
pAdmin[playerid] == 3)
{
format(stringsizeof(string), "%s [ID: %d] :::. {00FF80}Master {FFFFFF}.:::™ {00FF80}%s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

if(
pAdmin[playerid] == 4)
{
format(stringsizeof(string), "%s [ID: %d] :::. {D7DF01}Anti-Cheat {FFFFFF}.:::™ %s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

if(
pAdmin[playerid] ==5)
{
format(stringsizeof(string), "%s [ID: %d] :::. {00FFFF}Coord {FFFFFF}.:::™ %s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

if(
pAdmin[playerid] == 6)
{
format(stringsizeof(string), "[ID: %d] :::. {01DF01}Sub-Dono {FFFFFF}.:::™ {045FB4}%s"playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

if(
pAdmin[playerid] == 7)
{
format(stringsizeof(string), "%s [ID: %d] :::. {FFCA86}Scripter {FFFFFF}.:::™ %s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

if(
pAdmin[playerid] == 8)
{
format(stringsizeof(string), "%s [ID: %d] :::. {1602F4}Dono {FFFFFF}.:::™ {00FF80}%s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

if(
vip[playerid] == 1)
{
format(stringsizeof(string), "%s [ID: %d] {FF0000}[PREMIUM]: {FF8000}%s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 
0;
}

if(
Chatlb == 1)
{
format(stringsizeof(string), "%s [{DF0101}ID: {2E9AFE}%d{FFFFFF}] %s"GetPlayerNameEx(playerid), playeridtext);
SendClientMessageToAll(GetPlayerColor(playerid),string);
}
else
{
ChatProximo(playeridtext);
}
return 
0;

Reply
#9

Muito obrigado, Como faзo pra te avaliar?
Reply
#10

Tem um botгo, parecido com uma estrela, de cor preta abaixo do meu nome, ali й para dar reputaзгo, sу clicar e por um comentбrio.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)