Getting position behind vehicle
#4

Here's the function I use
DISCLAIMER: I didn't make the function,
PHP код:

stock GetPosBehindVehicle
(vehicleid, &Float:x, &Float:y, &Float:zFloat:offset=0.5//Credits go to MP2
{
    new 
Float:vehicleSize[3], Float:vehiclePos[3];
    
GetVehiclePos(vehicleidvehiclePos[0], vehiclePos[1], vehiclePos[2]);
    
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZEvehicleSize[0], vehicleSize[1], vehicleSize[2]);
    
GetXYBehindVehicle(vehicleidvehiclePos[0], vehiclePos[1], (vehicleSize[1]/2)+offset);
    
vehiclePos[0];
    
vehiclePos[1];
    
vehiclePos[2];
    return 
1;
}
stock GetXYBehindVehicle(vehicleid, &Float:q, &Float:wFloat:distance)//Credits go to MP2
{
    new 
Float:a;
    
GetVehiclePos(vehicleidqwa);
    
GetVehicleZAngle(vehicleida);
    
+= (distance * -floatsin(-adegrees));
    
+= (distance * -floatcos(-adegrees));

Reply


Messages In This Thread
Getting position behind vehicle - by TEKNOJIHAD1 - 20.06.2017, 20:56
Re: Getting position behind vehicle - by Vince - 20.06.2017, 21:12
Re: Getting position behind vehicle - by TEKNOJIHAD1 - 20.06.2017, 21:42
Re: Getting position behind vehicle - by Eoussama - 20.06.2017, 21:53

Forum Jump:


Users browsing this thread: 1 Guest(s)