How to decrease the speed vehicle
#1

Hey guys, i'm trying to make a command to decrease the speed of vehicle. Like set a Max Speed for a vehicle.

I'm trying to do it whit: GetVehicleVelocity and SetVehicleVelocity, but doesnt works good. The car blows up for the air when i use it xD.

This is my example:
pawn Код:
if(!sscanf(params,"s[30]U(-1)D(-1)D(-1)",opc,jid,slot,precio))
        {
            if(!strcmp(opc,"velocidad",true))
            {
                new idcoche = GetPlayerVehicleID(playerid);
                if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    new Float:Velocity[3];
                    GetVehicleVelocity(idcoche, Velocity[0], Velocity[1], Velocity[2]);
                    SetVehicleVelocity(idcoche, Velocity[0]-0.1, Velocity[1]-0.1, Velocity[2]-0.1);
                }
                else Mensaje(playerid,color_msgsv,"Error: {FFFFFF}Tienes que ser el conductor para ajustar la velocidad.");
            }
Reply
#2

u need to get xy in front of vehicle, get direction i think and set vehicle velocity on a timer !
Reply
#3

It'll be really hard to control the max speed of a vehicle. The car blows up because it is going sideways (hence the reaction from mistermax7777 to propel the vehicle forward and not sideways). It is fun to watch it once though
Reply
#4

There is a filterscript that does this, check: https://sampforum.blast.hk/showthread.php?tid=179089
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)