SA-MP Forums Archive
how change vehicle speed - 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 change vehicle speed (/showthread.php?tid=515090)



how change vehicle speed - audriuxxx - 24.05.2014

Hi,

How to change vehicle max speed?

Some server do that.


Re: how change vehicle speed - Metharon - 24.05.2014

pawn Код:
#include <a_samp>
 
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
 
new Tick[MAX_PLAYERS];
 
public OnPlayerUpdate(playerid)
{
    Tick[playerid]++;
    if(Tick[playerid] != 3) return 1;
    Tick[playerid] = 0;
    new Keys,up,down;
        GetPlayerKeys(playerid,Keys,up,down);
    new Float:x,Float:y,Float:z;
    if(Keys &= 1024)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
 
            GetPlayerVelocity(playerid,x,y,z);
            SetPlayerVelocity(playerid,x*1.2,y*1.2,z*1.2);
        }
    }
    else if(Keys &= 4)
        {
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
            SetVehicleVelocity(GetPlayerVehicleID(playerid),x*1.2,y*1.2,z*1.2);
        }
    }
    return 1;
}



Re: how change vehicle speed - audriuxxx - 24.05.2014

Here you really don't make vehicle vehicle max speed bigger