24.05.2014, 16:05
Hi,
How to change vehicle max speed?
Some server do that.
How to change vehicle max speed?
Some server do that.
#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;
}