19.02.2012, 13:43
Under OnGameModeInit:
Under OnPlayerKeyStateChange:
pawn Код:
for( new slots = GetMaxPlayers( ), i; i < slots; i ++ )
{
if( IsPlayerConnected( i ) && !IsPlayerNPC( i ) )
{
SpeedBoostMultiplier[ i ] = 3.0;
}
}
pawn Код:
if( newkeys & KEY_FIRE )
{
new Float:vx, Float:vy, Float:vz;
if( Teams[ playerid ] != FREEROAM ) break;
if( !IsPlayerInAnyVehicle( playerid ) ) break;
if( GetPlayerState( playerid ) != PLAYER_STATE_DRIVER ) break;
GetVehicleVelocity( GetPlayerVehicleID( playerid ), vx, vy, vz );
if( floatabs( vx ) < 3 && floatabs( vy ) < 3 && floatabs( vz ) < 3 )
{
SetVehicleVelocity( GetPlayerVehicleID( playerid ), vx * SpeedBoostMultiplier[ playerid ], vy * SpeedBoostMultiplier[ playerid ], vz * SpeedBoostMultiplier[ playerid ] );
}
return 1;
}