pawn Код:
stock IsPlayerInSphere(playerid,Float:x1,Float:y1,Float:z1,Float:radius)
{
new Float:xs,Float:ys,Float:zs;
GetPlayerPos(playerid,xs,ys,zs);
return (GetDistanceBetweenPoints(xs,ys,zs,x1,y1,z1)<=radius);
}
stock Float:GetDistanceBetweenPoints(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2) //By Gabriel "Larcius" Cordes
{
return floatadd(floatadd(floatsqroot(floatpower(floatsub(x1,x2),2)),floatsqroot(floatpower(floatsub(y1,y2),2))),floatsqroot(floatpower(floatsub(z1,z2),2)));
}
But why don't you just use IsPlayerInRangeOfPoint function which is native in SA-MP. It does pretty much the same thing.