RE: NAO MOSTRA MEU NOME NO CHAT - pushline - 07/11/2023
Bom, tem coisa faltando ai claramente. Já que não tem o lance do [ID] [VIP] etc.
RE: NAO MOSTRA MEU NOME NO CHAT - Cifra Modder - 07/11/2023
(07/11/2023 17:30)EduzinMods Escreveu: (07/11/2023 14:31)Cifra Modder Escreveu: (07/11/2023 11:24)EduzinMods Escreveu: (07/11/2023 00:52)White_Blue Escreveu: (06/11/2023 21:40)EduzinMods Escreveu: onde tenho q botar ?
imagem: https://imgur.com/a/w1AQuV1
Poste o conteúdo da callback "OnPlayerText" aqui em forma de texto, não use imagens para ilustrar código, pois dificulta a edição e visualização do código.
public OnPlayerText(playerid, text[])
{
new tmp[128];
if(Spawnado[playerid] == true && AcertouAsenha[playerid] == true)
assim que esta la
Essa callback está incompleta. Mande ela aqui completa até o final "return"
public OnPlayerText(playerid, text[])
{
new tmp[128];
if(Spawnado[playerid] == true && AcertouAsenha[playerid] == true)
{
if(AdminEspiando[playerid] <= 0)
{
if(HorasPreso[playerid] <= 0 && MinutosPreso[playerid] <= 0 && SegundosPreso[playerid] <= 0)
{
if(MinutosMorte[playerid] <= 0 && SegundosMorte[playerid] <= 0)
{
strmid(tmp, text,0,strlen(text));
if(strfind(text,"server lixo",true) != -1 || strfind(text,"fdp",true) != -1 || strfind(text,"7777",true) != -1)
{
new strsuspeito[128];
format(strsuspeito, sizeof(strsuspeito), "| ALERTA | %s[%d] digitou: %s", PlayerName(playerid), playerid, text);
for (new p = 0, j = GetPlayerPoolSize(); p <= j; p++)
{
if(IsPlayerConnected(p) && Spawnado[p] == true)
{
if(IsPlayerAdmin(p) || NivelAdmin[p] > 0)
{
SendClientMessage(p, 0xFF0000FF, strsuspeito);
}
}
}
SendClientMessage(playerid, 0xFF0000FF, "****");
return 0;
}
Isso pode ajudar:
Código: #define SCM SendClientMessage
public OnPlayerText(playerid, text[])
{
new tmp[128];
if(Spawnado[playerid] == true && AcertouAsenha[playerid] == true)
{
if(AdminEspiando[playerid] <= 0)
{
if(HorasPreso[playerid] <= 0 && MinutosPreso[playerid] <= 0 && SegundosPreso[playerid] <= 0)
{
if(MinutosMorte[playerid] <= 0 && SegundosMorte[playerid] <= 0)
{
strmid(tmp, text,0,strlen(text));
if(strfind(text,"server lixo",true) != -1 || strfind(text,"fdp",true) != -1 || strfind(text,"7777",true) != -1)
{
new strsuspeito[128];
format(strsuspeito, sizeof(strsuspeito), "| ALERTA | %s[%d] digitou: %s", GetPlayerName(playerid), playerid, text);
for (new p = 0, j = GetPlayerPoolSize(); p <= j; p++)
{
if(IsPlayerConnected(p) && Spawnado[p] == true)
{
new string[256];
format(string, sizeof(string),"%s[%d]: %s", PlayerName(playerid), playerid, text);
JogadoresProximo(6.0, playerid, string, -1, -1, -1, -1, -1);
if(IsPlayerAdmin(p) || NivelAdmin[p] > 0)
{
SCM(p, 0xFF0000FF, strsuspeito);
}
}
}
SCM(playerid, 0xFF0000FF, "****");
return 0;
}
forward JogadoresProximo(Float:radi, playerid, string[], col1, col2, col3, col4, col5);
public JogadoresProximo(Float:radi, playerid, string[], col1, col2, col3, col4, col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SCM(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SCM(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SCM(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SCM(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SCM(i, col5, string);
}
}
}
}
return 1;
}
RE: NAO MOSTRA MEU NOME NO CHAT - pushline - 08/11/2023
Dá pra mudar esse jogadores proximos pra um foreach com IsPlayerInRangeOfPoint.
(claro que nao eh igual ao do topico mas com foreach eh bem mais rapido e pratico do que aquela funçao enorme)
Código PHP: public OnPlayerText(playerid, text[]) { new Float:x, Float:y, Float:z, bool:alguem, namePlayer[MAX_PLAYER_NAME + 1]; GetPlayerPos(playerid, x, y, z); GetPlayerName(playerid, namePlayer, sizeof(namePlayer));
if (text[0] == ';' && text[1] != EOS) { foreach (new i : StreamedPlayer[playerid]) { if (IsPlayerInRangeOfPoint(i, 20.0, x, y, z)) { alguem = true; break; } }
if (!alguem) { return SendClientMessage(playerid, -1, "Ninguém está proximo"); }
foreach (new i : Player) { if (i == playerid || (Iter_Contains(StreamedPlayer[playerid], i) && IsPlayerInRangeOfPoint(i, 20.0, x, y, z))) { SendClientMessage(i, -1, "[Chat local] [%d] %s: %s", playerid, namePlayer, text[1]); } } } }
|