22/07/2023 19:39
Faz assim: o código fica bem mais limpo;
Código PHP:
new Chat = 1;
public OnPlayerText(playerid, text[])
{
new texto[255];
if(Chat)
{
switch(Player[playerid][Vip])
{
case 1: format(texto, sizeof(texto), "| próximo | %s(%d) [{1AB5FF}VIP{80FF00}] diz: %s", GetPlayerNameEx(playerid), playerid, text);
case 2: format(texto, sizeof(texto), "| próximo | %s(%d) [{1AB5FF}VIP{CAA520}+{80FF00}] diz: %s", GetPlayerNameEx(playerid), playerid, text);
default: format(texto, sizeof(texto), "| NOVATO | %s(%d) diz: %s", GetPlayerNameEx(playerid), playerid, text);
}
SendClientMessageInRange(15.0, playerid, texto, 0x80FF00AA, 0x80FF00AA, 0x80FF00AA, 0x80FF00AA, 0x80FF00AA);
format(texto, sizeof(texto), "%s diz: %s", GetPlayerNameEx(playerid), playerid, text);
fileLog("ChatProximo", texto);
return false;
}
return true;
}
SendClientMessageInRange(Float:_r, playerid, const _s[],c1,c2,c3,c4,c5)
{
new Float:_x, Float:_y, Float:_z;
GetPlayerPos(playerid, _x, _y, _z);
foreach(new i : Player)
{
if(Player[i][Admin] > 0 || Player[i][Mod] > 0 || Player[i][Pika] > 0)
{
if(GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(playerid) && GetPlayerInterior(i) != GetPlayerInterior(playerid))continue;
if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r/16)
SendClientMessage(i, c1, _s);
else if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r/8)
SendClientMessage(i, c2, _s);
else if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r/4)
SendClientMessage(i, c3, _s);
else if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r/2)
SendClientMessage(i, c4, _s);
else if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r)
SendClientMessage(i, c5, _s);
}
else
{
SendClientMessage(i, roxo, _s);
}
}
return true;
}
k2bi#9906
[C.E.O]Brasil Play Socity
[C.E.O]Brasil Play Socity