public OnPlayerText(playerid, text[])
{
if(bloquear_chat == true) {
//SendClientMessage(playerid, COR_VERMELHO, "|ERRO| CHAT BLOQUEADO!");
return 0;
}
if(bloquear_chat == false) {
new texto[128], Str[128];
if(sscanf(text, "s[128]", texto))
format(Str, sizeof(Str), "{FF8040}%s:{FFFFFF} %s", PlayerInfo[playerid][pNome], texto);
MessageToPlayers(-1, Str);
return 1;
}
|
Eu nгo entendi bem o que aconteceu... mas vocк poderia mandar a parte do "MessageToPlayers"?
|
stock MessageToPlayers(cor, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 0)
{
SendClientMessage(i, cor, string);
}
}
}
return 1;
}
|
Fiz essa gambiarra como chat, pro player poder usar o chat na tela de login.
Mas quando ele manda mensagem o chat meio que pula uma linha, ai fica mensagem do player, linha vazia, mensagem seguinte Код:
public OnPlayerText(playerid, text[])
{
if(bloquear_chat == true) {
//SendClientMessage(playerid, COR_VERMELHO, "|ERRO| CHAT BLOQUEADO!");
return 0;
}
if(bloquear_chat == false) {
new texto[128], Str[128];
if(sscanf(text, "s[128]", texto))
format(Str, sizeof(Str), "{FF8040}%s:{FFFFFF} %s", PlayerInfo[playerid][pNome], texto);
MessageToPlayers(-1, Str);
return 1;
}
|
if(bloquear_chat == true) {
//SendClientMessage(playerid, COR_VERMELHO, "|ERRO| CHAT BLOQUEADO!");
return 0;
}
else(bloquear_chat == false) {
new texto[128], Str[128];
if(sscanf(text, "s[128]", texto))
format(Str, sizeof(Str), "{FF8040}%s:{FFFFFF} %s", PlayerInfo[playerid][pNome], texto);
MessageToPlayers(-1, Str);
return 1;
}
|
Tente isso:
Код:
if(bloquear_chat == true) {
//SendClientMessage(playerid, COR_VERMELHO, "|ERRO| CHAT BLOQUEADO!");
return 0;
}
else(bloquear_chat == false) {
new texto[128], Str[128];
if(sscanf(text, "s[128]", texto))
format(Str, sizeof(Str), "{FF8040}%s:{FFFFFF} %s", PlayerInfo[playerid][pNome], texto);
MessageToPlayers(-1, Str);
return 1;
}
qualquer coisa me chama no Skype: +55 18 98146 9723 ( coloca onde pesquisa para procurar amigo ). |
public OnPlayerText(playerid, text[])
{
if(bloquear_chat == true)
return 0;
new Str[128];
format(Str, sizeof(Str), "{FF8040}%s:{FFFFFF} %s", PlayerInfo[playerid][pNome], text);
MessageToPlayers(-1, Str);
return 0;
}
|
https://sampwiki.blast.hk/wiki/OnPlayerText
PHP код:
|