How can I make that LSPD cruiser will be faster?
#1

How can I make that LSPD cruiser will be faster? by one key clicking like "shift" or something, I want it a bit more faster like Infernus or Turismo... I am sorry but I dont know how to start or if there is anyfilterscript on the forums has it cause I dont know the name of it.
Reply
#2

You should use SetVehicleVelocity.
See https://sampwiki.blast.hk/wiki/SetVehicleVelocity for more information and how to use it.
Reply
#3

pawn Код:
// after includes ?
new Float:vSPEED = 2.0;

// OnPlayerKeyStateChange
new vID = GetPlayerVehicleID(playerid),
    vModel = GetVehicleModel(vID);

if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && vModel == MODEL_ID_HERE) // add vehicle model ID here
{
    static Float:POS_X, Float:POS_Y, Float:POS_Z;

    GetVehicleVelocity(vID, POS_X, POS_Y, POS_Z);
    if(POS_X < 2.0 && POS_Y < 2.0 && POS_Z < 1.3)
    {
        SetVehicleVelocity(vID, floatmul(POS_X, vSPEED), floatmul(POS_Y, vSPEED), floatmul(POS_Z, vSPEED));
    }
}
Reply
#4

Quote:
Originally Posted by iZN
Посмотреть сообщение
pawn Код:
// after includes ?
new Float:vSPEED = 2.0;

// OnPlayerKeyStateChange
new vID = GetPlayerVehicleID(playerid),
    vModel = GetVehicleModel(vID);

if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && vModel == MODEL_ID_HERE) // add vehicle model ID here
{
    static Float:POS_X, Float:POS_Y, Float:POS_Z;

    GetVehicleVelocity(vID, POS_X, POS_Y, POS_Z);
    if(POS_X < 2.0 && POS_Y < 2.0 && POS_Z < 1.3)
    {
        SetVehicleVelocity(vID, floatmul(POS_X, vSPEED), floatmul(POS_Y, vSPEED), floatmul(POS_Z, vSPEED));
    }
}
Wow thank you very much, two questions:
Where should I place it into the script and how do you define the speed? I mean, how do you define the new Cruiser Speed will be exactly like Infernus?
Reply
#5

Place that under OnPlayerKeyStateChange and try changing that vSPEED till you reach the desired speed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)