13.03.2019, 01:24
Estou tentando fazer um chat pra que apenas pessoas proximas uma das outras consigam se comunicar, sу que nгo estб funcionando, a mensagem simplesmente nгo aparece pra outra pessoa.
PHP Code:
public OnPlayerText(playerid, text[])
{
if(Player[playerid][pAdminLevel] > 0)
{
new string[180], Float: pPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
format(string, sizeof(string), "%s %s[%d]: %s", GetPlayerAdminLevel(playerid), GetPlayerNameEx(playerid), playerid, text);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, pPos[0], pPos[1], pPos[2]))
{
SendClientMessage(i ,-1, string);
return 0;
}
}
}
return 1;
}