vehicle speed boost
#1

hi
anyone knows how to fix this? i wrote this script but it works for cars only , it doesnt work for bikes, boats and shits
pawn Код:
if(IsPlayerInAnyVehicle(playerid))
    {
        if(newkeys & KEY_LOOK_BEHIND)
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            new Float:angle;
            GetVehicleZAngle(vehicleid, angle);
            new Float:velox, Float:veloy, Float:veloz;
            GetVehicleVelocity(vehicleid, velox, veloy, veloz);
            velox += floatsin(-angle, degrees);
            veloy += floatcos(-angle, degrees);
            SetVehicleVelocity(vehicleid, velox, veloy, veloz);
        }
    }
Reply
#2

I Dont think it works on Bikes, planes?
Reply
#3

what u mean?
well it doesnt , but i need to edit to make it work for bikes too
Reply
#4

I had similar problem months ago, and it worked only for vehicles. I'm now using something similar to the code above and it works for all the vehicles.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new
        Float:vx,
        Float:vy,
        Float:vz
    ;
    if((newkeys & KEY_LOOK_BEHIND) && !(oldkeys & KEY_LOOK_BEHIND))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
            if(floatabs(vx) < 3 && floatabs(vy) < 3 && floatabs(vz) < 3)
            {
                SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.5, vy * 1.5, vz * 1.5);
            }
        }
    }
    return 1;
}
By Matite (I think).
Reply
#5

thnaks so much for the help mate, but it doesn't work too
Reply
#6

The velocity can be set only for cars. You can use SetVehiclePos for this script
Reply
#7

Quote:
Originally Posted by feartonyb
Посмотреть сообщение
The velocity can be set only for cars. You can use SetVehiclePos for this script
You're wrong. It can be set for any available vehicle in SA:MP...
Reply
#8

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
You're wrong. It can be set for any available vehicle in SA:MP...
Nope. Doesn't take any effect on trains and some vehicles.
Reply
#9

nevermind , gonna get it from another script lol :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)