SA-MP Forums Archive
How to decrease the speed vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to decrease the speed vehicle (/showthread.php?tid=412025)



How to decrease the speed vehicle - CrossOv3r - 31.01.2013

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.");
            }



Re: How to decrease the speed vehicle - mastermax7777 - 31.01.2013

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


Re: How to decrease the speed vehicle - mamorunl - 31.01.2013

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


Respuesta: How to decrease the speed vehicle - OPremium - 31.01.2013

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