Question

Где найти изменение скорости в моде я забыл просто)

Share this post


Link to post

2 answers to this question

  • 0

Это ? 

    GetPlayerKeys(playerid, keys, _:vx, _:vx);

        if(speed <= g_tuning_engine[player_engine-1][E_MAX_SPEED] + g_vehicle_info[GetVehicleModel(vehicleid)-400][VI_MAX_SPEED])
        {
            if((keys & (KEY_VEHICLE_FORWARD | KEY_VEHICLE_BACKWARD | KEY_HANDBRAKE)) == KEY_VEHICLE_FORWARD)
            {
                GetVehicleVelocity(vehicleid, vx, vy, vz);

                vx *= 1.025;
                vy *= 1.025;

                if (vz > 0.04 || vz < -0.04)
                    vz -= 0.020;

                SetVehicleVelocity(vehicleid, vx, vy, vz);
            }
        }
    }
    return 1;
}

GetPlayerVehicleSpeedZ(playerid)
{
    if(!IsPlayerInAnyVehicle(playerid)) return true;
    new Float:X, Float:Y, Float:Z;
    GetVehicleVelocity(GetPlayerVehicleID(playerid),X,Y,Z);
    return floatround( floatsqroot( X * X + Y * Y) * 180.0 );
}

_SetVehicleSpeed(vehicleid, speed_kmph)
{
    if(speed_kmph < 1) speed_kmph = 1;
    new Float: v[3], cur_speed_kmph;
    GetVehicleVelocity(vehicleid, v[0], v[1], v[2]);
    cur_speed_kmph = floatround(200.0 * floatsqroot( v[0]*v[0] + v[1]*v[1] + v[2]*v[2]), floatround_floor);
    if(cur_speed_kmph <= 0)
    {
        new Float: zAngle;
        GetVehicleZAngle(vehicleid, zAngle);
        new Float: newVelX = floatcos((zAngle -= 270.0), degrees ) * speed_kmph / 200.0;
        SetVehicleVelocity(vehicleid, newVelX, floattan(zAngle,degrees) * newVelX, 0.0);
        return;
    }
    new Float: vMultiplier = float(speed_kmph) / float(cur_speed_kmph);
    SetVehicleVelocity(vehicleid, v[0] * vMultiplier, v[1] * vMultiplier, v[2] * vMultiplier);
}

stock SetVehicleSpeed(vehicleid, Float:speed)
{
    new Float:cr[4];
    GetVehicleZAngle(vehicleid, cr[0]);
    GetVehicleVelocity(vehicleid, cr[1], cr[2], cr[3]);
    SetVehicleVelocity(vehicleid, floatsin(-cr[0],degrees)*(speed/99), floatcos(-cr[0],degrees)*(speed/99), cr[3]);
    return true;
}

 

какое именно?

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0