- Автор темы
- #1
У меня есть система экс. машин и им присвоена система ускорения, но я не понимаю что за что там отвечает, если кто-то знает помогите!
Вот код самой системы:
Вот код самой системы:
Pawn:
new vehicleid = GetPlayerVehicleID(playerid);
new Float:_coord[3];
GetVehicleVelocity(vehicleid,_coord[0],_coord[1],_coord[2]);
new Float:v_speed = floatsqroot(floatpower(floatabs(_coord[0]), 2.0)+ floatpower(floatabs(_coord[1]), 2.0)+ floatpower(floatabs(_coord[2]), 2.0))* 100.3 ;
GetVehicleRotation(vehicleid, _coord[0],_coord[1],_coord[2]);
if(IsValidDynamicObject ( rolls [ vehicleid ] [ 0 ] ) && player_accelerating[playerid] || IsValidDynamicObject ( bmwi8 [ vehicleid ] [ 0 ] ) && player_accelerating[playerid] || IsValidDynamicObject ( bmwM5 [ vehicleid ] [ 0 ] ) && player_accelerating[playerid] || IsValidDynamicObject ( bmwVIS [ vehicleid ] [ 0 ] ) && player_accelerating[playerid] || IsValidDynamicObject ( kovsh [ vehicleid ] [ 0 ] ) && player_accelerating[playerid] || IsValidDynamicObject ( amg [ vehicleid ] [ 0 ] ) && player_accelerating[playerid])
{
if(v_speed > 15 && ! IsVehicleDrivingBackwards(vehicleid) &&(_coord[2] - VEHICLE[vehicleid - 1][v_old_zangle] < 1 && _coord[2] - VEHICLE[vehicleid - 1][v_old_zangle] > - 1))
{
if(GetVehicleSpeed(vehicleid) < max_veh_speed[GetVehicleModel(vehicleid)- 400] && 30 > _coord[0] > - 30 && 15 > _coord[1] > - 15)
{
if(v_speed - VEHICLE[vehicleid - 1][v_old_speed] < 3 && v_speed - VEHICLE[vehicleid - 1][v_old_speed] > 0.6)
{
SetVehicleSpeed(vehicleid, v_speed + 0.349999 * 5);
VEHICLE[vehicleid - 1][v_old_zangle] = _coord[2];
}
}
else
{
if(v_speed - VEHICLE[vehicleid - 1][v_old_speed] < 3 && v_speed - VEHICLE[vehicleid - 1][v_old_speed] >= -1.5 && GetVehicleSpeed(vehicleid) < max_veh_speed[GetVehicleModel(vehicleid)- 400] - 50 + 0.349999 * 180)
{
if(30 > _coord[0] > - 30 && 15 > _coord[1] > - 15)
{
SetVehicleSpeed(vehicleid, v_speed + 0.349999 * 2);
VEHICLE[vehicleid - 1][v_old_zangle] = _coord[2];
}
}
}
}
}
VEHICLE[veh-1][v_X] = X;
VEHICLE[veh-1][v_Y] = Y;
VEHICLE[veh-1][v_Z] = Z;
VEHICLE[vehicleid - 1][v_old_zangle] = _coord[2];
VEHICLE[vehicleid - 1][v_old_speed] = v_speed;
if ( ! IsPlayerMobile ( playerid ) )
{
Update_Speedometr ( playerid );
}