GM:VehicleMove
This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.
Description
Called when you are driving a vehicle. This hook works just like GM:Move.
This hook is called before GM:Move and will be called when GM:PlayerTick is not.
Arguments
Example
Disables the base gamemode's 3rd person vehicle camera option.
hook.Add( "VehicleMove", "DisableVehicle3rdPerson", function( ply, vehicle, mv )
if ( mv:KeyPressed( IN_DUCK ) && vehicle.SetThirdPersonMode ) then
vehicle:SetThirdPersonMode( false )
return true -- Block the GM:VehicleMove which sets the 3rd person mode
end
end )