30.11.2013, 19:48
https://sampwiki.blast.hk/wiki/SetVehicleVelocity
An example of using speedboost while pressing the left mouse button:
An example of using speedboost while pressing the left mouse button:
pawn Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
if( ( newkeys & KEY_FIRE ) && !( oldkeys & KEY_FIRE ) )
{
if( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
{
new
Float: vx,
Float: vy,
Float: vz
;
GetVehicleVelocity( GetPlayerVehicleID( playerid ), vx, vy, vz );
SetVehicleVelocity( GetPlayerVehicleID( playerid ), vx * 1.2, vy * 1.2, vz * 1.2 );
}
}
return 1;
}