How to make /do for nearby players?
#3

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:

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;
}
And then just replace your SendClientMessageToAll(COLOR_PURPLE, msg); with NearByMessage(playerid, COLOR_PURPLE, msg);
Reply


Messages In This Thread
How to make /do for nearby players? - by Injector - 07.01.2011, 12:33
Re: How to make /do for nearby players? - by GaB1TzZzu - 07.01.2011, 12:40
Re: How to make /do for nearby players? - by Alex_Valde - 07.01.2011, 12:44
Re: How to make /do for nearby players? - by GaB1TzZzu - 07.01.2011, 12:54
Re: How to make /do for nearby players? - by Injector - 07.01.2011, 12:55
Re: How to make /do for nearby players? - by GaB1TzZzu - 07.01.2011, 13:14

Forum Jump:


Users browsing this thread: