[Duda] SetVehicleVelocity
#5

Quote:
Originally Posted by OTACON
Посмотреть сообщение
pawn Код:
#include <a_samp>
#define pressed(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
    new vehicleid = GetPlayerVehicleID(playerid);
    if(pressed(KEY_FIRE)){
        IncreaseSpeed(vehicleid,5.0);
    }
    return true;
}

stock IncreaseSpeed(vehicleid,Float:speed){ //By OTACON
new Float:Velocity[4];
SetVehicleVelocity(vehicleid,0,0,0);
GetVehicleVelocity(vehicleid,Velocity[0],Velocity[1],Velocity[2]);
GetVehicleZAngle(vehicleid,Velocity[3]);
Velocity[0] = Velocity[0] + (speed/speed * floatsin(-Velocity[3], degrees));
Velocity[1] = Velocity[1] + (speed/speed * floatcos(-Velocity[3], degrees));
SetVehicleVelocity(vehicleid,Velocity[0],Velocity[1],Velocity[2]);}
Muchнsimas gracias amigo Otacon, me sъper sirviу .
Reply


Messages In This Thread
[Duda] SetVehicleVelocity - by RZoone - 11.01.2014, 18:54
Respuesta: [Duda] SetVehicleVelocity - by hotspicytaco - 11.01.2014, 19:36
Respuesta: [Duda] SetVehicleVelocity - by RZoone - 11.01.2014, 19:45
Respuesta: [Duda] SetVehicleVelocity - by OTACON - 11.01.2014, 20:22
Respuesta: [Duda] SetVehicleVelocity - by RZoone - 11.01.2014, 22:17

Forum Jump:


Users browsing this thread: 2 Guest(s)