04.01.2009, 22:19
NOTE!: This is NOT tested by anyone, so it might won't work!
Credits to: Whoever made PlayerToPoint and Andre9977 for the style of posting a function
IsAtPoint(Float:radi, whatis[], id, Float
, Float:y, Float:z)
Float:radi - Radius
whatis - Can be playerid, vehicleid or objectid
id - The ID of either playerid, vehicleid or objectid. Depends on what you entered in whatis
Float
, Float:y, Float:z - The position we're checking player's/vehicle's/object's lenght from
Please if you test this, or just see it, tell me if this won't/doesn't work.
Then I'll just edit this post, without the code and all
Credits to: Whoever made PlayerToPoint and Andre9977 for the style of posting a function
IsAtPoint(Float:radi, whatis[], id, Float

Float:radi - Radius
whatis - Can be playerid, vehicleid or objectid
id - The ID of either playerid, vehicleid or objectid. Depends on what you entered in whatis
Float

pawn Код:
stock IsAtPoint(Float:radi, whatis, id, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
if(whatis == playerid)
GetPlayerPos(id, oldposx, oldposy, oldposz);
else if(whatis == objectid
GetObjectPos(id, oldposx, oldposy, oldposz);
else if(whatis == vehicleid
GetVehiclePos(id, oldposx, oldposy, oldposz);
else
return false;
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
Then I'll just edit this post, without the code and all