2 Posts über dir.
stock getDistanceToObject(playerid, objectid, Float:Distance)
{
new Float:X,Float:Y,Float:z;
GetObjectPos(objectid,X,Y,Z);
if(IsPlayerInRangeOfPoint(playerid, 30.0,X,Y,Z)
{
if(objectid == 1251/*objektID*/)
{
SetObjectPos(objectid,X,Y,Z-2);
}
}
return 1;
}