Player near another player
#5

pawn Код:
stock PlayerToPlayer(playerid,targetid,Float:distance)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid,x,y,z);
    if(IsPlayerInRangeOfPoint(targetid,distance,x,y,z))
    {
        return true;
    }
    return false;
}
I also suggest using something like this so you do not need to use a crap ton of lines, and it is also faster.

I made this myself, after seeing as the old PlayerToPlayer function I had I lost. Although, I am practicly CERTAIN this is the exact same as it.

Use it like so:

pawn Код:
if(PlayerToPlayer(playerid,i,7)) //Playerid is the playerid, i is a looped amount of players, and 7 is distance
        {
            //Something to do if they are in range of 7
Try something like that if you want to make it easier on yourself.
Reply


Messages In This Thread
Player near another player - by SumX - 14.08.2012, 04:55
Re: Player near another player - by BigAl - 14.08.2012, 05:04
Re: Player near another player - by IceMeteor - 14.08.2012, 05:05
Re: Player near another player - by SumX - 14.08.2012, 06:10
Re: Player near another player - by Kindred - 14.08.2012, 06:12

Forum Jump:


Users browsing this thread: 1 Guest(s)