07.01.2011, 12:44
I wouldn't suggest you to use ProxDetector (TIP: ProxDetectorS is for something else, not for this) for this. This NearByMessage is much simpler to understand.
But it's your choice.
You can use this:
And then just replace your SendClientMessageToAll(COLOR_PURPLE, msg); with NearByMessage(playerid, COLOR_PURPLE, msg);
But it's your choice.
You can use this:
pawn Код:
forward NearByMessage(playerid, colour, string[]);
public NearByMessage(playerid, colour, string[])
{
new Float:PlayerX, Float:PlayerY, Float:PlayerZ;
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(playerid,PlayerX, PlayerY, PlayerZ);
if(IsPlayerInRangeOfPoint(i, 12, PlayerX, PlayerY, PlayerZ))
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i))
{
SendClientMessage(i, colour, string);
}
}
}
}
return 1;
}

