14.08.2012, 06:12
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 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