11/10/2021 16:43
Você pode usar essa function em qualquer lugar... Eu fiz um exemplo abaixo e acredito que seja oque você necessita, o código envia uma mensagem para jogadores que estejam a 25m de distância do playerid(o jogador que disse algo no chat).
Código PHP:
public OnPlayerText(playerid, text[])
{
new String[128], Float:P[3];
GetPlayerPos(playerid, P[0], P[1], P[2]);
format(String, sizeof(String), "%s diz: %s", GetPlayerNameEx(playerid), text);
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerInRangeOfPoint(i, 25.0, P[0], P[1], P[2]))
{
SendClientMessage(i, -1, String);
}
}
return 0;
}
stock GetPlayerNameEx(playerid)
{
new name_player[128];
GetPlayerName(playerid, name_player, 24);
new xB[24];
strmid(xB, name_player, 0, strlen(name_player), 24);
for(new i = 0; i < MAX_PLAYER_NAME; ++i)
{
if (xB[i] == '_') xB[i] = ' ';
}
return xB;
}