01.04.2015, 09:59
(
Последний раз редактировалось BroZeus; 01.04.2015 в 14:39.
)
Well that's because you are not taking current speed of vehicle into account.
EDIT:
Well first take out current speed add that speed to "speed" variable then multiply it like this -
EDIT:
Well first take out current speed add that speed to "speed" variable then multiply it like this -
PHP код:
stock GetVehicleSpeed(vehicleid)//to take out vehicle speed
{
new Float:Vx, Float:Vy, Float:Vz;
GetVehicleVelocity(vehicleid, Vx, Vy, Vz);
new Float:rtn;
rtn = floatsqroot(floatpower(Vx*100,2) + floatpower(Vy*100,2));
rtn = floatsqroot(floatpower(rtn,2) + floatpower(Vz*100,2));
return floatround(rtn);
}
//now in 2nd method like this -
new
Float: Angle,
Float: AngleX,
Float: AngleY,
Float: VelocityX,
Float: VelocityY,
Float: VelocityZ,
Float:c_speed = GetVehicleSpeed(vehicleid);//current speed
;
GetVehicleVelocity(vehicleid, VelocityX, VelocityY, VelocityZ);
GetVehicleZAngle(vehicleid, Angle);
AngleX = floatsin(-Angle, degrees);
AngleY = floatcos(-Angle, degrees);
SetVehicleVelocity(vehicleid, AngleX * (speed+c_speed), AngleY * (speed+c_speed), VelocityZ);//note change in this line
}