Need function.
#1

Hello. I need some kind of function that it would check for example how far vehicle is from pick up. Or how much vehicle has run. I hope you understand me.
Reply
#2

I belive there are no function like that, never heard of it.

-In order to make it you can create it self by using wiki and alow of experience of pawno.
Reply
#3

pawn Код:
forward Float:GetDistanceBetweenVehicleToPoint(vehicleid,Float:px,Float:py,Float:pz);
public Float:GetDistanceBetweenVehicleToPoint(vehicleid,Float:px,Float:py,Float:pz);
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if(!IsVehicleConnected(p1) )
    {
        return -1.00;
    }
    GetVehiclePos(p1,x1,y1,z1);
    x2 = px;
    y2 = py;
    z2 = pz;
    return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}

stock IsVehicleConnected(vehicleid) //By Sacky (edited by Gabriel "Larcius" Cordes)
{
  new Float:x1,Float:y1,Float:z1;
  GetVehiclePos(vehicleid,x1,y1,z1);
  if(x1==0.0 && y1==0.0 && z1==0.0)
  {
    return 0;
  }
  return 1;
}
Just a modified GetDistanceBetweenPlayerToPoint i just modified ) Enjoy! not sure if it works though..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)