04.04.2011, 03:42
you can try my stock it never gave me problems
pawn Код:
stock CheckPlayerDistanceToVehicle(Float:radi, playerid, vehicleid)
{
if(IsPlayerConnected(playerid))
{
new Float:PX,Float:PY,Float:PZ,Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,PX,PY,PZ);
GetVehiclePos(vehicleid, X,Y,Z);
new Float:Distance = (X-PX)*(X-PX)+(Y-PY)*(Y-PY)+(Z-PZ)*(Z-PZ);
if(Distance <= radi*radi)
{
return true;
}
}
return false;
}