20.10.2011, 22:11
It's a function I got from the forums here
As far as I know, it should work. At first I tried with IsPlayerInRangeOfPoint, which would work, but I figured this was easier to use. I don't have to get the position all the time, which makes it easier. And the code looks pretty fine to me.
Anyways, is there anything wrong with my loop?
pawn Код:
forward IsPlayerNearPlayer(playerid, n_playerid, Float:radius);
IsPlayerNearPlayer(playerid, n_playerid, Float:radius)
{
new Float:npx, Float:npy, Float:npz;
GetPlayerPos(n_playerid, npx, npy, npz);
if(IsPlayerInRangeOfPoint(playerid, radius, npx, npy, npz))
{
return true;
}
return false;
}
Anyways, is there anything wrong with my loop?